@dereekb/firebase-server 13.11.14 → 13.11.15
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/index.cjs.js +229 -199
- package/index.esm.js +230 -200
- package/mailgun/package.json +9 -9
- package/model/index.cjs.js +259 -270
- package/model/index.esm.js +259 -270
- package/model/package.json +9 -9
- package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +3 -3
- package/model/src/lib/notification/notification.action.server.d.ts +34 -34
- package/model/src/lib/notification/notification.action.server.init.d.ts +17 -17
- package/model/src/lib/notification/notification.config.service.d.ts +7 -7
- package/model/src/lib/notification/notification.create.run.d.ts +3 -3
- package/model/src/lib/notification/notification.error.d.ts +14 -14
- package/model/src/lib/notification/notification.expedite.service.d.ts +7 -7
- package/model/src/lib/notification/notification.module.d.ts +13 -13
- package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +2 -2
- package/model/src/lib/notification/notification.send.service.text.d.ts +1 -1
- package/model/src/lib/notification/notification.task.service.handler.d.ts +2 -2
- package/model/src/lib/notification/notification.task.service.util.d.ts +3 -3
- package/model/src/lib/notification/notification.task.subtask.handler.d.ts +3 -3
- package/model/src/lib/notification/notification.util.d.ts +8 -8
- package/model/src/lib/storagefile/storagefile.action.server.d.ts +43 -44
- package/model/src/lib/storagefile/storagefile.action.server.init.d.ts +11 -11
- package/model/src/lib/storagefile/storagefile.error.d.ts +15 -15
- package/model/src/lib/storagefile/storagefile.module.d.ts +10 -10
- package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +6 -6
- package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +5 -5
- package/model/src/lib/storagefile/storagefile.util.d.ts +2 -2
- package/oidc/index.cjs.js +219 -219
- package/oidc/index.esm.js +219 -219
- package/oidc/package.json +10 -10
- package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +44 -25
- package/oidc/src/lib/controller/oidc.provider.controller.d.ts +1 -1
- package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +3 -3
- package/oidc/src/lib/middleware/oauth-cors.module.d.ts +1 -1
- package/oidc/src/lib/model/jwks/jwks.d.ts +6 -6
- package/oidc/src/lib/model/jwks/jwks.query.d.ts +5 -5
- package/oidc/src/lib/model/oidc/oidcmodel.action.server.d.ts +12 -12
- package/oidc/src/lib/model/oidc/oidcmodel.module.d.ts +5 -5
- package/oidc/src/lib/oidc.config.d.ts +1 -1
- package/oidc/src/lib/oidc.module.d.ts +8 -8
- package/oidc/src/lib/service/oidc.account.service.d.ts +4 -4
- package/oidc/src/lib/service/oidc.adapter.service.d.ts +4 -4
- package/oidc/src/lib/service/oidc.client.service.d.ts +3 -3
- package/oidc/src/lib/service/oidc.config.service.d.ts +1 -1
- package/oidc/src/lib/service/oidc.encryption.service.d.ts +4 -4
- package/oidc/src/lib/service/oidc.interaction.service.d.ts +14 -14
- package/oidc/src/lib/service/oidc.jwks.service.d.ts +6 -6
- package/oidc/src/lib/service/oidc.service.d.ts +5 -5
- package/package.json +10 -10
- package/src/lib/auth/auth.service.d.ts +8 -8
- package/src/lib/auth/auth.util.d.ts +1 -1
- package/src/lib/env/env.config.d.ts +5 -4
- package/src/lib/firestore/driver.accessor.batch.d.ts +2 -1
- package/src/lib/firestore/driver.accessor.d.ts +1 -1
- package/src/lib/firestore/driver.accessor.default.d.ts +2 -1
- package/src/lib/firestore/driver.accessor.transaction.d.ts +2 -1
- package/src/lib/firestore/snapshot/snapshot.field.encrypt.d.ts +10 -6
- package/src/lib/function/type.d.ts +4 -4
- package/src/lib/nest/analytics/analytics.module.d.ts +6 -5
- package/src/lib/nest/app.d.ts +4 -4
- package/src/lib/nest/app.module.d.ts +3 -2
- package/src/lib/nest/auth/auth.module.d.ts +4 -3
- package/src/lib/nest/controller/model/model.api.controller.d.ts +1 -0
- package/src/lib/nest/controller/model/model.api.get.service.d.ts +1 -1
- package/src/lib/nest/controller/model/model.api.module.d.ts +4 -3
- package/src/lib/nest/development/development.function.d.ts +1 -1
- package/src/lib/nest/development/development.schedule.function.error.d.ts +2 -2
- package/src/lib/nest/env/env.util.d.ts +2 -2
- package/src/lib/nest/firestore/firestore.module.d.ts +16 -15
- package/src/lib/nest/function/call.d.ts +6 -6
- package/src/lib/nest/function/context.d.ts +7 -6
- package/src/lib/nest/function/v2/blocking.d.ts +8 -6
- package/src/lib/nest/function/v2/call.d.ts +7 -5
- package/src/lib/nest/function/v2/event.d.ts +3 -2
- package/src/lib/nest/function/v2/schedule.d.ts +3 -2
- package/src/lib/nest/function/v2/taskqueue.d.ts +2 -1
- package/src/lib/nest/model/analytics.emit.d.ts +5 -5
- package/src/lib/nest/model/api.details.d.ts +4 -4
- package/src/lib/nest/model/query.model.function.d.ts +3 -3
- package/src/lib/nest/nest.provider.d.ts +7 -7
- package/src/lib/nest/storage/storage.module.d.ts +6 -5
- package/src/lib/storage/driver.accessor.d.ts +10 -10
- package/test/index.cjs.js +48 -57
- package/test/index.esm.js +48 -57
- package/test/package.json +11 -11
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +18 -18
- package/test/src/lib/firebase/firebase.admin.collection.d.ts +7 -7
- package/test/src/lib/firebase/firebase.admin.d.ts +2 -2
- package/test/src/lib/firebase/firebase.admin.function.d.ts +2 -2
- package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.d.ts +1 -1
- package/test/src/lib/firebase/firebase.admin.nest.function.cloud.context.d.ts +3 -3
- package/test/src/lib/firebase/firebase.d.ts +6 -5
- package/test/src/lib/firebase/firebase.function.d.ts +31 -31
- package/test/src/lib/firestore/firestore.d.ts +2 -2
- package/test/src/lib/oidc/oidc.test.fixture.d.ts +1 -1
- package/test/src/lib/oidc/oidc.test.flow.d.ts +1 -1
- package/test/src/lib/storage/storage.d.ts +2 -2
- package/zoho/index.cjs.js +2 -2
- package/zoho/index.esm.js +2 -2
- package/zoho/package.json +9 -9
- package/zoho/src/lib/zoho.accounts.firebase.d.ts +1 -1
- package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +1 -1
package/oidc/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/oidc",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.15",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/analytics": "13.11.
|
|
6
|
-
"@dereekb/date": "13.11.
|
|
7
|
-
"@dereekb/firebase": "13.11.
|
|
8
|
-
"@dereekb/firebase-server": "13.11.
|
|
9
|
-
"@dereekb/model": "13.11.
|
|
10
|
-
"@dereekb/nestjs": "13.11.
|
|
11
|
-
"@dereekb/rxjs": "13.11.
|
|
12
|
-
"@dereekb/util": "13.11.
|
|
13
|
-
"@dereekb/zoho": "13.11.
|
|
5
|
+
"@dereekb/analytics": "13.11.15",
|
|
6
|
+
"@dereekb/date": "13.11.15",
|
|
7
|
+
"@dereekb/firebase": "13.11.15",
|
|
8
|
+
"@dereekb/firebase-server": "13.11.15",
|
|
9
|
+
"@dereekb/model": "13.11.15",
|
|
10
|
+
"@dereekb/nestjs": "13.11.15",
|
|
11
|
+
"@dereekb/rxjs": "13.11.15",
|
|
12
|
+
"@dereekb/util": "13.11.15",
|
|
13
|
+
"@dereekb/zoho": "13.11.15",
|
|
14
14
|
"@nestjs/common": "^11.1.19",
|
|
15
15
|
"@nestjs/config": "^4.0.4",
|
|
16
16
|
"express": "^5.2.1",
|
|
@@ -21,51 +21,72 @@ export declare class OidcInteractionController {
|
|
|
21
21
|
private readonly oidcService;
|
|
22
22
|
constructor(oidcInteractionService: OidcInteractionService, oidcProviderConfigService: OidcProviderConfigService, accountService: OidcAccountService, oidcService: OidcService);
|
|
23
23
|
/**
|
|
24
|
-
* GET /interaction/:uid
|
|
24
|
+
* GET /interaction/:uid.
|
|
25
25
|
*
|
|
26
26
|
* Detects the interaction type and redirects to the appropriate frontend page.
|
|
27
27
|
*
|
|
28
|
-
* @param uid -
|
|
29
|
-
* @param req -
|
|
30
|
-
* @param res -
|
|
31
|
-
* @returns
|
|
32
|
-
* @throws {HttpException} 404 when the interaction UID is not found or has expired.
|
|
28
|
+
* @param uid - The interaction UID from the URL path.
|
|
29
|
+
* @param req - The incoming Express request.
|
|
30
|
+
* @param res - The Express response used for redirecting.
|
|
31
|
+
* @returns A redirect response to the appropriate frontend page.
|
|
32
|
+
* @throws {HttpException} HTTP 404 when the interaction UID is not found or has expired.
|
|
33
33
|
*/
|
|
34
34
|
getInteraction(uid: OidcInteractionUid, req: Request, res: Response): Promise<void>;
|
|
35
35
|
/**
|
|
36
|
-
* POST /interaction/:uid/login
|
|
36
|
+
* POST /interaction/:uid/login.
|
|
37
37
|
*
|
|
38
38
|
* Verifies the Firebase Auth ID token sent by the frontend, extracts the
|
|
39
39
|
* user's UID, and completes the oidc-provider login interaction.
|
|
40
40
|
*
|
|
41
|
-
* @param uid -
|
|
42
|
-
* @param body -
|
|
43
|
-
* @param res -
|
|
44
|
-
* @throws {HttpException} 401 when the Firebase ID token is invalid.
|
|
45
|
-
* @throws {HttpException} 400 when the login interaction cannot be completed.
|
|
41
|
+
* @param uid - The interaction UID from the URL path.
|
|
42
|
+
* @param body - The login request containing the Firebase ID token.
|
|
43
|
+
* @param res - The Express response used for sending JSON.
|
|
44
|
+
* @throws {HttpException} HTTP 401 when the Firebase ID token is invalid.
|
|
45
|
+
* @throws {HttpException} HTTP 400 when the login interaction cannot be completed.
|
|
46
46
|
*/
|
|
47
47
|
postLogin(uid: OidcInteractionUid, body: OAuthInteractionLoginRequest, res: Response): Promise<void>;
|
|
48
48
|
/**
|
|
49
|
-
* POST /interaction/:uid/consent
|
|
49
|
+
* POST /interaction/:uid/consent.
|
|
50
50
|
*
|
|
51
51
|
* Receives consent decision from frontend. Grants missing OIDC scopes and claims
|
|
52
52
|
* when approved, or returns `access_denied` when rejected.
|
|
53
53
|
*
|
|
54
|
-
* @param uid -
|
|
55
|
-
* @param body -
|
|
56
|
-
* @param res -
|
|
57
|
-
* @throws {HttpException} 400 when the consent interaction cannot be completed.
|
|
54
|
+
* @param uid - The interaction UID from the URL path.
|
|
55
|
+
* @param body - The consent request containing approval decision and Firebase ID token.
|
|
56
|
+
* @param res - The Express response used for sending JSON.
|
|
57
|
+
* @throws {HttpException} HTTP 400 when the consent interaction cannot be completed.
|
|
58
58
|
*/
|
|
59
59
|
postConsent(uid: OidcInteractionUid, body: OAuthInteractionConsentRequest, res: Response): Promise<void>;
|
|
60
60
|
/**
|
|
61
61
|
* Verifies a Firebase Auth ID token and returns the user's UID.
|
|
62
62
|
*
|
|
63
|
-
* @param idToken -
|
|
64
|
-
* @returns
|
|
65
|
-
* @throws {HttpException} 401 when the token is invalid or expired.
|
|
63
|
+
* @param idToken - The Firebase Auth ID token to verify.
|
|
64
|
+
* @returns The user's UID extracted from the decoded token.
|
|
65
|
+
* @throws {HttpException} HTTP 401 when the token is invalid or expired.
|
|
66
66
|
*/
|
|
67
67
|
private _verifyIdToken;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Inputs for {@link resolveEffectiveSubset}.
|
|
71
|
+
*/
|
|
72
|
+
export interface ResolveEffectiveSubsetInput {
|
|
73
|
+
/**
|
|
74
|
+
* Entries the OIDC prompt indicated were missing for this consent.
|
|
75
|
+
*/
|
|
76
|
+
readonly missing: readonly string[];
|
|
77
|
+
/**
|
|
78
|
+
* Optional subset the caller wants to grant; each value must be in `missing` or `alreadyEncountered`.
|
|
79
|
+
*/
|
|
80
|
+
readonly requestedSubset: readonly string[] | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Entries that must be granted whenever they appear in `missing`, regardless of `requestedSubset`.
|
|
83
|
+
*/
|
|
84
|
+
readonly alwaysGranted?: readonly string[];
|
|
85
|
+
/**
|
|
86
|
+
* Entries the existing Grant has previously granted or rejected. Tolerated as no-ops on re-consent.
|
|
87
|
+
*/
|
|
88
|
+
readonly alreadyEncountered?: readonly string[];
|
|
89
|
+
}
|
|
69
90
|
/**
|
|
70
91
|
* Resolves the effective set to grant — and the complementary set to
|
|
71
92
|
* reject — from a missing set, an optional caller-provided subset, an
|
|
@@ -82,13 +103,11 @@ export declare class OidcInteractionController {
|
|
|
82
103
|
* are not re-applied to the grant (no-op).
|
|
83
104
|
* - Always-granted entries are union'd into `granted` (clamped to `missing`).
|
|
84
105
|
*
|
|
85
|
-
* @param
|
|
86
|
-
* @param requestedSubset - Optional subset the caller wants to grant; each value must be in `missing` or `alreadyEncountered`.
|
|
87
|
-
* @param alwaysGranted - Entries that must be granted whenever they appear in `missing`, regardless of `requestedSubset`.
|
|
88
|
-
* @param alreadyEncountered - Entries the existing Grant has previously granted or rejected. Tolerated as no-ops on re-consent.
|
|
106
|
+
* @param input - Missing entries plus optional subset, always-granted, and already-encountered lists.
|
|
89
107
|
* @returns `granted` to add to the grant and `rejected` to record on the grant.
|
|
108
|
+
* @throws {HttpException} `400 BAD_REQUEST` when `requestedSubset` includes a value that is neither missing nor already-encountered.
|
|
90
109
|
*/
|
|
91
|
-
export declare function resolveEffectiveSubset(
|
|
110
|
+
export declare function resolveEffectiveSubset(input: ResolveEffectiveSubsetInput): {
|
|
92
111
|
granted: string[];
|
|
93
112
|
rejected: string[];
|
|
94
113
|
};
|
|
@@ -17,7 +17,7 @@ export declare class OidcProviderController {
|
|
|
17
17
|
private _callback;
|
|
18
18
|
constructor(oidcService: OidcService, oidcProviderConfigService: OidcProviderConfigService);
|
|
19
19
|
/**
|
|
20
|
-
* GET /oidc/login/client
|
|
20
|
+
* GET /oidc/login/client.
|
|
21
21
|
*
|
|
22
22
|
* Convenience redirect from the API issuer path back to the frontend app's
|
|
23
23
|
* OAuth login page. Lets a user who lands on the API host get bounced to the
|
|
@@ -15,7 +15,7 @@ export declare class OidcWellKnownController {
|
|
|
15
15
|
* Returns the provider metadata so clients can auto-discover endpoints,
|
|
16
16
|
* supported scopes, signing algorithms, etc.
|
|
17
17
|
*
|
|
18
|
-
* @returns
|
|
18
|
+
* @returns The OIDC discovery metadata document.
|
|
19
19
|
*/
|
|
20
20
|
getOpenIdConfiguration(): Promise<OidcDiscoveryMetadata>;
|
|
21
21
|
/**
|
|
@@ -23,7 +23,7 @@ export declare class OidcWellKnownController {
|
|
|
23
23
|
*
|
|
24
24
|
* This endpoint is typically skipped if the JwksServiceStorageConfig is provided.
|
|
25
25
|
*
|
|
26
|
-
* @returns
|
|
26
|
+
* @returns The public JWKS containing all non-retired signing keys.
|
|
27
27
|
*/
|
|
28
28
|
getJwks(): Promise<{
|
|
29
29
|
keys: import("..").JsonWebKeyWithKid[];
|
|
@@ -34,7 +34,7 @@ export declare class OidcWellKnownController {
|
|
|
34
34
|
* Returns the authorization server(s) that protect this resource,
|
|
35
35
|
* allowing clients to discover which authorization server to use.
|
|
36
36
|
*
|
|
37
|
-
* @returns
|
|
37
|
+
* @returns The protected resource metadata with authorization server URLs.
|
|
38
38
|
*/
|
|
39
39
|
getProtectedResource(): {
|
|
40
40
|
authorization_servers: string[];
|
|
@@ -19,7 +19,7 @@ import { type INestApplication } from '@nestjs/common';
|
|
|
19
19
|
* `/interaction/{uid}/*` POSTs carry the Firebase ID token in the JSON body, not in cookies, so
|
|
20
20
|
* we keep the CORS surface minimal.
|
|
21
21
|
*
|
|
22
|
-
* @param nestApp -
|
|
22
|
+
* @param nestApp - The NestJS application to configure.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts
|
|
@@ -86,15 +86,15 @@ export interface JwksKeyConverterConfig {
|
|
|
86
86
|
*
|
|
87
87
|
* Requires runtime encryption config since the private key field is encrypted at rest.
|
|
88
88
|
*
|
|
89
|
-
* @param config -
|
|
90
|
-
* @returns
|
|
89
|
+
* @param config - Encryption configuration for the private key field.
|
|
90
|
+
* @returns Snapshot converter functions for JwksKey documents.
|
|
91
91
|
*/
|
|
92
92
|
export declare function jwksKeyConverter(config: JwksKeyConverterConfig): import("@dereekb/firebase").SnapshotConverterFunctions<JwksKey, Partial<import("@dereekb/util").ReplaceType<JwksKey, import("@dereekb/util").MaybeMap<object>, any>>>;
|
|
93
93
|
/**
|
|
94
94
|
* Returns the Firestore {@link CollectionReference} for {@link JwksKey} documents.
|
|
95
95
|
*
|
|
96
|
-
* @param context -
|
|
97
|
-
* @returns
|
|
96
|
+
* @param context - The Firestore context to create the collection reference from.
|
|
97
|
+
* @returns The typed collection reference for JwksKey documents.
|
|
98
98
|
*/
|
|
99
99
|
export declare function jwksKeyCollectionReference(context: FirestoreContext): CollectionReference<JwksKey>;
|
|
100
100
|
/**
|
|
@@ -110,7 +110,7 @@ export interface JwksKeyFirestoreCollectionConfig extends JwksKeyConverterConfig
|
|
|
110
110
|
/**
|
|
111
111
|
* Creates a {@link JwksKeyFirestoreCollection} with encrypted private key field support.
|
|
112
112
|
*
|
|
113
|
-
* @param config -
|
|
114
|
-
* @returns
|
|
113
|
+
* @param config - Configuration including the Firestore context and encryption settings.
|
|
114
|
+
* @returns The configured JwksKey Firestore collection.
|
|
115
115
|
*/
|
|
116
116
|
export declare function jwksKeyFirestoreCollection(config: JwksKeyFirestoreCollectionConfig): JwksKeyFirestoreCollection;
|
|
@@ -3,25 +3,25 @@ import { type JwksKeyStatus } from './jwks';
|
|
|
3
3
|
/**
|
|
4
4
|
* Query for JwksKey documents with a specific status.
|
|
5
5
|
*
|
|
6
|
-
* @param status -
|
|
7
|
-
* @returns Firestore query constraints filtering by the given status
|
|
6
|
+
* @param status - The lifecycle status to filter by.
|
|
7
|
+
* @returns Firestore query constraints filtering by the given status.
|
|
8
8
|
*/
|
|
9
9
|
export declare function jwksKeysWithStatusQuery(status: JwksKeyStatus): FirestoreQueryConstraint[];
|
|
10
10
|
/**
|
|
11
11
|
* Query for active JwksKey documents.
|
|
12
12
|
*
|
|
13
|
-
* @returns Firestore query constraints filtering for active keys
|
|
13
|
+
* @returns Firestore query constraints filtering for active keys.
|
|
14
14
|
*/
|
|
15
15
|
export declare function activeJwksKeysQuery(): FirestoreQueryConstraint[];
|
|
16
16
|
/**
|
|
17
17
|
* Query for non-retired JwksKey documents (active + rotated).
|
|
18
18
|
*
|
|
19
|
-
* @returns Firestore query constraints filtering for non-retired keys
|
|
19
|
+
* @returns Firestore query constraints filtering for non-retired keys.
|
|
20
20
|
*/
|
|
21
21
|
export declare function nonRetiredJwksKeysQuery(): FirestoreQueryConstraint[];
|
|
22
22
|
/**
|
|
23
23
|
* Query for rotated JwksKey documents.
|
|
24
24
|
*
|
|
25
|
-
* @returns Firestore query constraints filtering for rotated keys
|
|
25
|
+
* @returns Firestore query constraints filtering for rotated keys.
|
|
26
26
|
*/
|
|
27
27
|
export declare function rotatedJwksKeysQuery(): FirestoreQueryConstraint[];
|
|
@@ -30,8 +30,8 @@ export declare abstract class OidcModelServerActions {
|
|
|
30
30
|
/**
|
|
31
31
|
* Creates a concrete {@link OidcModelServerActions} implementation wired to the provided context.
|
|
32
32
|
*
|
|
33
|
-
* @param context -
|
|
34
|
-
* @returns
|
|
33
|
+
* @param context - The fully assembled OIDC model server actions context.
|
|
34
|
+
* @returns The concrete OidcModelServerActions instance.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```ts
|
|
@@ -47,8 +47,8 @@ export declare function oidcModelServerActions(context: OidcModelServerActionsCo
|
|
|
47
47
|
* Delegates to {@link OidcClientService.createClient} to generate a `client_id` and `client_secret`,
|
|
48
48
|
* create the adapter entry, and return the secret in plaintext (only returned once).
|
|
49
49
|
*
|
|
50
|
-
* @param context -
|
|
51
|
-
* @returns
|
|
50
|
+
* @param context - The OIDC model server actions context.
|
|
51
|
+
* @returns A transform function factory for creating OIDC clients.
|
|
52
52
|
*/
|
|
53
53
|
export declare function createOidcClientFactory(context: OidcModelServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<CreateOidcClientParams, () => Promise<CreateOidcClientResult>, object, unknown>;
|
|
54
54
|
/**
|
|
@@ -56,8 +56,8 @@ export declare function createOidcClientFactory(context: OidcModelServerActionsC
|
|
|
56
56
|
*
|
|
57
57
|
* Delegates to {@link OidcClientService.updateClient} to apply plaintext field updates.
|
|
58
58
|
*
|
|
59
|
-
* @param context -
|
|
60
|
-
* @returns
|
|
59
|
+
* @param context - The OIDC model server actions context.
|
|
60
|
+
* @returns A transform function factory for updating OIDC clients.
|
|
61
61
|
*/
|
|
62
62
|
export declare function updateOidcClientFactory(context: OidcModelServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<UpdateOidcClientParams, (document: OidcEntryDocument) => Promise<OidcEntryDocument>, object, unknown>;
|
|
63
63
|
/**
|
|
@@ -66,8 +66,8 @@ export declare function updateOidcClientFactory(context: OidcModelServerActionsC
|
|
|
66
66
|
* Delegates to {@link OidcClientService.rotateClientSecret} to generate a new secret
|
|
67
67
|
* and return it in plaintext (only returned once).
|
|
68
68
|
*
|
|
69
|
-
* @param context -
|
|
70
|
-
* @returns
|
|
69
|
+
* @param context - The OIDC model server actions context.
|
|
70
|
+
* @returns A transform function factory for rotating OIDC client secrets.
|
|
71
71
|
*/
|
|
72
72
|
export declare function rotateOidcClientSecretFactory(context: OidcModelServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<import("@dereekb/firebase").TargetModelParams, (document: OidcEntryDocument) => Promise<RotateOidcClientSecretResult>, object, unknown>;
|
|
73
73
|
/**
|
|
@@ -75,8 +75,8 @@ export declare function rotateOidcClientSecretFactory(context: OidcModelServerAc
|
|
|
75
75
|
*
|
|
76
76
|
* Delegates to {@link OidcClientService.deleteClient}.
|
|
77
77
|
*
|
|
78
|
-
* @param context -
|
|
79
|
-
* @returns
|
|
78
|
+
* @param context - The OIDC model server actions context.
|
|
79
|
+
* @returns A transform function factory for deleting OIDC clients.
|
|
80
80
|
*/
|
|
81
81
|
export declare function deleteOidcClientFactory(context: OidcModelServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<import("@dereekb/firebase").TargetModelParams, (document: OidcEntryDocument) => Promise<void>, object, unknown>;
|
|
82
82
|
/**
|
|
@@ -90,7 +90,7 @@ export declare function deleteOidcClientFactory(context: OidcModelServerActionsC
|
|
|
90
90
|
* Per-user authorization (this user owns this Grant) is enforced upstream via the
|
|
91
91
|
* model permission service before this action runs.
|
|
92
92
|
*
|
|
93
|
-
* @param context -
|
|
94
|
-
* @returns
|
|
93
|
+
* @param context - The OIDC model server actions context.
|
|
94
|
+
* @returns A transform function factory for revoking OIDC grants.
|
|
95
95
|
*/
|
|
96
96
|
export declare function deleteOidcTokenFactory(context: OidcModelServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<import("@dereekb/firebase").TargetModelParams, (document: OidcEntryDocument) => Promise<void>, object, unknown>;
|
|
@@ -5,9 +5,9 @@ import { OidcService } from '../../service/oidc.service';
|
|
|
5
5
|
/**
|
|
6
6
|
* Factory that creates an {@link OidcModelServerActions} instance from the injected services.
|
|
7
7
|
*
|
|
8
|
-
* @param oidcClientService -
|
|
9
|
-
* @param oidcService -
|
|
10
|
-
* @returns
|
|
8
|
+
* @param oidcClientService - The OIDC client service for client CRUD actions.
|
|
9
|
+
* @param oidcService - The core OIDC service for grant revocation.
|
|
10
|
+
* @returns The configured OidcModelServerActions instance.
|
|
11
11
|
*/
|
|
12
12
|
export declare function oidcModelServerActionsFactory(oidcClientService: OidcClientService, oidcService: OidcService): OidcModelServerActions;
|
|
13
13
|
export interface ProvideAppOidcModelMetadataConfig {
|
|
@@ -24,7 +24,7 @@ export interface ProvideAppOidcModelMetadataConfig {
|
|
|
24
24
|
* By default this module exports:
|
|
25
25
|
* - OidcModelServerActions
|
|
26
26
|
*
|
|
27
|
-
* @param config -
|
|
28
|
-
* @returns
|
|
27
|
+
* @param config - The configuration specifying the OIDC module dependency.
|
|
28
|
+
* @returns The NestJS module metadata for the OidcModel module.
|
|
29
29
|
*/
|
|
30
30
|
export declare function appOidcModelModuleMetadata(config: ProvideAppOidcModelMetadataConfig): ModuleMetadata;
|
|
@@ -245,7 +245,7 @@ export declare abstract class OidcModuleConfig {
|
|
|
245
245
|
*
|
|
246
246
|
* Called by {@link oidcModuleConfigFactory} after building the config from environment variables.
|
|
247
247
|
*
|
|
248
|
-
* @param config -
|
|
248
|
+
* @param config - The config object to validate.
|
|
249
249
|
* @throws {Error} When any required field (`issuer`, `appInteractionPath`, `appLoginUrlPart`, `appConsentUrlPart`, `jwksServiceConfig`, `jwksKeyConverterConfig`) is missing.
|
|
250
250
|
*/
|
|
251
251
|
static assertValidConfig(config: Partial<OidcModuleConfig>): void;
|
|
@@ -68,9 +68,9 @@ export declare const FIREBASE_SERVER_OIDC_ROUTES_FOR_GLOBAL_ROUTE_EXCLUDE: strin
|
|
|
68
68
|
* The issuer can also be overridden directly by passing `issuer` on the `config` block to
|
|
69
69
|
* {@link oidcModuleMetadata}; the override wins over the factory-derived value.
|
|
70
70
|
*
|
|
71
|
-
* @param configService -
|
|
72
|
-
* @param envService -
|
|
73
|
-
* @returns
|
|
71
|
+
* @param configService - The NestJS ConfigService for reading environment variables.
|
|
72
|
+
* @param envService - The Firebase server environment service for app URL and env detection.
|
|
73
|
+
* @returns The constructed OidcModuleConfig.
|
|
74
74
|
* @throws {Error} When `appUrl` is missing, the resolved issuer lacks an HTTP prefix, or the encryption secret is invalid.
|
|
75
75
|
*/
|
|
76
76
|
export declare function oidcModuleConfigFactory(configService: ConfigService, envService: FirebaseServerEnvService): OidcModuleConfig;
|
|
@@ -78,9 +78,9 @@ export declare function oidcModuleConfigFactory(configService: ConfigService, en
|
|
|
78
78
|
* Factory that creates {@link OidcServerFirestoreCollections} using the provided Firestore context
|
|
79
79
|
* and JWKS encryption config from {@link OidcModuleConfig}.
|
|
80
80
|
*
|
|
81
|
-
* @param firestoreContext -
|
|
82
|
-
* @param oidcModuleConfig -
|
|
83
|
-
* @returns
|
|
81
|
+
* @param firestoreContext - The Firestore context for collection creation.
|
|
82
|
+
* @param oidcModuleConfig - The OIDC module config containing JWKS encryption settings.
|
|
83
|
+
* @returns The configured OidcServerFirestoreCollections.
|
|
84
84
|
*/
|
|
85
85
|
export declare function oidcFirestoreCollectionsFactory(firestoreContext: FirestoreContext, oidcModuleConfig: OidcModuleConfig): OidcServerFirestoreCollections;
|
|
86
86
|
export interface ProvideAppOidcModuleMetadataConfig extends Pick<ModuleMetadata, 'imports' | 'exports' | 'providers'> {
|
|
@@ -109,7 +109,7 @@ export interface ProvideAppOidcModuleMetadataConfig extends Pick<ModuleMetadata,
|
|
|
109
109
|
* Additionally, the following may be optionally provided:
|
|
110
110
|
* - JwksServiceStorageConfig
|
|
111
111
|
*
|
|
112
|
-
* @param metadataConfig -
|
|
113
|
-
* @returns
|
|
112
|
+
* @param metadataConfig - The configuration for generating the OIDC module metadata.
|
|
113
|
+
* @returns The NestJS module metadata for the OIDC module.
|
|
114
114
|
*/
|
|
115
115
|
export declare function oidcModuleMetadata(metadataConfig: ProvideAppOidcModuleMetadataConfig): ModuleMetadata;
|
|
@@ -79,7 +79,7 @@ export declare class OidcAccountServiceUserContext<S extends OidcScope = OidcSco
|
|
|
79
79
|
* Returns an {@link OidcAccount} compatible with oidc-provider's `findAccount` interface,
|
|
80
80
|
* or `undefined` if the user does not exist in Firebase Auth.
|
|
81
81
|
*
|
|
82
|
-
* @returns
|
|
82
|
+
* @returns The OIDC account for this user, or undefined if the user does not exist.
|
|
83
83
|
*/
|
|
84
84
|
findAccount(): Promise<OidcAccount | undefined>;
|
|
85
85
|
}
|
|
@@ -98,14 +98,14 @@ export declare class OidcAccountService<S extends OidcScope = OidcScope, U exten
|
|
|
98
98
|
/**
|
|
99
99
|
* The provider config from the delegate.
|
|
100
100
|
*
|
|
101
|
-
* @returns
|
|
101
|
+
* @returns The OIDC provider configuration from the delegate.
|
|
102
102
|
*/
|
|
103
103
|
get providerConfig(): OidcProviderConfig<S>;
|
|
104
104
|
/**
|
|
105
105
|
* Creates a user context for the given user ID.
|
|
106
106
|
*
|
|
107
|
-
* @param uid -
|
|
108
|
-
* @returns
|
|
107
|
+
* @param uid - The Firebase Auth user ID.
|
|
108
|
+
* @returns A new user context bound to the given user.
|
|
109
109
|
*/
|
|
110
110
|
userContext(uid: string): OidcAccountServiceUserContext<S, U>;
|
|
111
111
|
}
|
|
@@ -13,14 +13,14 @@ export type GrantableModelName = (typeof GRANTABLE_MODEL_NAMES)[number];
|
|
|
13
13
|
* Sensitive payload fields (`client_secret`, `registration_access_token`) are selectively
|
|
14
14
|
* encrypted via the {@link OidcEncryptionService}.
|
|
15
15
|
*
|
|
16
|
+
* @param collections - Firestore collection access for adapter entries.
|
|
17
|
+
* @param encryptionService - Encryption service for sensitive payload fields.
|
|
18
|
+
* @returns An oidc-provider adapter constructor backed by Firestore.
|
|
19
|
+
*
|
|
16
20
|
* @example
|
|
17
21
|
* ```ts
|
|
18
22
|
* const adapter = createAdapterFactory(collections, encryptionService);
|
|
19
23
|
* new Provider('issuer', { adapter });
|
|
20
24
|
* ```
|
|
21
|
-
*
|
|
22
|
-
* @param collections - Firestore collection access for adapter entries.
|
|
23
|
-
* @param encryptionService - Encryption service for sensitive payload fields.
|
|
24
|
-
* @returns an oidc-provider adapter constructor backed by Firestore
|
|
25
25
|
*/
|
|
26
26
|
export declare function createAdapterFactory(collections: OidcServerFirestoreCollections, encryptionService: OidcEncryptionService): AdapterConstructor;
|
|
@@ -33,7 +33,7 @@ export declare class OidcClientService {
|
|
|
33
33
|
*
|
|
34
34
|
* @param clientId - The client's document/adapter entry ID.
|
|
35
35
|
* @param params - The fields to update.
|
|
36
|
-
* @throws When the client is not found.
|
|
36
|
+
* @throws {Error} When the client is not found.
|
|
37
37
|
*/
|
|
38
38
|
updateClient(clientId: OidcEntryClientId, params: Omit<UpdateOidcClientParams, 'key'>): Promise<void>;
|
|
39
39
|
/**
|
|
@@ -44,14 +44,14 @@ export declare class OidcClientService {
|
|
|
44
44
|
*
|
|
45
45
|
* @param clientId - The client's document/adapter entry ID.
|
|
46
46
|
* @returns The client ID and new secret (plaintext, returned only once).
|
|
47
|
-
* @throws When the client is not found.
|
|
47
|
+
* @throws {Error} When the client is not found.
|
|
48
48
|
*/
|
|
49
49
|
rotateClientSecret(clientId: OidcEntryClientId): Promise<RotateOidcClientSecretResult>;
|
|
50
50
|
/**
|
|
51
51
|
* Deletes an OIDC client through the oidc-provider adapter.
|
|
52
52
|
*
|
|
53
53
|
* @param clientId - The client's document/adapter entry ID.
|
|
54
|
-
* @throws When the client is not found.
|
|
54
|
+
* @throws {Error} When the client is not found.
|
|
55
55
|
*/
|
|
56
56
|
deleteClient(clientId: OidcEntryClientId): Promise<void>;
|
|
57
57
|
}
|
|
@@ -95,7 +95,7 @@ export declare class OidcProviderConfigService {
|
|
|
95
95
|
*
|
|
96
96
|
* @param jwksUri - Optional override for the JWKS URI (e.g., from cloud storage).
|
|
97
97
|
* Falls back to `{issuer}{routes.jwks}`.
|
|
98
|
-
* @returns
|
|
98
|
+
* @returns The fully constructed OIDC discovery metadata.
|
|
99
99
|
*/
|
|
100
100
|
buildDiscoveryMetadata(jwksUri?: string): OidcDiscoveryMetadata;
|
|
101
101
|
}
|
|
@@ -45,15 +45,15 @@ export declare class OidcEncryptionService {
|
|
|
45
45
|
* Encrypts sensitive fields in an adapter payload and returns it as a {@link JsonSerializableObject}
|
|
46
46
|
* suitable for storing directly in Firestore.
|
|
47
47
|
*
|
|
48
|
-
* @param payload -
|
|
49
|
-
* @returns
|
|
48
|
+
* @param payload - The adapter payload to encrypt.
|
|
49
|
+
* @returns The encrypted payload as a JSON-serializable object.
|
|
50
50
|
*/
|
|
51
51
|
encryptAdapterPayload(payload: AdapterPayload): JsonSerializableObject;
|
|
52
52
|
/**
|
|
53
53
|
* Decrypts sensitive fields in a Firestore-stored payload object back to an {@link AdapterPayload}.
|
|
54
54
|
*
|
|
55
|
-
* @param payload -
|
|
56
|
-
* @returns
|
|
55
|
+
* @param payload - The encrypted Firestore-stored payload.
|
|
56
|
+
* @returns The decrypted adapter payload.
|
|
57
57
|
*/
|
|
58
58
|
decryptAdapterPayload(payload: JsonSerializableObject): AdapterPayload;
|
|
59
59
|
}
|
|
@@ -15,9 +15,9 @@ export declare class OidcInteractionService {
|
|
|
15
15
|
*
|
|
16
16
|
* Requires the oidc-provider interaction cookie to be present on the request.
|
|
17
17
|
*
|
|
18
|
-
* @param req -
|
|
19
|
-
* @param res -
|
|
20
|
-
* @returns
|
|
18
|
+
* @param req - The Express request containing the interaction cookie.
|
|
19
|
+
* @param res - The Express response.
|
|
20
|
+
* @returns The oidc-provider interaction details.
|
|
21
21
|
*/
|
|
22
22
|
getInteractionDetails(req: Request, res: Response): Promise<Interaction>;
|
|
23
23
|
/**
|
|
@@ -27,8 +27,8 @@ export declare class OidcInteractionService {
|
|
|
27
27
|
* This is necessary when the interaction cookie is scoped to a different path
|
|
28
28
|
* (e.g., the frontend) and is not sent with backend API requests.
|
|
29
29
|
*
|
|
30
|
-
* @param uid -
|
|
31
|
-
* @returns
|
|
30
|
+
* @param uid - The interaction UID to look up.
|
|
31
|
+
* @returns The interaction details for the given UID.
|
|
32
32
|
* @throws {Error} When the interaction is not found or has expired.
|
|
33
33
|
*/
|
|
34
34
|
findInteractionByUid(uid: OidcInteractionUid): Promise<Interaction>;
|
|
@@ -38,10 +38,10 @@ export declare class OidcInteractionService {
|
|
|
38
38
|
* Looks up the interaction directly by UID, applies the result, saves it,
|
|
39
39
|
* and returns the `returnTo` URL for the client to redirect to.
|
|
40
40
|
*
|
|
41
|
-
* @param uid -
|
|
42
|
-
* @param result -
|
|
43
|
-
* @param options -
|
|
44
|
-
* @param options.mergeWithLastSubmission -
|
|
41
|
+
* @param uid - The interaction UID to complete.
|
|
42
|
+
* @param result - The interaction results to apply.
|
|
43
|
+
* @param options - Optional settings for merging with the last submission.
|
|
44
|
+
* @param options.mergeWithLastSubmission - Whether to merge with the last submission (defaults to true)
|
|
45
45
|
* @returns The `returnTo` URL that the client should redirect to.
|
|
46
46
|
*/
|
|
47
47
|
finishInteractionByUid(uid: OidcInteractionUid, result: InteractionResults, options?: {
|
|
@@ -55,11 +55,11 @@ export declare class OidcInteractionService {
|
|
|
55
55
|
* `dbx_session_ttl` request param when save is driven from a NestJS controller — see
|
|
56
56
|
* {@link OidcService#resolveLoginDurationForGrant}).
|
|
57
57
|
*
|
|
58
|
-
* @param grantId -
|
|
59
|
-
* @param accountId -
|
|
60
|
-
* @param clientId -
|
|
61
|
-
* @param expiresInSeconds -
|
|
62
|
-
* @returns
|
|
58
|
+
* @param grantId - The existing grant ID to look up, or undefined to create a new grant.
|
|
59
|
+
* @param accountId - The account ID for creating a new grant.
|
|
60
|
+
* @param clientId - The client ID for creating a new grant.
|
|
61
|
+
* @param expiresInSeconds - Optional TTL (seconds) to assign to a newly-created grant.
|
|
62
|
+
* @returns The found or newly created grant.
|
|
63
63
|
*/
|
|
64
64
|
findOrCreateGrant(grantId: string | undefined, accountId: string, clientId: string, expiresInSeconds?: number): Promise<Grant>;
|
|
65
65
|
}
|
|
@@ -75,13 +75,13 @@ export declare class JwksService {
|
|
|
75
75
|
* Returns both the stored {@link JwksKey} and the unencrypted private JWK
|
|
76
76
|
* so callers can use the signing key immediately without a decryption round-trip.
|
|
77
77
|
*
|
|
78
|
-
* @returns
|
|
78
|
+
* @returns The generated key pair result containing the stored JwksKey and signing key.
|
|
79
79
|
*/
|
|
80
80
|
generateKeyPair(): Promise<GenerateKeyPairResult>;
|
|
81
81
|
/**
|
|
82
82
|
* Returns the currently active signing key's private JWK.
|
|
83
83
|
*
|
|
84
|
-
* @returns
|
|
84
|
+
* @returns The active signing key's private JWK, or undefined if no active key exists.
|
|
85
85
|
*/
|
|
86
86
|
getActiveSigningKey(): Promise<JsonWebKeyWithKid | undefined>;
|
|
87
87
|
/**
|
|
@@ -93,13 +93,13 @@ export declare class JwksService {
|
|
|
93
93
|
* Returns undefined if storage is not configured or `serveJwksFromStorage` is false.
|
|
94
94
|
* Returns null if an error occured while trying to setup.
|
|
95
95
|
*
|
|
96
|
-
* @returns
|
|
96
|
+
* @returns The public URL, or null/undefined if unavailable.
|
|
97
97
|
*/
|
|
98
98
|
getJwksStoragePublicUrl(): Promise<Maybe<WebsiteUrlWithPrefix>>;
|
|
99
99
|
/**
|
|
100
100
|
* Returns the public JWKS (all non-retired keys) by querying Firestore.
|
|
101
101
|
*
|
|
102
|
-
* @returns
|
|
102
|
+
* @returns The public JWKS containing all non-retired signing keys.
|
|
103
103
|
*/
|
|
104
104
|
getLatestPublicJwks(): Promise<{
|
|
105
105
|
keys: JsonWebKeyWithKid[];
|
|
@@ -107,7 +107,7 @@ export declare class JwksService {
|
|
|
107
107
|
/**
|
|
108
108
|
* Rotates keys: marks the current active key as rotated and generates a new active key.
|
|
109
109
|
*
|
|
110
|
-
* @returns
|
|
110
|
+
* @returns The newly generated active JwksKey.
|
|
111
111
|
*/
|
|
112
112
|
rotateKeys(): Promise<JwksKey>;
|
|
113
113
|
private _initializeKeysAndCloud;
|
|
@@ -115,7 +115,7 @@ export declare class JwksService {
|
|
|
115
115
|
/**
|
|
116
116
|
* Retires rotated keys whose expiresAt has passed.
|
|
117
117
|
*
|
|
118
|
-
* @returns
|
|
118
|
+
* @returns The number of keys retired.
|
|
119
119
|
*/
|
|
120
120
|
retireExpiredKeys(): Promise<number>;
|
|
121
121
|
}
|
|
@@ -24,7 +24,7 @@ export declare class OidcService {
|
|
|
24
24
|
/**
|
|
25
25
|
* Returns the oidc-provider instance, initializing it on first access.
|
|
26
26
|
*
|
|
27
|
-
* @returns
|
|
27
|
+
* @returns The lazily-initialized oidc-provider instance.
|
|
28
28
|
*/
|
|
29
29
|
getProvider(): Promise<Provider>;
|
|
30
30
|
/**
|
|
@@ -63,8 +63,8 @@ export declare class OidcService {
|
|
|
63
63
|
* referencing the grant is gone — `verifyAccessToken` returns `undefined`
|
|
64
64
|
* and a `grant_type=refresh_token` exchange fails with `invalid_grant`.
|
|
65
65
|
*
|
|
66
|
-
* @param grantId -
|
|
67
|
-
* @throws
|
|
66
|
+
* @param grantId - The grant id (and Grant adapter entry id) to revoke.
|
|
67
|
+
* @throws {Error} When the Grant entry does not exist.
|
|
68
68
|
*/
|
|
69
69
|
revokeGrant(grantId: string): Promise<void>;
|
|
70
70
|
/**
|
|
@@ -81,8 +81,8 @@ export declare class OidcService {
|
|
|
81
81
|
* Does NOT include `adapter`, `findAccount`, or `jwks` — those require async
|
|
82
82
|
* setup and are handled by {@link OidcService}.
|
|
83
83
|
*
|
|
84
|
-
* @param cookieKeys -
|
|
85
|
-
* @returns
|
|
84
|
+
* @param cookieKeys - The signing keys for oidc-provider session cookies.
|
|
85
|
+
* @returns The oidc-provider configuration options.
|
|
86
86
|
*/
|
|
87
87
|
buildProviderConfiguration(cookieKeys: string[]): Configuration;
|
|
88
88
|
private _buildProvider;
|