@nocobase/auth 0.17.0-alpha.6 → 0.18.0-alpha.1
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/lib/auth-manager.d.ts +6 -2
- package/lib/auth.d.ts +4 -3
- package/package.json +7 -7
package/lib/auth-manager.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Context, Next } from '@nocobase/actions';
|
|
2
|
-
import { Model } from '@nocobase/database';
|
|
3
2
|
import { Registry } from '@nocobase/utils';
|
|
4
3
|
import { Auth, AuthExtend } from './auth';
|
|
5
4
|
import { JwtOptions, JwtService } from './base/jwt-service';
|
|
6
5
|
import { ITokenBlacklistService } from './base/token-blacklist-service';
|
|
6
|
+
export interface Authenticator {
|
|
7
|
+
authType: string;
|
|
8
|
+
options: Record<string, any>;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
7
11
|
export interface Storer {
|
|
8
|
-
get: (name: string) => Promise<
|
|
12
|
+
get: (name: string) => Promise<Authenticator>;
|
|
9
13
|
}
|
|
10
14
|
export type AuthManagerOptions = {
|
|
11
15
|
authKey: string;
|
package/lib/auth.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Context } from '@nocobase/actions';
|
|
2
2
|
import { Model } from '@nocobase/database';
|
|
3
|
+
import { Authenticator } from './auth-manager';
|
|
3
4
|
export type AuthConfig = {
|
|
4
|
-
authenticator:
|
|
5
|
+
authenticator: Authenticator;
|
|
5
6
|
options: {
|
|
6
7
|
[key: string]: any;
|
|
7
8
|
};
|
|
@@ -17,13 +18,13 @@ interface IAuth {
|
|
|
17
18
|
}
|
|
18
19
|
export declare abstract class Auth implements IAuth {
|
|
19
20
|
abstract user: Model;
|
|
20
|
-
protected authenticator:
|
|
21
|
+
protected authenticator: Authenticator;
|
|
21
22
|
protected options: {
|
|
22
23
|
[key: string]: any;
|
|
23
24
|
};
|
|
24
25
|
protected ctx: Context;
|
|
25
26
|
constructor(config: AuthConfig);
|
|
26
|
-
abstract check():
|
|
27
|
+
abstract check(): Promise<Model>;
|
|
27
28
|
signIn(): Promise<any>;
|
|
28
29
|
signUp(): Promise<any>;
|
|
29
30
|
signOut(): Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/actions": "0.
|
|
10
|
-
"@nocobase/cache": "0.
|
|
11
|
-
"@nocobase/database": "0.
|
|
12
|
-
"@nocobase/resourcer": "0.
|
|
13
|
-
"@nocobase/utils": "0.
|
|
9
|
+
"@nocobase/actions": "0.18.0-alpha.1",
|
|
10
|
+
"@nocobase/cache": "0.18.0-alpha.1",
|
|
11
|
+
"@nocobase/database": "0.18.0-alpha.1",
|
|
12
|
+
"@nocobase/resourcer": "0.18.0-alpha.1",
|
|
13
|
+
"@nocobase/utils": "0.18.0-alpha.1",
|
|
14
14
|
"@types/jsonwebtoken": "^8.5.8",
|
|
15
15
|
"jsonwebtoken": "^8.5.1"
|
|
16
16
|
},
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
20
20
|
"directory": "packages/auth"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "0f5f1c0a37dc397a9dc4c8eec0c4ec20fd8107b0"
|
|
23
23
|
}
|