feat: upgrade casbin to latest v5.26.1 (#87)
This commit is contained in:
parent
dce76d8d2e
commit
e13f7f9dd7
|
@ -0,0 +1,19 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
webpack: {
|
||||
configure: {
|
||||
resolve: {
|
||||
fallback: {
|
||||
fs: false
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
Buffer: ['buffer', 'Buffer']
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
22
package.json
22
package.json
|
@ -6,8 +6,9 @@
|
|||
"keywords": [],
|
||||
"main": "src/index.js",
|
||||
"dependencies": {
|
||||
"casbin": "5.14.0-beta.4",
|
||||
"casbin": "^5.26.1",
|
||||
"codemirror": "5.58.2",
|
||||
"minimatch": "^9.0.0",
|
||||
"normalize.css": "^8.0.1",
|
||||
"react": "16.12.0",
|
||||
"react-codemirror2": "6.0.0",
|
||||
|
@ -15,6 +16,7 @@
|
|||
"styled-components": "4.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@craco/craco": "^7.1.0",
|
||||
"@types/codemirror": "^0.0.80",
|
||||
"@types/reach__router": "^1.2.6",
|
||||
"@types/react": "^16.9.32",
|
||||
|
@ -22,6 +24,7 @@
|
|||
"@types/styled-components": "^4.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.7.0",
|
||||
"@typescript-eslint/parser": "^2.7.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"eslint": "^6.6.0",
|
||||
"eslint-config-prettier": "^6.5.0",
|
||||
"eslint-plugin-prettier": "^3.1.1",
|
||||
|
@ -29,15 +32,15 @@
|
|||
"husky": "^3.0.9",
|
||||
"prettier": "^1.19.1",
|
||||
"pretty-quick": "^2.0.1",
|
||||
"react-scripts": "^3.4.1",
|
||||
"react-scripts": "^5.0.1",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"build-localhost": "PUBLIC_URL=/ react-scripts build",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject",
|
||||
"start": "craco start",
|
||||
"build": "craco build",
|
||||
"build-localhost": "PUBLIC_URL=/ craco build",
|
||||
"test": "craco test --env=jsdom",
|
||||
"eject": "craco eject",
|
||||
"lint": "eslint . --ext .js,.ts,.tsx",
|
||||
"predeploy": "npm run build",
|
||||
"deploy": "gh-pages -d build"
|
||||
|
@ -47,5 +50,8 @@
|
|||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
]
|
||||
],
|
||||
"browser": {
|
||||
"fs": false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import { Button, Echo } from '../ui';
|
||||
import { DefaultRoleManager, newEnforcer, newModel, MemoryAdapter, Util } from 'casbin';
|
||||
import { DefaultRoleManager, newEnforcer, newModel, StringAdapter, Util } from 'casbin';
|
||||
|
||||
interface RunTestProps {
|
||||
model: string;
|
||||
|
@ -69,7 +69,7 @@ async function enforcer(props: RunTestProps) {
|
|||
const startTime = performance.now();
|
||||
const result = [];
|
||||
try {
|
||||
const e = await newEnforcer(newModel(props.model), props.policy ? new MemoryAdapter(props.policy) : undefined);
|
||||
const e = await newEnforcer(newModel(props.model), props.policy ? new StringAdapter(props.policy) : undefined);
|
||||
|
||||
const customConfigCode = props.customConfig;
|
||||
if (customConfigCode) {
|
||||
|
|
Loading…
Reference in New Issue