@stacksjs/auth 0.75.357 → 0.75.361
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/dist/authentication.d.ts +2 -1
- package/dist/impersonation.d.ts +5 -1
- package/package.json +14 -14
package/dist/authentication.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { requestToken } from './request-token';
|
|
2
2
|
import { User } from '@stacksjs/orm';
|
|
3
3
|
import type { AuthCredentials, AuthToken, NewAccessToken, PersonalAccessToken, TokenCreateOptions } from '@stacksjs/types';
|
|
4
|
+
import type { ImpersonationGrant } from './impersonation';
|
|
4
5
|
declare type UserModel = NonNullable<Awaited<ReturnType<typeof User.find>>>;
|
|
5
6
|
export declare class Auth {
|
|
6
7
|
static attempt(credentials: AuthCredentials): Promise<boolean>;
|
|
@@ -24,7 +25,7 @@ export declare class Auth {
|
|
|
24
25
|
static requestToken(credentials: AuthCredentials, clientId: number, clientSecret: string): Promise<{ token: AuthToken } | null>;
|
|
25
26
|
static validateToken(token: string): Promise<boolean>;
|
|
26
27
|
static getUserFromToken(token: string): Promise<UserModel | undefined>;
|
|
27
|
-
static startImpersonation(subjectId: number, reason: string): Promise<
|
|
28
|
+
static startImpersonation(subjectId: number, reason: string): Promise<ImpersonationGrant>;
|
|
28
29
|
static endImpersonation(credential: string): Promise<void>;
|
|
29
30
|
static currentAccessToken(): Promise<PersonalAccessToken | undefined>;
|
|
30
31
|
static tokenCan(ability: string): Promise<boolean>;
|
package/dist/impersonation.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare function credentialHash(value: string): string;
|
|
|
5
5
|
* original credential. The host must resolve it at its authentication boundary.
|
|
6
6
|
*/
|
|
7
7
|
export declare function createImpersonationService(store: ImpersonationStore, authority: ImpersonationAuthority): {
|
|
8
|
-
start: (subjectId: number, reason: string) => Promise<
|
|
8
|
+
start: (subjectId: number, reason: string) => Promise<ImpersonationGrant>;
|
|
9
9
|
resolve: (credential: string, access: ImpersonationAccess) => Promise<ImpersonationSession | null>;
|
|
10
10
|
end: (credential: string) => Promise<void>
|
|
11
11
|
};
|
|
@@ -19,6 +19,10 @@ export declare interface ImpersonationSession {
|
|
|
19
19
|
expiresAt: number
|
|
20
20
|
endedAt: number | null
|
|
21
21
|
}
|
|
22
|
+
export declare interface ImpersonationGrant {
|
|
23
|
+
credential: string
|
|
24
|
+
session: ImpersonationSession
|
|
25
|
+
}
|
|
22
26
|
export declare interface ImpersonationAccess {
|
|
23
27
|
method: string
|
|
24
28
|
path: string
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/auth",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.361",
|
|
6
6
|
"description": "A more simplistic way to authenticate.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -59,19 +59,19 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@stacksjs/bun-router": "^0.1.24",
|
|
62
|
-
"@stacksjs/cache": "0.75.
|
|
63
|
-
"@stacksjs/config": "0.75.
|
|
64
|
-
"@stacksjs/database": "0.75.
|
|
65
|
-
"@stacksjs/email": "0.75.
|
|
66
|
-
"@stacksjs/env": "0.75.
|
|
67
|
-
"@stacksjs/error-handling": "0.75.
|
|
68
|
-
"@stacksjs/logging": "0.75.
|
|
69
|
-
"@stacksjs/orm": "0.75.
|
|
70
|
-
"@stacksjs/path": "0.75.
|
|
71
|
-
"@stacksjs/router": "0.75.
|
|
72
|
-
"@stacksjs/security": "0.75.
|
|
73
|
-
"@stacksjs/socials": "0.75.
|
|
74
|
-
"@stacksjs/storage": "0.75.
|
|
62
|
+
"@stacksjs/cache": "0.75.361",
|
|
63
|
+
"@stacksjs/config": "0.75.361",
|
|
64
|
+
"@stacksjs/database": "0.75.361",
|
|
65
|
+
"@stacksjs/email": "0.75.361",
|
|
66
|
+
"@stacksjs/env": "0.75.361",
|
|
67
|
+
"@stacksjs/error-handling": "0.75.361",
|
|
68
|
+
"@stacksjs/logging": "0.75.361",
|
|
69
|
+
"@stacksjs/orm": "0.75.361",
|
|
70
|
+
"@stacksjs/path": "0.75.361",
|
|
71
|
+
"@stacksjs/router": "0.75.361",
|
|
72
|
+
"@stacksjs/security": "0.75.361",
|
|
73
|
+
"@stacksjs/socials": "0.75.361",
|
|
74
|
+
"@stacksjs/storage": "0.75.361",
|
|
75
75
|
"@stacksjs/ts-auth": "^0.4.7",
|
|
76
76
|
"ts-qr-codes": "^0.1.8"
|
|
77
77
|
},
|