@dereekb/dbx-firebase 13.11.4 → 13.11.6
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/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-firebase",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.6",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "21.2.11",
|
|
6
6
|
"@angular/core": "21.2.11",
|
|
7
7
|
"@angular/material": "^21.2.9",
|
|
8
|
-
"@dereekb/date": "13.11.
|
|
9
|
-
"@dereekb/dbx-analytics": "13.11.
|
|
10
|
-
"@dereekb/dbx-core": "13.11.
|
|
11
|
-
"@dereekb/dbx-form": "13.11.
|
|
12
|
-
"@dereekb/dbx-web": "13.11.
|
|
13
|
-
"@dereekb/firebase": "13.11.
|
|
14
|
-
"@dereekb/model": "13.11.
|
|
15
|
-
"@dereekb/rxjs": "13.11.
|
|
16
|
-
"@dereekb/util": "13.11.
|
|
17
|
-
"@dereekb/vitest": "13.11.
|
|
8
|
+
"@dereekb/date": "13.11.6",
|
|
9
|
+
"@dereekb/dbx-analytics": "13.11.6",
|
|
10
|
+
"@dereekb/dbx-core": "13.11.6",
|
|
11
|
+
"@dereekb/dbx-form": "13.11.6",
|
|
12
|
+
"@dereekb/dbx-web": "13.11.6",
|
|
13
|
+
"@dereekb/firebase": "13.11.6",
|
|
14
|
+
"@dereekb/model": "13.11.6",
|
|
15
|
+
"@dereekb/rxjs": "13.11.6",
|
|
16
|
+
"@dereekb/util": "13.11.6",
|
|
17
|
+
"@dereekb/vitest": "13.11.6",
|
|
18
18
|
"@ng-forge/dynamic-forms": "0.9.0-next.6",
|
|
19
19
|
"@ngrx/component-store": "^21.1.0",
|
|
20
20
|
"@ngx-formly/core": "git+https://git@github.com/dereekb/ngx-formly#996d1041c8d2afbe429985a5ad394e59327bfa1d",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Signal, OnDestroy, Type, OnInit, EnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as _dereekb_util from '@dereekb/util';
|
|
4
4
|
import { Maybe, ErrorInput } from '@dereekb/util';
|
|
5
5
|
import * as _dereekb_dbx_core from '@dereekb/dbx-core';
|
|
6
6
|
import { DbxInjectionComponentConfig, SegueRefOrSegueRefRouterLink } from '@dereekb/dbx-core';
|
|
7
|
+
import { WorkUsingContext } from '@dereekb/rxjs';
|
|
7
8
|
import * as _dereekb_firebase from '@dereekb/firebase';
|
|
8
|
-
import { OAuthInteractionLoginDetails,
|
|
9
|
+
import { OidcScope, OAuthInteractionLoginDetails, OAuthInteractionConsentResponse, OidcInteractionUid, OidcTokenEndpointAuthMethod, OidcRedirectUri, OidcScopeDetails, CreateOidcClientParams, UpdateOidcClientFieldParams, OidcEntry, OidcEntryDocument, OidcModelFunctions, CreateOidcClientResult, RotateOidcClientSecretResult, FirestoreQueryConstraint, OidcModelFirestoreCollections, OAuthInteractionLoginResponse, OAuthInteractionConsentRequest } from '@dereekb/firebase';
|
|
10
|
+
import { FormConfig, ContainerField, RegisteredFieldTypes } from '@ng-forge/dynamic-forms';
|
|
11
|
+
import { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, DbxActionConfirmConfig, DbxValueAsListItem } from '@dereekb/dbx-web';
|
|
9
12
|
import * as _dereekb_dbx_form from '@dereekb/dbx-form';
|
|
10
13
|
import { AbstractConfigAsyncForgeFormDirective } from '@dereekb/dbx-form';
|
|
11
|
-
import * as _ng_forge_dynamic_forms_material from '@ng-forge/dynamic-forms-material';
|
|
12
|
-
import { ContainerField, FormConfig, RegisteredFieldTypes } from '@ng-forge/dynamic-forms';
|
|
13
14
|
import * as rxjs from 'rxjs';
|
|
14
15
|
import { Observable } from 'rxjs';
|
|
15
|
-
import
|
|
16
|
-
import { WorkUsingContext } from '@dereekb/rxjs';
|
|
16
|
+
import * as _ng_forge_dynamic_forms_material from '@ng-forge/dynamic-forms-material';
|
|
17
17
|
import * as _dereekb_dbx_firebase from '@dereekb/dbx-firebase';
|
|
18
18
|
import { AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseCollectionStore, DbxFirebaseCollectionStoreDirective, DbxFirebaseAuthService, DbxFirebaseDocumentStoreDirective } from '@dereekb/dbx-firebase';
|
|
19
19
|
|
|
@@ -50,25 +50,86 @@ declare class DbxFirebaseOAuthLoginViewComponent {
|
|
|
50
50
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthLoginViewComponent, "dbx-firebase-oauth-login-view", never, { "loginStateCase": { "alias": "loginStateCase"; "required": true; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; }, { "retryClick": "retryClick"; }, never, ["*"], true, never>;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
interface OAuthConsentScope<T extends OidcScope = OidcScope> {
|
|
54
|
+
readonly name: T;
|
|
55
|
+
readonly description: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Validator key emitted when the user has not selected any optional scope.
|
|
60
|
+
* Surfaces alongside the form's invalid state so the action button stays disabled.
|
|
61
|
+
*/
|
|
62
|
+
declare const OAUTH_CONSENT_SCOPES_REQUIRED_VALIDATOR_KIND = "mustSelectAtLeastOneScope";
|
|
63
|
+
/**
|
|
64
|
+
* Default message shown when the user has cleared every optional scope.
|
|
65
|
+
*/
|
|
66
|
+
declare const OAUTH_CONSENT_SCOPES_REQUIRED_VALIDATOR_DEFAULT_MESSAGE = "Select at least one scope to grant.";
|
|
67
|
+
/**
|
|
68
|
+
* Form value emitted by the consent scopes form.
|
|
69
|
+
*
|
|
70
|
+
* Uses the same key as the `OAuthInteractionConsentRequest.grantedOIDCScopes`
|
|
71
|
+
* payload field so the consent action handler can pass the form value through
|
|
72
|
+
* directly.
|
|
73
|
+
*/
|
|
74
|
+
interface OAuthConsentScopesFormValue {
|
|
75
|
+
readonly grantedOIDCScopes: OidcScope[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Configuration for the consent scopes form.
|
|
79
|
+
*
|
|
80
|
+
* Required scopes are filtered out by the caller before being passed in —
|
|
81
|
+
* required scopes are surfaced separately as a static "Always granted" line
|
|
82
|
+
* because they are not user-selectable.
|
|
83
|
+
*/
|
|
84
|
+
interface OAuthConsentScopesFormFieldsConfig {
|
|
85
|
+
/**
|
|
86
|
+
* Optional scopes the user can choose to grant.
|
|
87
|
+
*/
|
|
88
|
+
readonly optionalScopes: readonly OAuthConsentScope[];
|
|
89
|
+
/**
|
|
90
|
+
* Initial selection set. Defaults to every optional scope being selected.
|
|
91
|
+
*/
|
|
92
|
+
readonly initiallySelected?: readonly OidcScope[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Builds a complete `FormConfig` ready to feed into a forge form component.
|
|
96
|
+
*
|
|
97
|
+
* The resulting form has a single `grantedOIDCScopes` field — a
|
|
98
|
+
* `dbxForgeListSelectionField` rendered through
|
|
99
|
+
* `DbxFirebaseOAuthConsentScopeListComponent` (a `dbx-list` selection wrapper).
|
|
100
|
+
* The list renders bare (no Material form-field wrapper) and without the
|
|
101
|
+
* default 300px height cap so it grows to fit the scope list.
|
|
102
|
+
*
|
|
103
|
+
* @param config - The consent scopes form fields configuration.
|
|
104
|
+
* @returns A `FormConfig` whose single field selects an `OidcScope[]` of granted scopes.
|
|
105
|
+
*/
|
|
106
|
+
declare function oauthConsentScopesFormConfig(config: OAuthConsentScopesFormFieldsConfig): FormConfig;
|
|
107
|
+
|
|
53
108
|
/**
|
|
54
109
|
* State cases for the OIDC consent interaction flow.
|
|
55
110
|
*
|
|
56
|
-
* - `'unknown'` — Firebase auth state has not yet resolved. Render
|
|
57
|
-
*
|
|
58
|
-
* - `'
|
|
59
|
-
*
|
|
60
|
-
* - `'
|
|
111
|
+
* - `'unknown'` — Firebase auth state has not yet resolved. Render a spinner
|
|
112
|
+
* to avoid flashing between states.
|
|
113
|
+
* - `'no_user'` — Auth resolved and there is no signed-in user. Project the
|
|
114
|
+
* login UI via ng-content.
|
|
115
|
+
* - `'user'` — Auth resolved and a user is signed in. Render the consent
|
|
116
|
+
* form. Submission progress and errors are managed by the inner
|
|
117
|
+
* `dbxAction` contexts and surfaced via `dbxActionSnackbarError`.
|
|
61
118
|
*/
|
|
62
|
-
type OidcConsentStateCase = 'unknown' | 'no_user' | 'user'
|
|
119
|
+
type OidcConsentStateCase = 'unknown' | 'no_user' | 'user';
|
|
63
120
|
/**
|
|
64
121
|
* Presentational component for the OIDC OAuth consent screen.
|
|
65
122
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
123
|
+
* Wires up two `dbxAction` contexts — an outer one for Approve (which hosts
|
|
124
|
+
* the scope-selection forge form via `dbxActionForm`) and a nested one for
|
|
125
|
+
* Deny (which carries no value). Buttons are bound by Angular DI's
|
|
126
|
+
* nearest-ancestor lookup: the Approve button picks up the outer action, the
|
|
127
|
+
* Deny button (wrapped in its own `<ng-container dbxAction>`) picks up the
|
|
128
|
+
* inner.
|
|
69
129
|
*
|
|
70
|
-
* Supports ng-content projection —
|
|
71
|
-
* (so apps can project a login view, mirroring
|
|
130
|
+
* Supports ng-content projection — anything provided is rendered for the
|
|
131
|
+
* `'no_user'` state (so apps can project a login view, mirroring
|
|
132
|
+
* `DbxFirebaseOAuthLoginViewComponent`).
|
|
72
133
|
*
|
|
73
134
|
* @example
|
|
74
135
|
* ```html
|
|
@@ -76,49 +137,68 @@ type OidcConsentStateCase = 'unknown' | 'no_user' | 'user' | 'submitting' | 'err
|
|
|
76
137
|
* [details]="loginDetails"
|
|
77
138
|
* [consentStateCase]="'user'"
|
|
78
139
|
* [scopeInjectionConfig]="scopeConfig"
|
|
79
|
-
*
|
|
80
|
-
*
|
|
140
|
+
* [approveHandler]="handleApprove"
|
|
141
|
+
* [denyHandler]="handleDeny">
|
|
81
142
|
* </dbx-firebase-oauth-consent-view>
|
|
82
143
|
* ```
|
|
83
144
|
*/
|
|
84
145
|
declare class DbxFirebaseOAuthConsentViewComponent {
|
|
85
146
|
readonly details: i0.InputSignal<Maybe<OAuthInteractionLoginDetails<string>>>;
|
|
86
147
|
readonly consentStateCase: i0.InputSignal<OidcConsentStateCase>;
|
|
87
|
-
readonly error: i0.InputSignal<Maybe<string | ErrorInput>>;
|
|
88
148
|
readonly scopeInjectionConfig: i0.InputSignal<DbxInjectionComponentConfig<unknown>>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
readonly
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Scopes that cannot be deselected by the user. Forwarded to the scope
|
|
151
|
+
* view so it can render an "Always granted" hint. Defaults to `['openid']`.
|
|
152
|
+
*/
|
|
153
|
+
readonly requiredScopes: i0.InputSignal<readonly string[]>;
|
|
154
|
+
/**
|
|
155
|
+
* Approve handler — called with the form value when the Approve button
|
|
156
|
+
* triggers the outer action. Receives a `WorkUsingContext` to drive the
|
|
157
|
+
* action's loading/success/error pipeline.
|
|
158
|
+
*/
|
|
159
|
+
readonly approveHandler: i0.InputSignal<WorkUsingContext<OAuthConsentScopesFormValue, OAuthInteractionConsentResponse>>;
|
|
160
|
+
/**
|
|
161
|
+
* Deny handler — called when the Deny button triggers the inner action.
|
|
162
|
+
* No value is passed (`dbxActionValue` provides an empty payload).
|
|
163
|
+
*/
|
|
164
|
+
readonly denyHandler: i0.InputSignal<WorkUsingContext<void, OAuthInteractionConsentResponse>>;
|
|
165
|
+
readonly clientName: Signal<string>;
|
|
166
|
+
readonly clientUri: Signal<Maybe<string>>;
|
|
167
|
+
readonly logoUri: Signal<Maybe<string>>;
|
|
168
|
+
readonly scopes: Signal<OidcScope[]>;
|
|
169
|
+
readonly resolvedScopeInjectionConfig: Signal<DbxInjectionComponentConfig<unknown>>;
|
|
98
170
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentViewComponent, never>;
|
|
99
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentViewComponent, "dbx-firebase-oauth-consent-view", never, { "details": { "alias": "details"; "required": false; "isSignal": true; }; "consentStateCase": { "alias": "consentStateCase"; "required": true; "isSignal": true; }; "
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
interface OAuthConsentScope<T extends OidcScope = OidcScope> {
|
|
103
|
-
readonly name: T;
|
|
104
|
-
readonly description: string;
|
|
171
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentViewComponent, "dbx-firebase-oauth-consent-view", never, { "details": { "alias": "details"; "required": false; "isSignal": true; }; "consentStateCase": { "alias": "consentStateCase"; "required": true; "isSignal": true; }; "scopeInjectionConfig": { "alias": "scopeInjectionConfig"; "required": true; "isSignal": true; }; "requiredScopes": { "alias": "requiredScopes"; "required": false; "isSignal": true; }; "approveHandler": { "alias": "approveHandler"; "required": true; "isSignal": true; }; "denyHandler": { "alias": "denyHandler"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
105
172
|
}
|
|
106
173
|
|
|
107
174
|
/**
|
|
108
|
-
* Data provided to consent scope view components via the
|
|
175
|
+
* Data provided to consent scope view components via the
|
|
176
|
+
* `DBX_INJECTION_COMPONENT_DATA` token.
|
|
109
177
|
*
|
|
110
|
-
*
|
|
178
|
+
* Carries the requested scopes plus surrounding interaction context. The
|
|
179
|
+
* form value (current granted scopes) is no longer carried here — the
|
|
180
|
+
* scope view's form is wired up via `dbxActionForm` to the parent's
|
|
181
|
+
* `dbxAction`, so the value pipeline runs through the action store at
|
|
182
|
+
* trigger time.
|
|
111
183
|
*/
|
|
112
184
|
interface DbxFirebaseOAuthConsentScopesViewData {
|
|
113
185
|
readonly details?: Maybe<OAuthInteractionLoginDetails>;
|
|
114
186
|
readonly scopes: OidcScope[];
|
|
115
187
|
readonly clientName: string;
|
|
188
|
+
/**
|
|
189
|
+
* Scopes that must always be granted. Surfaced separately so the scope
|
|
190
|
+
* view can render them as a static "Always granted" hint instead of
|
|
191
|
+
* making them user-selectable.
|
|
192
|
+
*/
|
|
193
|
+
readonly requiredScopes?: readonly OidcScope[];
|
|
116
194
|
}
|
|
117
195
|
/**
|
|
118
196
|
* Abstract base class for consent scope view components.
|
|
119
197
|
*
|
|
120
|
-
* Provides typed access to the `DbxFirebaseOAuthConsentScopesViewData`
|
|
121
|
-
* via `DBX_INJECTION_COMPONENT_DATA`. Subclasses
|
|
198
|
+
* Provides typed access to the `DbxFirebaseOAuthConsentScopesViewData`
|
|
199
|
+
* injected via `DBX_INJECTION_COMPONENT_DATA`. Subclasses define the
|
|
200
|
+
* template that renders the requested scopes and (optionally) hosts a
|
|
201
|
+
* forge form decorated with `dbxActionForm`.
|
|
122
202
|
*
|
|
123
203
|
* @example
|
|
124
204
|
* ```typescript
|
|
@@ -133,32 +213,104 @@ declare abstract class AbstractDbxFirebaseOAuthConsentScopeViewComponent {
|
|
|
133
213
|
readonly clientName: i0.Signal<string>;
|
|
134
214
|
readonly clientUri: i0.Signal<Maybe<string>>;
|
|
135
215
|
readonly logoUri: i0.Signal<Maybe<string>>;
|
|
216
|
+
readonly requiredScopes: i0.Signal<readonly string[]>;
|
|
217
|
+
isScopeRequired(scope: OidcScope): boolean;
|
|
136
218
|
}
|
|
137
219
|
|
|
138
220
|
/**
|
|
139
|
-
*
|
|
221
|
+
* Selection-list wrapper used as the `listComponentClass` for the OIDC
|
|
222
|
+
* consent scope `dbxForgeListSelectionField`.
|
|
223
|
+
*
|
|
224
|
+
* Reuses the workspace's `dbx-list` selection infrastructure so the existing
|
|
225
|
+
* scope-row visual treatment (name + description) remains intact while the
|
|
226
|
+
* selection state participates in the surrounding `dbxAction`/`dbxActionForm`
|
|
227
|
+
* pipeline.
|
|
140
228
|
*
|
|
141
229
|
* @example
|
|
142
|
-
* ```
|
|
143
|
-
* <
|
|
230
|
+
* ```ts
|
|
231
|
+
* dbxForgeListSelectionField<OAuthConsentScope, DbxFirebaseOAuthConsentScopeListComponent, OidcScope>({
|
|
232
|
+
* key: 'grantedOIDCScopes',
|
|
233
|
+
* props: {
|
|
234
|
+
* listComponentClass: of(DbxFirebaseOAuthConsentScopeListComponent),
|
|
235
|
+
* readKey: (scope) => scope.name,
|
|
236
|
+
* state$: of(successResult(optionalScopes)),
|
|
237
|
+
* wrapped: false,
|
|
238
|
+
* maxHeight: 'none'
|
|
239
|
+
* }
|
|
240
|
+
* });
|
|
144
241
|
* ```
|
|
145
242
|
*/
|
|
146
|
-
declare class DbxFirebaseOAuthConsentScopeListComponent {
|
|
147
|
-
|
|
243
|
+
declare class DbxFirebaseOAuthConsentScopeListComponent extends AbstractDbxSelectionListWrapperDirective<OAuthConsentScope> {
|
|
244
|
+
constructor();
|
|
148
245
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentScopeListComponent, never>;
|
|
149
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeListComponent, "dbx-firebase-oauth-consent-scope-list", never, {
|
|
246
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeListComponent, "dbx-firebase-oauth-consent-scope-list", never, {}, {}, never, ["[top]", "[bottom]", "[empty]", "[emptyLoading]", "[end]"], true, never>;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Selection list view that pairs with `DbxFirebaseOAuthConsentScopeListComponent`.
|
|
250
|
+
* Maps each `OAuthConsentScope` to a `DbxValueListItem` keyed by the scope name
|
|
251
|
+
* and renders it through `DbxFirebaseOAuthConsentScopeListItemComponent`.
|
|
252
|
+
*/
|
|
253
|
+
declare class DbxFirebaseOAuthConsentScopeListViewComponent extends AbstractDbxSelectionListViewDirective<OAuthConsentScope> {
|
|
254
|
+
readonly config: DbxSelectionValueListViewConfig<OAuthConsentScope>;
|
|
255
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentScopeListViewComponent, never>;
|
|
256
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeListViewComponent, "dbx-firebase-oauth-consent-scope-list-view", never, {}, {}, never, never, true, never>;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Item row inside the OIDC consent scope selection list. Shown as the visual
|
|
260
|
+
* row for both selected and unselected scopes — the selection chrome (the
|
|
261
|
+
* leading checkbox/highlight) is provided by the wrapping
|
|
262
|
+
* `dbx-selection-list-view`.
|
|
263
|
+
*/
|
|
264
|
+
declare class DbxFirebaseOAuthConsentScopeListItemComponent extends AbstractDbxValueListViewItemComponent<OAuthConsentScope> {
|
|
265
|
+
get name(): string;
|
|
266
|
+
get description(): string;
|
|
267
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentScopeListItemComponent, never>;
|
|
268
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeListItemComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
150
269
|
}
|
|
151
270
|
|
|
152
271
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
272
|
+
* Reusable forge form component that renders one checkbox per OIDC scope
|
|
273
|
+
* defined in {@link OAuthConsentScopesFormFieldsConfig}. Required scopes are
|
|
274
|
+
* rendered as checked-and-disabled.
|
|
155
275
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
276
|
+
* Pair with `<dbx-firebase-oauth-consent-scope-default-view>` for the default
|
|
277
|
+
* consent flow, or embed directly in custom consent UIs that supply their
|
|
278
|
+
* own scope/required configuration.
|
|
158
279
|
*/
|
|
159
|
-
declare class
|
|
160
|
-
|
|
280
|
+
declare class DbxFirebaseOAuthConsentScopeFormComponent extends AbstractConfigAsyncForgeFormDirective<OAuthConsentScopesFormValue, OAuthConsentScopesFormFieldsConfig> {
|
|
281
|
+
readonly formConfig$: Observable<Maybe<FormConfig>>;
|
|
282
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentScopeFormComponent, never>;
|
|
283
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeFormComponent, "dbx-firebase-oauth-consent-scope-form", never, {}, {}, never, never, true, never>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Default consent scope view component.
|
|
288
|
+
*
|
|
289
|
+
* Reads the requested scopes (and required scopes) from the
|
|
290
|
+
* `DBX_INJECTION_COMPONENT_DATA` provided by the parent consent view,
|
|
291
|
+
* resolves human-readable descriptions from the app-level
|
|
292
|
+
* `DbxFirebaseOidcConfigService`, then renders a
|
|
293
|
+
* `DbxFirebaseOAuthConsentScopeFormComponent` with `dbxActionForm` so the
|
|
294
|
+
* form's value participates in the surrounding `dbxAction` (the consent
|
|
295
|
+
* view's outer Approve action).
|
|
296
|
+
*
|
|
297
|
+
* Required scopes are not user-selectable. They are surfaced as an "Always
|
|
298
|
+
* granted" hint above the form because the server enforces them regardless
|
|
299
|
+
* of payload — including them in the selection list would just add noise.
|
|
300
|
+
*
|
|
301
|
+
* Apps can override this default via
|
|
302
|
+
* `DbxFirebaseOidcConfig.consentScopeListViewClass` or
|
|
303
|
+
* `DbxOAuthConsentComponentConfig.consentScopeListViewClass`. Custom views
|
|
304
|
+
* should similarly apply `dbxActionForm` to a forge form whose value matches
|
|
305
|
+
* `OAuthConsentScopesFormValue`.
|
|
306
|
+
*/
|
|
307
|
+
declare class DbxFirebaseOAuthConsentScopeDefaultViewComponent {
|
|
308
|
+
private readonly _oidcConfigService;
|
|
309
|
+
private readonly _data;
|
|
161
310
|
readonly mappedScopes: i0.Signal<OAuthConsentScope<string>[]>;
|
|
311
|
+
readonly optionalScopes: i0.Signal<OAuthConsentScope<string>[]>;
|
|
312
|
+
readonly alwaysGrantedLabel: i0.Signal<string | null>;
|
|
313
|
+
readonly formFieldsConfig: i0.Signal<OAuthConsentScopesFormFieldsConfig>;
|
|
162
314
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentScopeDefaultViewComponent, never>;
|
|
163
315
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeDefaultViewComponent, "dbx-firebase-oauth-consent-scope-default-view", never, {}, {}, never, never, true, never>;
|
|
164
316
|
}
|
|
@@ -209,11 +361,13 @@ interface DbxOAuthConsentComponentConfig {
|
|
|
209
361
|
/**
|
|
210
362
|
* Container component for the OIDC OAuth consent screen.
|
|
211
363
|
*
|
|
212
|
-
* Manages all state: route param reading, Firebase Auth observation, consent submission,
|
|
213
|
-
* and error handling. Delegates visual rendering to `DbxFirebaseOAuthConsentViewComponent`.
|
|
214
|
-
*
|
|
215
364
|
* Reads interaction UID and client details from route params (populated by
|
|
216
|
-
* the server redirect),
|
|
365
|
+
* the server redirect), assembles them into `OAuthInteractionLoginDetails`,
|
|
366
|
+
* and exposes Approve / Deny handlers that drive the view's nested
|
|
367
|
+
* `dbxAction` contexts.
|
|
368
|
+
*
|
|
369
|
+
* Submission progress and error states are owned by the action stores; this
|
|
370
|
+
* container is just routing-glue + handler factories.
|
|
217
371
|
*
|
|
218
372
|
* Supports ng-content projection — any content provided is passed through to
|
|
219
373
|
* the view component for the `'no_user'` state (e.g. an app's login view).
|
|
@@ -240,14 +394,25 @@ declare class DbxOAuthConsentComponent implements OnDestroy {
|
|
|
240
394
|
readonly resolvedInteractionUid: Signal<Maybe<string>>;
|
|
241
395
|
readonly resolvedDetails: Signal<Maybe<OAuthInteractionLoginDetails<string>>>;
|
|
242
396
|
readonly scopeInjectionConfig: Signal<DbxInjectionComponentConfig<unknown>>;
|
|
243
|
-
|
|
244
|
-
|
|
397
|
+
/**
|
|
398
|
+
* Scopes the user cannot deselect. Forwarded to the view, which shows
|
|
399
|
+
* them as a static "Always granted" hint above the selection list.
|
|
400
|
+
*/
|
|
401
|
+
readonly requiredScopes: readonly OidcScope[];
|
|
245
402
|
readonly consentStateCase: Signal<OidcConsentStateCase>;
|
|
246
403
|
ngOnDestroy(): void;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
404
|
+
/**
|
|
405
|
+
* Handles the Approve action. Pulls the form's selected scope array
|
|
406
|
+
* straight off the form value (it already matches the API field name
|
|
407
|
+
* `grantedOIDCScopes`) and forwards it through `submitConsent`. On a
|
|
408
|
+
* successful response, hard-navigates to the OIDC server's redirect URL.
|
|
409
|
+
*/
|
|
410
|
+
readonly handleApprove: WorkUsingContext<OAuthConsentScopesFormValue, OAuthInteractionConsentResponse>;
|
|
411
|
+
/**
|
|
412
|
+
* Handles the Deny action. No payload is sent — the server returns
|
|
413
|
+
* `access_denied` to the OAuth client.
|
|
414
|
+
*/
|
|
415
|
+
readonly handleDeny: WorkUsingContext<void, OAuthInteractionConsentResponse>;
|
|
251
416
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxOAuthConsentComponent, never>;
|
|
252
417
|
static ɵcmp: i0.ɵɵComponentDeclaration<DbxOAuthConsentComponent, "dbx-firebase-oauth-consent", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
253
418
|
}
|
|
@@ -757,16 +922,22 @@ declare class DbxFirebaseOidcInteractionService {
|
|
|
757
922
|
/**
|
|
758
923
|
* Submit consent decision to complete the consent interaction.
|
|
759
924
|
*
|
|
760
|
-
* Automatically attaches the current user's Firebase ID token.
|
|
925
|
+
* Automatically attaches the current user's Firebase ID token. When `approved`
|
|
926
|
+
* is true, optional `grants` may be passed to grant only a subset of the
|
|
927
|
+
* requested scopes/claims/resource scopes; the server validates that any
|
|
928
|
+
* subset is contained in the corresponding `missing*` set on the prompt.
|
|
929
|
+
*
|
|
930
|
+
* When `approved` is false, `grants` is ignored (not sent).
|
|
761
931
|
*
|
|
762
932
|
* @param uid - The OIDC interaction UID identifying the current consent interaction.
|
|
763
933
|
* @param approved - Whether the user approved or denied the consent request.
|
|
934
|
+
* @param grants - Optional subset of OIDC scopes / OIDC claims / resource scopes to grant.
|
|
764
935
|
* @returns Observable that emits the redirect URL from the server response.
|
|
765
936
|
*/
|
|
766
|
-
submitConsent(uid: OidcInteractionUid, approved: boolean): Observable<OAuthInteractionConsentResponse>;
|
|
937
|
+
submitConsent(uid: OidcInteractionUid, approved: boolean, grants?: Pick<OAuthInteractionConsentRequest, 'grantedOIDCScopes' | 'grantedOIDCClaims' | 'grantedResourceScopes'>): Observable<OAuthInteractionConsentResponse>;
|
|
767
938
|
static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOidcInteractionService, never>;
|
|
768
939
|
static ɵprov: i0.ɵɵInjectableDeclaration<DbxFirebaseOidcInteractionService>;
|
|
769
940
|
}
|
|
770
941
|
|
|
771
|
-
export { AbstractDbxFirebaseOAuthConsentScopeViewComponent, DEFAULT_OIDC_AUTHORIZATION_ENDPOINT_PATH, DEFAULT_OIDC_CLIENT_ID_PARAM_KEY, DEFAULT_OIDC_CLIENT_NAME_PARAM_KEY, DEFAULT_OIDC_CLIENT_URI_PARAM_KEY, DEFAULT_OIDC_INTERACTION_ENDPOINT_PATH, DEFAULT_OIDC_INTERACTION_UID_PARAM_KEY, DEFAULT_OIDC_LOGO_URI_PARAM_KEY, DEFAULT_OIDC_SCOPES_PARAM_KEY, DEFAULT_OIDC_TOKEN_ENDPOINT_AUTH_METHODS, DbxFirebaseOAuthConsentScopeDefaultViewComponent, DbxFirebaseOAuthConsentScopeListComponent, DbxFirebaseOAuthConsentViewComponent, DbxFirebaseOAuthLoginComponent, DbxFirebaseOAuthLoginViewComponent, DbxFirebaseOidcConfig, DbxFirebaseOidcConfigService, DbxFirebaseOidcEntryClientCreateComponent, DbxFirebaseOidcEntryClientForgeFormComponent, DbxFirebaseOidcEntryClientListComponent, DbxFirebaseOidcEntryClientListViewComponent, DbxFirebaseOidcEntryClientListViewItemClientComponent, DbxFirebaseOidcEntryClientListViewItemComponent, DbxFirebaseOidcEntryClientListViewItemDefaultComponent, DbxFirebaseOidcEntryClientTestComponent, DbxFirebaseOidcEntryClientTestForgeFormComponent, DbxFirebaseOidcEntryClientUpdateComponent, DbxFirebaseOidcEntryClientViewComponent, DbxFirebaseOidcEntryGrantListComponent, DbxFirebaseOidcEntryGrantListContainerComponent, DbxFirebaseOidcEntryGrantListViewComponent, DbxFirebaseOidcEntryGrantListViewItemComponent, DbxFirebaseOidcInteractionService, DbxOAuthConsentComponent, OidcEntryCollectionStore, OidcEntryCollectionStoreDirective, OidcEntryDocumentStore, OidcEntryDocumentStoreDirective, oidcClientHomepageUriForgeField, oidcClientJwksUriForgeField, oidcClientLogoUriForgeField, oidcClientNameForgeField, oidcClientRedirectUrisForgeField, oidcClientTestClientIdForgeField, oidcClientTestRedirectUriForgeField, oidcClientTestScopesForgeField, oidcClientTokenEndpointAuthMethodForgeField, oidcEntryClientForgeFormFields, oidcEntryClientTestForgeFormFields, oidcEntryClientUpdateForgeFormFields, provideDbxFirebaseOidc, provideOidcModelFirestoreCollections };
|
|
772
|
-
export type { DbxFirebaseOAuthConsentScopesViewData, DbxFirebaseOidcEntryClientFormComponentConfig, DbxFirebaseOidcEntryClientTestFormComponentConfig, DbxFirebaseOidcModelClientFormValue, DbxFirebaseOidcModelClientTestFormValue, DbxFirebaseOidcModelClientUpdateFormValue, DbxOAuthConsentComponentConfig, OAuthConsentScope, OidcConsentStateCase, OidcEntryClientFormFieldsConfig, OidcEntryClientTestFormFieldsConfig, OidcEntryWithSelection, OidcLoginStateCase, ProvideDbxFirebaseOidcConfig };
|
|
942
|
+
export { AbstractDbxFirebaseOAuthConsentScopeViewComponent, DEFAULT_OIDC_AUTHORIZATION_ENDPOINT_PATH, DEFAULT_OIDC_CLIENT_ID_PARAM_KEY, DEFAULT_OIDC_CLIENT_NAME_PARAM_KEY, DEFAULT_OIDC_CLIENT_URI_PARAM_KEY, DEFAULT_OIDC_INTERACTION_ENDPOINT_PATH, DEFAULT_OIDC_INTERACTION_UID_PARAM_KEY, DEFAULT_OIDC_LOGO_URI_PARAM_KEY, DEFAULT_OIDC_SCOPES_PARAM_KEY, DEFAULT_OIDC_TOKEN_ENDPOINT_AUTH_METHODS, DbxFirebaseOAuthConsentScopeDefaultViewComponent, DbxFirebaseOAuthConsentScopeFormComponent, DbxFirebaseOAuthConsentScopeListComponent, DbxFirebaseOAuthConsentScopeListItemComponent, DbxFirebaseOAuthConsentScopeListViewComponent, DbxFirebaseOAuthConsentViewComponent, DbxFirebaseOAuthLoginComponent, DbxFirebaseOAuthLoginViewComponent, DbxFirebaseOidcConfig, DbxFirebaseOidcConfigService, DbxFirebaseOidcEntryClientCreateComponent, DbxFirebaseOidcEntryClientForgeFormComponent, DbxFirebaseOidcEntryClientListComponent, DbxFirebaseOidcEntryClientListViewComponent, DbxFirebaseOidcEntryClientListViewItemClientComponent, DbxFirebaseOidcEntryClientListViewItemComponent, DbxFirebaseOidcEntryClientListViewItemDefaultComponent, DbxFirebaseOidcEntryClientTestComponent, DbxFirebaseOidcEntryClientTestForgeFormComponent, DbxFirebaseOidcEntryClientUpdateComponent, DbxFirebaseOidcEntryClientViewComponent, DbxFirebaseOidcEntryGrantListComponent, DbxFirebaseOidcEntryGrantListContainerComponent, DbxFirebaseOidcEntryGrantListViewComponent, DbxFirebaseOidcEntryGrantListViewItemComponent, DbxFirebaseOidcInteractionService, DbxOAuthConsentComponent, OAUTH_CONSENT_SCOPES_REQUIRED_VALIDATOR_DEFAULT_MESSAGE, OAUTH_CONSENT_SCOPES_REQUIRED_VALIDATOR_KIND, OidcEntryCollectionStore, OidcEntryCollectionStoreDirective, OidcEntryDocumentStore, OidcEntryDocumentStoreDirective, oauthConsentScopesFormConfig, oidcClientHomepageUriForgeField, oidcClientJwksUriForgeField, oidcClientLogoUriForgeField, oidcClientNameForgeField, oidcClientRedirectUrisForgeField, oidcClientTestClientIdForgeField, oidcClientTestRedirectUriForgeField, oidcClientTestScopesForgeField, oidcClientTokenEndpointAuthMethodForgeField, oidcEntryClientForgeFormFields, oidcEntryClientTestForgeFormFields, oidcEntryClientUpdateForgeFormFields, provideDbxFirebaseOidc, provideOidcModelFirestoreCollections };
|
|
943
|
+
export type { DbxFirebaseOAuthConsentScopesViewData, DbxFirebaseOidcEntryClientFormComponentConfig, DbxFirebaseOidcEntryClientTestFormComponentConfig, DbxFirebaseOidcModelClientFormValue, DbxFirebaseOidcModelClientTestFormValue, DbxFirebaseOidcModelClientUpdateFormValue, DbxOAuthConsentComponentConfig, OAuthConsentScope, OAuthConsentScopesFormFieldsConfig, OAuthConsentScopesFormValue, OidcConsentStateCase, OidcEntryClientFormFieldsConfig, OidcEntryClientTestFormFieldsConfig, OidcEntryWithSelection, OidcLoginStateCase, ProvideDbxFirebaseOidcConfig };
|
|
@@ -18,7 +18,7 @@ import * as _dereekb_rxjs from '@dereekb/rxjs';
|
|
|
18
18
|
import { WorkUsingContext, WorkUsingObservable, ObservableOrValue, IsModifiedFunction, PageListLoadingState, ItemAccumulatorNextPageUntilResultsCountResult, SubscriptionObject, ObservableDecisionFunction, ListLoadingState, LoadingState, MaybeObservableOrValue, SwitchMapToDefaultFilterFunction, MaybeObservableOrValueGetter } from '@dereekb/rxjs';
|
|
19
19
|
import * as dist_packages_dbx_form_types_dereekb_dbx_form from 'dist/packages/dbx-form/types/dereekb-dbx-form';
|
|
20
20
|
import * as i1 from '@dereekb/dbx-web';
|
|
21
|
-
import {
|
|
21
|
+
import { DbxColorInput, DbxActionConfirmConfig, DbxWidgetEntry, DbxPopupService, DbxWidgetService, DbxWidgetType, TwoColumnsContextStore, AbstractPopupDirective, DbxPopupKey, AbstractDbxSelectionListWrapperDirective, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, DbxValueAsListItem, AbstractDbxValueListViewItemComponent, DbxModelTypesService, DbxModelTypeInfo, DbxModelTypesMap, DbxModelTrackerService, AnchorForValueFunction, AbstractPopoverDirective, DbxPopoverService, DbxPopoverKey, AbstractPopoverRefDirective, DbxPopoverConfigSizing, DbxButtonStyle, DownloadTextContent, DbxModelObjectStateService, DbxListViewWrapper, DbxWidgetViewComponentConfig, AbstractDbxWidgetComponent, DbxWebFilePreviewService, DbxActionDialogFunction, FileAcceptFilterTypeString, DbxFileUploadComponent, DbxActionModule, DbxLoadingComponent, DbxActionSnackbarErrorDirective, DbxActionLoadingContextDirective, DbxFileUploadActionSyncDirective } from '@dereekb/dbx-web';
|
|
22
22
|
import { FormConfig } from '@ng-forge/dynamic-forms';
|
|
23
23
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
24
24
|
import { NgPopoverRef } from 'ng-overlay-container';
|
|
@@ -611,9 +611,9 @@ interface DbxFirebaseLoginButtonConfig {
|
|
|
611
611
|
buttonColor?: string;
|
|
612
612
|
buttonTextColor?: string;
|
|
613
613
|
/**
|
|
614
|
-
* Material theme color to apply (e.g., 'warn', 'primary').
|
|
614
|
+
* Material theme color or {@link DbxColorConfig} to apply to the underlying button (e.g., 'warn', 'primary').
|
|
615
615
|
*/
|
|
616
|
-
color?:
|
|
616
|
+
color?: DbxColorInput;
|
|
617
617
|
/**
|
|
618
618
|
* Optional confirmation dialog config. When set, the action will prompt the user before executing.
|
|
619
619
|
*/
|
|
@@ -633,7 +633,7 @@ declare class DbxFirebaseLoginButtonComponent {
|
|
|
633
633
|
readonly textSignal: i0.Signal<string>;
|
|
634
634
|
readonly buttonColorSignal: i0.Signal<string | undefined>;
|
|
635
635
|
readonly buttonTextColorSignal: i0.Signal<string | undefined>;
|
|
636
|
-
readonly colorSignal: i0.Signal<
|
|
636
|
+
readonly colorSignal: i0.Signal<DbxColorInput | undefined>;
|
|
637
637
|
readonly confirmConfigSignal: i0.Signal<DbxActionConfirmConfig<unknown> | undefined>;
|
|
638
638
|
setConfig(config: Maybe<DbxFirebaseLoginButtonConfig>): void;
|
|
639
639
|
readonly handleAction: WorkUsingContext;
|