@travetto/auth 3.0.0-rc.8 → 3.0.0
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 +8 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<!-- This file was generated by @travetto/doc and should not be modified directly -->
|
|
2
2
|
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/auth/DOC.ts and execute "npx trv doc" to rebuild -->
|
|
3
3
|
# Authentication
|
|
4
|
-
## Authentication scaffolding for the
|
|
4
|
+
## Authentication scaffolding for the Travetto framework
|
|
5
5
|
|
|
6
6
|
**Install: @travetto/auth**
|
|
7
7
|
```bash
|
|
8
8
|
npm install @travetto/auth
|
|
9
|
+
|
|
10
|
+
# or
|
|
11
|
+
|
|
12
|
+
yarn add @travetto/auth
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
This module provides the high-level backdrop for managing security principals. The goal of this module is to be a centralized location for various security frameworks to plug into. The primary contributions are:
|
|
@@ -129,7 +133,7 @@ export class AuthUtil {
|
|
|
129
133
|
*
|
|
130
134
|
* @param roles Roles to build matcher for
|
|
131
135
|
*/
|
|
132
|
-
static roleMatcher(roles: string[]): (perms: Set<string>) => boolean
|
|
136
|
+
static roleMatcher(roles: string[]): (perms: Set<string>) => boolean;
|
|
133
137
|
/**
|
|
134
138
|
* Generate a hash for a given value
|
|
135
139
|
*
|
|
@@ -139,7 +143,7 @@ export class AuthUtil {
|
|
|
139
143
|
* @param keylen Length of hash
|
|
140
144
|
* @param digest Digest method
|
|
141
145
|
*/
|
|
142
|
-
static generateHash(value: string, salt: string, iterations = 25000, keylen = 256, digest = 'sha256'): Promise<string
|
|
146
|
+
static generateHash(value: string, salt: string, iterations = 25000, keylen = 256, digest = 'sha256'): Promise<string>;
|
|
143
147
|
/**
|
|
144
148
|
* Generate a salted password, with the ability to validate the password
|
|
145
149
|
*
|
|
@@ -147,7 +151,7 @@ export class AuthUtil {
|
|
|
147
151
|
* @param salt Salt value, or if a number, length of salt
|
|
148
152
|
* @param validator Optional function to validate your password
|
|
149
153
|
*/
|
|
150
|
-
static async generatePassword(password: string, salt: number | string = 32): Promise<{ salt: string, hash: string }
|
|
154
|
+
static async generatePassword(password: string, salt: number | string = 32): Promise<{ salt: string, hash: string }>;
|
|
151
155
|
}
|
|
152
156
|
```
|
|
153
157
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/auth",
|
|
3
|
-
"version": "3.0.0
|
|
4
|
-
"description": "Authentication scaffolding for the
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Authentication scaffolding for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
7
7
|
"travetto",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"directory": "module/auth"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@travetto/base": "^3.0.0
|
|
26
|
+
"@travetto/base": "^3.0.0"
|
|
27
27
|
},
|
|
28
28
|
"travetto": {
|
|
29
29
|
"displayName": "Authentication"
|