@travetto/auth 4.0.0-rc.0 → 4.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -6
- package/package.json +2 -2
- package/src/util.ts +0 -21
package/README.md
CHANGED
|
@@ -126,12 +126,6 @@ const pbkdf2 = util.promisify(crypto.pbkdf2);
|
|
|
126
126
|
* Standard auth utilities
|
|
127
127
|
*/
|
|
128
128
|
export class AuthUtil {
|
|
129
|
-
/**
|
|
130
|
-
* Build matcher for permissions in allow/deny fashion
|
|
131
|
-
*
|
|
132
|
-
* @param permissions Permissions to build matcher for
|
|
133
|
-
*/
|
|
134
|
-
static permissionMatcher(permissions: string[]): (perms: Set<string>) => boolean;
|
|
135
129
|
/**
|
|
136
130
|
* Generate a hash for a given value
|
|
137
131
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/auth",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.2",
|
|
4
4
|
"description": "Authentication scaffolding for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"directory": "module/auth"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@travetto/base": "^4.0.0-rc.
|
|
26
|
+
"@travetto/base": "^4.0.0-rc.2"
|
|
27
27
|
},
|
|
28
28
|
"travetto": {
|
|
29
29
|
"displayName": "Authentication"
|
package/src/util.ts
CHANGED
|
@@ -10,27 +10,6 @@ const pbkdf2 = util.promisify(crypto.pbkdf2);
|
|
|
10
10
|
*/
|
|
11
11
|
export class AuthUtil {
|
|
12
12
|
|
|
13
|
-
static #matchPermissionSet(rule: string[], perms: Set<string>): boolean {
|
|
14
|
-
for (const el of rule) {
|
|
15
|
-
if (!perms.has(el)) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Build matcher for permissions in allow/deny fashion
|
|
24
|
-
*
|
|
25
|
-
* @param permissions Permissions to build matcher for
|
|
26
|
-
*/
|
|
27
|
-
static permissionMatcher(permissions: string[]): (perms: Set<string>) => boolean {
|
|
28
|
-
return Util.allowDenyMatcher<string[], [Set<string>]>(permissions,
|
|
29
|
-
x => x.split('|'),
|
|
30
|
-
this.#matchPermissionSet.bind(this),
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
13
|
/**
|
|
35
14
|
* Generate a hash for a given value
|
|
36
15
|
*
|