Comparing version 0.1.0 to 0.1.1
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ { |
@@ -17,3 +17,3 @@ import * as casbin from 'casbin'; | ||
* "auto": Specify the casbin server endpoint, and Casbin.js will load permission from it when the identity changes | ||
* "cookies": Casbin.js load the permission data from the cookie "casbin_permission" or the specified cookie key. | ||
* "cookies": Casbin.js load the permission data from the cookie "access_perm" or the specified cookie key. | ||
* "manual": Load the permission mannually with "setPermission" | ||
@@ -20,0 +20,0 @@ * @param args.endpoint Casbin service endpoint, REQUIRED when mode == "auto" |
@@ -71,3 +71,3 @@ "use strict"; | ||
* "auto": Specify the casbin server endpoint, and Casbin.js will load permission from it when the identity changes | ||
* "cookies": Casbin.js load the permission data from the cookie "casbin_permission" or the specified cookie key. | ||
* "cookies": Casbin.js load the permission data from the cookie "access_perm" or the specified cookie key. | ||
* "manual": Load the permission mannually with "setPermission" | ||
@@ -100,3 +100,3 @@ * @param args.endpoint Casbin service endpoint, REQUIRED when mode == "auto" | ||
this.mode = mode; | ||
const permission = Cookies.get(args.cookieKey ? args.cookieKey : "casbin_perm"); | ||
const permission = Cookies.get(args.cookieKey ? args.cookieKey : "access_perm"); | ||
if (permission) { | ||
@@ -180,3 +180,3 @@ this.setPermission(permission); | ||
} | ||
return [4 /*yield*/, axios_1.default.get(this.endpoint + "?casbin_subject=" + this.user)]; | ||
return [4 /*yield*/, axios_1.default.get(this.endpoint + "?subject=" + this.user)]; | ||
case 1: | ||
@@ -183,0 +183,0 @@ resp = _a.sent(); |
@@ -0,0 +0,0 @@ export declare function saveToLocalStorage(key: string, value: string, expired: number): number; |
@@ -5,2 +5,5 @@ "use strict"; | ||
var isLocalStorageAvailable = (function () { | ||
if (!window.localStorage) { | ||
return false; | ||
} | ||
try { | ||
@@ -10,3 +13,3 @@ var key = "fUjXn2r59"; // A random key | ||
localStorage.setItem(key, value); | ||
var gotValue = localStorage.getItem(key); | ||
localStorage.getItem(key); | ||
localStorage.removeItem(key); | ||
@@ -13,0 +16,0 @@ return true; |
export * from './Authorizer'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { StringKV } from './types'; |
@@ -0,0 +0,0 @@ "use strict"; |
export interface StringKV { | ||
[key: string]: string[]; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
export declare function sleep(ms: number): Promise<unknown>; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "casbin.js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "./lib/index.js", | ||
@@ -24,3 +24,2 @@ "types": "./lib/index.d.ts", | ||
"@typescript-eslint/parser": "^3.2.0", | ||
"casbin": "^5.1.2", | ||
"clean-webpack-plugin": "^3.0.0", | ||
@@ -46,6 +45,7 @@ "eslint": "^7.7.0", | ||
"@babel/preset-env": "^7.11.0", | ||
"axios": "^0.19.2", | ||
"axios": "^0.21.1", | ||
"babel-loader": "^8.1.0", | ||
"casbin": "^5.4.2", | ||
"js-cookie": "^2.2.1" | ||
} | ||
} |
# Casbin.js | ||
[![NPM version](https://img.shields.io/npm/v/casbin.js)](https://www.npmjs.com/package/casbin.js) | ||
[![Build Status](https://api.travis-ci.com/casbin/casbin.js.svg?branch=master)](https://travis-ci.com/github/casbin/casbin.js) | ||
[![codebeat badge](https://codebeat.co/badges/74b3febb-292f-4633-81df-3a76ea445cd8)](https://codebeat.co/projects/github-com-casbin-casbin-js-master) | ||
![Code size](https://img.shields.io/github/languages/code-size/casbin/casbin.js) | ||
Casbin.js is a frontend port of a backend Casbin service, which facilitates the manipulation, management and storage of the user permission in a frontend application. | ||
@@ -4,0 +9,0 @@ |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22
59
44779
6
21
620
1
+ Addedcasbin@^5.4.2
+ Added@casbin/expression-eval@5.3.0(transitive)
+ Added@types/node@22.9.3(transitive)
+ Addedawait-lock@2.2.2(transitive)
+ Addedaxios@0.21.4(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedcaniuse-lite@1.0.30001684(transitive)
+ Addedcasbin@5.36.0(transitive)
+ Addedcsv-parse@5.6.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedjsep@0.3.5(transitive)
+ Addedminimatch@7.4.6(transitive)
- Removed@types/node@22.9.1(transitive)
- Removedaxios@0.19.2(transitive)
- Removedcaniuse-lite@1.0.30001683(transitive)
- Removedfollow-redirects@1.5.10(transitive)
Updatedaxios@^0.21.1