@dereekb/firebase-server 14.2.0 → 14.3.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/oidc/index.esm.js CHANGED
@@ -27,13 +27,13 @@ import { ConfigService, ConfigModule } from '@nestjs/config';
27
27
  return req.auth;
28
28
  });
29
29
 
30
- function _type_of$2(obj) {
30
+ function _type_of$3(obj) {
31
31
  "@swc/helpers - typeof";
32
32
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
33
33
  }
34
34
  function __decorate(decorators, target, key, desc) {
35
35
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36
- if ((typeof Reflect === "undefined" ? "undefined" : _type_of$2(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
36
+ if ((typeof Reflect === "undefined" ? "undefined" : _type_of$3(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
37
37
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
38
38
  return c > 3 && r && Object.defineProperty(target, key, r), r;
39
39
  }
@@ -1681,7 +1681,7 @@ function _is_native_reflect_construct$1() {
1681
1681
  })();
1682
1682
  }
1683
1683
  function _possible_constructor_return$1(self, call) {
1684
- if (call && (_type_of$1(call) === "object" || typeof call === "function")) return call;
1684
+ if (call && (_type_of$2(call) === "object" || typeof call === "function")) return call;
1685
1685
  return _assert_this_initialized$1(self);
1686
1686
  }
1687
1687
  function _set_prototype_of$1(o, p) {
@@ -1691,7 +1691,7 @@ function _set_prototype_of$1(o, p) {
1691
1691
  };
1692
1692
  return _set_prototype_of$1(o, p);
1693
1693
  }
1694
- function _type_of$1(obj) {
1694
+ function _type_of$2(obj) {
1695
1695
  "@swc/helpers - typeof";
1696
1696
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1697
1697
  }
@@ -3188,13 +3188,13 @@ var GRANTABLE_MODELS = new Set(GRANTABLE_MODEL_NAMES);
3188
3188
  return FirestoreAdapter;
3189
3189
  }
3190
3190
 
3191
- function _array_like_to_array$7(arr, len) {
3191
+ function _array_like_to_array$8(arr, len) {
3192
3192
  if (len == null || len > arr.length) len = arr.length;
3193
3193
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3194
3194
  return arr2;
3195
3195
  }
3196
- function _array_without_holes$7(arr) {
3197
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
3196
+ function _array_without_holes$8(arr) {
3197
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
3198
3198
  }
3199
3199
  function _class_call_check$a(instance, Constructor) {
3200
3200
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
@@ -3223,24 +3223,24 @@ function _define_property$a(obj, key, value) {
3223
3223
  } else obj[key] = value;
3224
3224
  return obj;
3225
3225
  }
3226
- function _iterable_to_array$7(iter) {
3226
+ function _iterable_to_array$8(iter) {
3227
3227
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
3228
3228
  return Array.from(iter);
3229
3229
  }
3230
3230
  }
3231
- function _non_iterable_spread$7() {
3231
+ function _non_iterable_spread$8() {
3232
3232
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3233
3233
  }
3234
- function _to_consumable_array$7(arr) {
3235
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$7();
3234
+ function _to_consumable_array$8(arr) {
3235
+ return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$8();
3236
3236
  }
3237
- function _unsupported_iterable_to_array$7(o, minLen) {
3237
+ function _unsupported_iterable_to_array$8(o, minLen) {
3238
3238
  if (!o) return;
3239
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
3239
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
3240
3240
  var n = Object.prototype.toString.call(o).slice(8, -1);
3241
3241
  if (n === "Object" && o.constructor) n = o.constructor.name;
3242
3242
  if (n === "Map" || n === "Set") return Array.from(n);
3243
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
3243
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
3244
3244
  }
3245
3245
  // MARK: Encrypted Fields
3246
3246
  /**
@@ -3268,7 +3268,7 @@ function _unsupported_iterable_to_array$7(o, minLen) {
3268
3268
  this.provider = createAesStringEncryptionProvider(config.jwksKeyConverterConfig.encryptionSecret);
3269
3269
  this.adapterPayloadEncryptor = selectiveFieldEncryptor({
3270
3270
  provider: this.provider,
3271
- fields: _to_consumable_array$7(OIDC_ENCRYPTED_PAYLOAD_FIELDS)
3271
+ fields: _to_consumable_array$8(OIDC_ENCRYPTED_PAYLOAD_FIELDS)
3272
3272
  });
3273
3273
  }
3274
3274
  _create_class$8(OidcEncryptionService, [
@@ -3304,13 +3304,13 @@ OidcEncryptionService = __decorate([
3304
3304
  __param(0, Inject(OidcModuleConfig))
3305
3305
  ], OidcEncryptionService);
3306
3306
 
3307
- function _array_like_to_array$6(arr, len) {
3307
+ function _array_like_to_array$7(arr, len) {
3308
3308
  if (len == null || len > arr.length) len = arr.length;
3309
3309
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3310
3310
  return arr2;
3311
3311
  }
3312
- function _array_without_holes$6(arr) {
3313
- if (Array.isArray(arr)) return _array_like_to_array$6(arr);
3312
+ function _array_without_holes$7(arr) {
3313
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
3314
3314
  }
3315
3315
  function _class_call_check$9(instance, Constructor) {
3316
3316
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
@@ -3339,24 +3339,24 @@ function _define_property$9(obj, key, value) {
3339
3339
  } else obj[key] = value;
3340
3340
  return obj;
3341
3341
  }
3342
- function _iterable_to_array$6(iter) {
3342
+ function _iterable_to_array$7(iter) {
3343
3343
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
3344
3344
  return Array.from(iter);
3345
3345
  }
3346
3346
  }
3347
- function _non_iterable_spread$6() {
3347
+ function _non_iterable_spread$7() {
3348
3348
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3349
3349
  }
3350
- function _to_consumable_array$6(arr) {
3351
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$6();
3350
+ function _to_consumable_array$7(arr) {
3351
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$7();
3352
3352
  }
3353
- function _unsupported_iterable_to_array$6(o, minLen) {
3353
+ function _unsupported_iterable_to_array$7(o, minLen) {
3354
3354
  if (!o) return;
3355
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
3355
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
3356
3356
  var n = Object.prototype.toString.call(o).slice(8, -1);
3357
3357
  if (n === "Object" && o.constructor) n = o.constructor.name;
3358
3358
  if (n === "Map" || n === "Set") return Array.from(n);
3359
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
3359
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
3360
3360
  }
3361
3361
  // MARK: Routes
3362
3362
  /**
@@ -3450,7 +3450,7 @@ var DEFAULT_OIDC_CODE_CHALLENGE_METHODS = [
3450
3450
  return !assignmentOnlyScopes.has(scope);
3451
3451
  });
3452
3452
  this.claimsSupported = Array.from(new Set(Object.values(this.providerConfig.claims).flat()));
3453
- this.tokenEndpointAuthMethodsSupported = (_this_config_tokenEndpointAuthMethods = this.config.tokenEndpointAuthMethods) !== null && _this_config_tokenEndpointAuthMethods !== void 0 ? _this_config_tokenEndpointAuthMethods : _to_consumable_array$6(DEFAULT_OIDC_TOKEN_ENDPOINT_AUTH_METHODS);
3453
+ this.tokenEndpointAuthMethodsSupported = (_this_config_tokenEndpointAuthMethods = this.config.tokenEndpointAuthMethods) !== null && _this_config_tokenEndpointAuthMethods !== void 0 ? _this_config_tokenEndpointAuthMethods : _to_consumable_array$7(DEFAULT_OIDC_TOKEN_ENDPOINT_AUTH_METHODS);
3454
3454
  var appUrl = envService.appUrl;
3455
3455
  this.appLoginUrl = websiteUrlFromPaths(appUrl, [
3456
3456
  this.config.appOAuthInteractionPath,
@@ -3483,16 +3483,16 @@ var DEFAULT_OIDC_CODE_CHALLENGE_METHODS = [
3483
3483
  jwks_uri: jwksUri !== null && jwksUri !== void 0 ? jwksUri : "".concat(issuer).concat(routes.jwks),
3484
3484
  registration_endpoint: this.oidcRegistrationRouteEnabled ? "".concat(issuer).concat(routes.registration) : undefined,
3485
3485
  scopes_supported: this.scopesSupported,
3486
- response_types_supported: _to_consumable_array$6(providerConfig.responseTypes),
3486
+ response_types_supported: _to_consumable_array$7(providerConfig.responseTypes),
3487
3487
  response_modes_supported: [
3488
3488
  'query'
3489
3489
  ],
3490
- grant_types_supported: _to_consumable_array$6(providerConfig.grantTypes),
3491
- subject_types_supported: _to_consumable_array$6(DEFAULT_OIDC_SUBJECT_TYPES),
3492
- id_token_signing_alg_values_supported: _to_consumable_array$6(DEFAULT_OIDC_ID_TOKEN_SIGNING_ALG_VALUES),
3493
- token_endpoint_auth_methods_supported: _to_consumable_array$6(this.tokenEndpointAuthMethodsSupported),
3490
+ grant_types_supported: _to_consumable_array$7(providerConfig.grantTypes),
3491
+ subject_types_supported: _to_consumable_array$7(DEFAULT_OIDC_SUBJECT_TYPES),
3492
+ id_token_signing_alg_values_supported: _to_consumable_array$7(DEFAULT_OIDC_ID_TOKEN_SIGNING_ALG_VALUES),
3493
+ token_endpoint_auth_methods_supported: _to_consumable_array$7(this.tokenEndpointAuthMethodsSupported),
3494
3494
  claims_supported: this.claimsSupported,
3495
- code_challenge_methods_supported: _to_consumable_array$6(DEFAULT_OIDC_CODE_CHALLENGE_METHODS)
3495
+ code_challenge_methods_supported: _to_consumable_array$7(DEFAULT_OIDC_CODE_CHALLENGE_METHODS)
3496
3496
  };
3497
3497
  }
3498
3498
  }
@@ -3506,32 +3506,32 @@ OidcProviderConfigService = __decorate([
3506
3506
  __param(2, Inject(FirebaseServerEnvService))
3507
3507
  ], OidcProviderConfigService);
3508
3508
 
3509
- function _array_like_to_array$5(arr, len) {
3509
+ function _array_like_to_array$6(arr, len) {
3510
3510
  if (len == null || len > arr.length) len = arr.length;
3511
3511
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3512
3512
  return arr2;
3513
3513
  }
3514
- function _array_without_holes$5(arr) {
3515
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
3514
+ function _array_without_holes$6(arr) {
3515
+ if (Array.isArray(arr)) return _array_like_to_array$6(arr);
3516
3516
  }
3517
- function _iterable_to_array$5(iter) {
3517
+ function _iterable_to_array$6(iter) {
3518
3518
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
3519
3519
  return Array.from(iter);
3520
3520
  }
3521
3521
  }
3522
- function _non_iterable_spread$5() {
3522
+ function _non_iterable_spread$6() {
3523
3523
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3524
3524
  }
3525
- function _to_consumable_array$5(arr) {
3526
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$5();
3525
+ function _to_consumable_array$6(arr) {
3526
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$6();
3527
3527
  }
3528
- function _unsupported_iterable_to_array$5(o, minLen) {
3528
+ function _unsupported_iterable_to_array$6(o, minLen) {
3529
3529
  if (!o) return;
3530
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
3530
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
3531
3531
  var n = Object.prototype.toString.call(o).slice(8, -1);
3532
3532
  if (n === "Object" && o.constructor) n = o.constructor.name;
3533
3533
  if (n === "Map" || n === "Set") return Array.from(n);
3534
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
3534
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
3535
3535
  }
3536
3536
  /**
3537
3537
  * Custom oidc-provider client metadata field holding the {@link OidcProviderProfile} keys assigned
@@ -3571,7 +3571,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3571
3571
  * @returns The union of config-level and profile-level admin-only scopes.
3572
3572
  */ function adminOnlyScopesForOidcProviderConfig(providerConfig) {
3573
3573
  var _providerConfig_adminOnlyScopes, _providerConfig_providerProfiles;
3574
- return new Set(_to_consumable_array$5((_providerConfig_adminOnlyScopes = providerConfig.adminOnlyScopes) !== null && _providerConfig_adminOnlyScopes !== void 0 ? _providerConfig_adminOnlyScopes : []).concat(_to_consumable_array$5(Array.from(adminOnlyScopesForOidcProviderProfiles((_providerConfig_providerProfiles = providerConfig.providerProfiles) !== null && _providerConfig_providerProfiles !== void 0 ? _providerConfig_providerProfiles : [])))));
3574
+ return new Set(_to_consumable_array$6((_providerConfig_adminOnlyScopes = providerConfig.adminOnlyScopes) !== null && _providerConfig_adminOnlyScopes !== void 0 ? _providerConfig_adminOnlyScopes : []).concat(_to_consumable_array$6(Array.from(adminOnlyScopesForOidcProviderProfiles((_providerConfig_providerProfiles = providerConfig.providerProfiles) !== null && _providerConfig_providerProfiles !== void 0 ? _providerConfig_providerProfiles : [])))));
3575
3575
  }
3576
3576
 
3577
3577
  /**
@@ -3614,13 +3614,13 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3614
3614
  return policy;
3615
3615
  }
3616
3616
 
3617
- function _array_like_to_array$4(arr, len) {
3617
+ function _array_like_to_array$5(arr, len) {
3618
3618
  if (len == null || len > arr.length) len = arr.length;
3619
3619
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3620
3620
  return arr2;
3621
3621
  }
3622
- function _array_without_holes$4(arr) {
3623
- if (Array.isArray(arr)) return _array_like_to_array$4(arr);
3622
+ function _array_without_holes$5(arr) {
3623
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
3624
3624
  }
3625
3625
  function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
3626
3626
  try {
@@ -3681,12 +3681,12 @@ function _instanceof$2(left, right) {
3681
3681
  return !!right[Symbol.hasInstance](left);
3682
3682
  } else return left instanceof right;
3683
3683
  }
3684
- function _iterable_to_array$4(iter) {
3684
+ function _iterable_to_array$5(iter) {
3685
3685
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
3686
3686
  return Array.from(iter);
3687
3687
  }
3688
3688
  }
3689
- function _non_iterable_spread$4() {
3689
+ function _non_iterable_spread$5() {
3690
3690
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3691
3691
  }
3692
3692
  function _object_spread$3(target) {
@@ -3758,8 +3758,8 @@ function _object_without_properties_loose(source, excluded) {
3758
3758
  }
3759
3759
  return target;
3760
3760
  }
3761
- function _to_consumable_array$4(arr) {
3762
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$4();
3761
+ function _to_consumable_array$5(arr) {
3762
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$5();
3763
3763
  }
3764
3764
  function _ts_generator$5(thisArg, body) {
3765
3765
  var f, y, t, _ = {
@@ -3860,13 +3860,13 @@ function _ts_generator$5(thisArg, body) {
3860
3860
  };
3861
3861
  }
3862
3862
  }
3863
- function _unsupported_iterable_to_array$4(o, minLen) {
3863
+ function _unsupported_iterable_to_array$5(o, minLen) {
3864
3864
  if (!o) return;
3865
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
3865
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
3866
3866
  var n = Object.prototype.toString.call(o).slice(8, -1);
3867
3867
  if (n === "Object" && o.constructor) n = o.constructor.name;
3868
3868
  if (n === "Map" || n === "Set") return Array.from(n);
3869
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
3869
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
3870
3870
  }
3871
3871
  var OidcService_1;
3872
3872
  // MARK: Service
@@ -4165,7 +4165,7 @@ var OidcService_1;
4165
4165
  return _object_spread_props(_object_spread$3({
4166
4166
  routes: _object_spread$3({}, this.providerConfigService.routes),
4167
4167
  claims: _object_spread$3({}, providerConfig.claims),
4168
- responseTypes: _to_consumable_array$4(providerConfig.responseTypes),
4168
+ responseTypes: _to_consumable_array$5(providerConfig.responseTypes),
4169
4169
  pkce: {
4170
4170
  required: function required() {
4171
4171
  return true;
@@ -5054,32 +5054,32 @@ OidcAuthBearerTokenMiddleware = __decorate([
5054
5054
  __param(1, Inject(OidcAuthMiddlewareConfig))
5055
5055
  ], OidcAuthBearerTokenMiddleware);
5056
5056
 
5057
- function _array_like_to_array$3(arr, len) {
5057
+ function _array_like_to_array$4(arr, len) {
5058
5058
  if (len == null || len > arr.length) len = arr.length;
5059
5059
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5060
5060
  return arr2;
5061
5061
  }
5062
- function _array_without_holes$3(arr) {
5063
- if (Array.isArray(arr)) return _array_like_to_array$3(arr);
5062
+ function _array_without_holes$4(arr) {
5063
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
5064
5064
  }
5065
- function _iterable_to_array$3(iter) {
5065
+ function _iterable_to_array$4(iter) {
5066
5066
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
5067
5067
  return Array.from(iter);
5068
5068
  }
5069
5069
  }
5070
- function _non_iterable_spread$3() {
5070
+ function _non_iterable_spread$4() {
5071
5071
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5072
5072
  }
5073
- function _to_consumable_array$3(arr) {
5074
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$3();
5073
+ function _to_consumable_array$4(arr) {
5074
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$4();
5075
5075
  }
5076
- function _unsupported_iterable_to_array$3(o, minLen) {
5076
+ function _unsupported_iterable_to_array$4(o, minLen) {
5077
5077
  if (!o) return;
5078
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
5078
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
5079
5079
  var n = Object.prototype.toString.call(o).slice(8, -1);
5080
5080
  if (n === "Object" && o.constructor) n = o.constructor.name;
5081
5081
  if (n === "Map" || n === "Set") return Array.from(n);
5082
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
5082
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
5083
5083
  }
5084
5084
  /**
5085
5085
  * Builds the `cors`-package origin delegate implementing the composed OIDC CORS policy.
@@ -5102,7 +5102,7 @@ function _unsupported_iterable_to_array$3(o, minLen) {
5102
5102
  var clientBased = cors.clientBased === true;
5103
5103
  var allowlist = new Set([
5104
5104
  appUrl
5105
- ].concat(_to_consumable_array$3((_cors_allowOrigins = cors.allowOrigins) !== null && _cors_allowOrigins !== void 0 ? _cors_allowOrigins : [])));
5105
+ ].concat(_to_consumable_array$4((_cors_allowOrigins = cors.allowOrigins) !== null && _cors_allowOrigins !== void 0 ? _cors_allowOrigins : [])));
5106
5106
  return function(requestOrigin, callback) {
5107
5107
  var resolved;
5108
5108
  if (requestOrigin && allowlist.has(requestOrigin)) {
@@ -5343,7 +5343,7 @@ function _object_spread$2(target) {
5343
5343
  return target;
5344
5344
  }
5345
5345
  function _possible_constructor_return(self, call) {
5346
- if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
5346
+ if (call && (_type_of$1(call) === "object" || typeof call === "function")) return call;
5347
5347
  return _assert_this_initialized(self);
5348
5348
  }
5349
5349
  function _set_prototype_of(o, p) {
@@ -5353,7 +5353,7 @@ function _set_prototype_of(o, p) {
5353
5353
  };
5354
5354
  return _set_prototype_of(o, p);
5355
5355
  }
5356
- function _type_of(obj) {
5356
+ function _type_of$1(obj) {
5357
5357
  "@swc/helpers - typeof";
5358
5358
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
5359
5359
  }
@@ -5422,32 +5422,32 @@ FirebaseServerOidcAnalyticsService = FirebaseServerOidcAnalyticsService_1 = __de
5422
5422
  __param(2, Inject(FIREBASE_SERVER_OIDC_ANALYTICS_CONFIG))
5423
5423
  ], FirebaseServerOidcAnalyticsService);
5424
5424
 
5425
- function _array_like_to_array$2(arr, len) {
5425
+ function _array_like_to_array$3(arr, len) {
5426
5426
  if (len == null || len > arr.length) len = arr.length;
5427
5427
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5428
5428
  return arr2;
5429
5429
  }
5430
- function _array_without_holes$2(arr) {
5431
- if (Array.isArray(arr)) return _array_like_to_array$2(arr);
5430
+ function _array_without_holes$3(arr) {
5431
+ if (Array.isArray(arr)) return _array_like_to_array$3(arr);
5432
5432
  }
5433
- function _iterable_to_array$2(iter) {
5433
+ function _iterable_to_array$3(iter) {
5434
5434
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
5435
5435
  return Array.from(iter);
5436
5436
  }
5437
5437
  }
5438
- function _non_iterable_spread$2() {
5438
+ function _non_iterable_spread$3() {
5439
5439
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5440
5440
  }
5441
- function _to_consumable_array$2(arr) {
5442
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
5441
+ function _to_consumable_array$3(arr) {
5442
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$3();
5443
5443
  }
5444
- function _unsupported_iterable_to_array$2(o, minLen) {
5444
+ function _unsupported_iterable_to_array$3(o, minLen) {
5445
5445
  if (!o) return;
5446
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
5446
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
5447
5447
  var n = Object.prototype.toString.call(o).slice(8, -1);
5448
5448
  if (n === "Object" && o.constructor) n = o.constructor.name;
5449
5449
  if (n === "Map" || n === "Set") return Array.from(n);
5450
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
5450
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
5451
5451
  }
5452
5452
  /**
5453
5453
  * Generates NestJS module metadata that registers {@link FirebaseServerOidcAnalyticsService} as the
@@ -5479,18 +5479,18 @@ function _unsupported_iterable_to_array$2(o, minLen) {
5479
5479
  }
5480
5480
  ] : [];
5481
5481
  return {
5482
- imports: _to_consumable_array$2(imports !== null && imports !== void 0 ? imports : []),
5482
+ imports: _to_consumable_array$3(imports !== null && imports !== void 0 ? imports : []),
5483
5483
  exports: [
5484
5484
  OIDC_ANALYTICS_SERVICE,
5485
5485
  FirebaseServerOidcAnalyticsService
5486
- ].concat(_to_consumable_array$2(exports !== null && exports !== void 0 ? exports : [])),
5486
+ ].concat(_to_consumable_array$3(exports !== null && exports !== void 0 ? exports : [])),
5487
5487
  providers: [
5488
5488
  FirebaseServerOidcAnalyticsService,
5489
5489
  {
5490
5490
  provide: OIDC_ANALYTICS_SERVICE,
5491
5491
  useExisting: FirebaseServerOidcAnalyticsService
5492
5492
  }
5493
- ].concat(_to_consumable_array$2(configProviders), _to_consumable_array$2(providers !== null && providers !== void 0 ? providers : []))
5493
+ ].concat(_to_consumable_array$3(configProviders), _to_consumable_array$3(providers !== null && providers !== void 0 ? providers : []))
5494
5494
  };
5495
5495
  }
5496
5496
 
@@ -5891,13 +5891,210 @@ OidcInteractionService = __decorate([
5891
5891
  __param(1, Inject(OidcClientService))
5892
5892
  ], OidcInteractionService);
5893
5893
 
5894
- function _array_like_to_array$1(arr, len) {
5894
+ function _array_like_to_array$2(arr, len) {
5895
5895
  if (len == null || len > arr.length) len = arr.length;
5896
5896
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5897
5897
  return arr2;
5898
5898
  }
5899
- function _array_with_holes(arr) {
5900
- if (Array.isArray(arr)) return arr;
5899
+ function _array_without_holes$2(arr) {
5900
+ if (Array.isArray(arr)) return _array_like_to_array$2(arr);
5901
+ }
5902
+ function _iterable_to_array$2(iter) {
5903
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
5904
+ return Array.from(iter);
5905
+ }
5906
+ }
5907
+ function _non_iterable_spread$2() {
5908
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5909
+ }
5910
+ function _to_consumable_array$2(arr) {
5911
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
5912
+ }
5913
+ function _type_of(obj) {
5914
+ "@swc/helpers - typeof";
5915
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
5916
+ }
5917
+ function _unsupported_iterable_to_array$2(o, minLen) {
5918
+ if (!o) return;
5919
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
5920
+ var n = Object.prototype.toString.call(o).slice(8, -1);
5921
+ if (n === "Object" && o.constructor) n = o.constructor.name;
5922
+ if (n === "Map" || n === "Set") return Array.from(n);
5923
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
5924
+ }
5925
+ /**
5926
+ * Splits a space-delimited scope string into its non-empty entries.
5927
+ *
5928
+ * @param scope - The space-delimited scope string.
5929
+ * @returns The scope entries.
5930
+ */ function splitScope(scope) {
5931
+ return (scope !== null && scope !== void 0 ? scope : '').split(' ').filter(Boolean);
5932
+ }
5933
+ /**
5934
+ * Removes previously-rejected OIDC scopes from a Grant's rejected set.
5935
+ *
5936
+ * oidc-provider exposes `rejectOIDCScope()` but no inverse, and a rejected scope is subtracted from
5937
+ * `getOIDCScope()` on every read — so `addOIDCScope()` alone cannot put a once-rejected scope back in
5938
+ * force. `rejected` is plain persisted data (`Pick<Grant, 'openid' | 'resources'>`), which is what
5939
+ * makes editing it directly the supported shape of an un-reject.
5940
+ *
5941
+ * @param grant - The grant to edit in place.
5942
+ * @param scopes - The scopes to un-reject. Scopes not currently rejected are ignored.
5943
+ */ function unrejectOIDCScopes(grant, scopes) {
5944
+ var _grant_rejected;
5945
+ var rejected = (_grant_rejected = grant.rejected) === null || _grant_rejected === void 0 ? void 0 : _grant_rejected.openid;
5946
+ if (rejected === null || rejected === void 0 ? void 0 : rejected.scope) {
5947
+ var remove = new Set(scopes);
5948
+ var remaining = splitScope(rejected.scope).filter(function(scope) {
5949
+ return !remove.has(scope);
5950
+ });
5951
+ rejected.scope = remaining.length > 0 ? remaining.join(' ') : undefined;
5952
+ }
5953
+ }
5954
+ /**
5955
+ * Removes previously-rejected OIDC claims from a Grant's rejected set.
5956
+ *
5957
+ * @param grant - The grant to edit in place.
5958
+ * @param claims - The claims to un-reject. Claims not currently rejected are ignored.
5959
+ * @see unrejectOIDCScopes
5960
+ */ function unrejectOIDCClaims(grant, claims) {
5961
+ var _grant_rejected, _rejected_claims;
5962
+ var rejected = (_grant_rejected = grant.rejected) === null || _grant_rejected === void 0 ? void 0 : _grant_rejected.openid;
5963
+ if (rejected === null || rejected === void 0 ? void 0 : (_rejected_claims = rejected.claims) === null || _rejected_claims === void 0 ? void 0 : _rejected_claims.length) {
5964
+ var remove = new Set(claims);
5965
+ var remaining = rejected.claims.filter(function(claim) {
5966
+ return !remove.has(claim);
5967
+ });
5968
+ rejected.claims = remaining.length > 0 ? remaining : undefined;
5969
+ }
5970
+ }
5971
+ /**
5972
+ * Removes previously-rejected resource scopes for one resource indicator from a Grant's rejected set.
5973
+ *
5974
+ * @param grant - The grant to edit in place.
5975
+ * @param resource - The resource indicator.
5976
+ * @param scopes - The scopes to un-reject. Scopes not currently rejected for the resource are ignored.
5977
+ * @see unrejectOIDCScopes
5978
+ */ function unrejectResourceScopes(grant, resource, scopes) {
5979
+ var _grant_rejected;
5980
+ var rejectedResources = (_grant_rejected = grant.rejected) === null || _grant_rejected === void 0 ? void 0 : _grant_rejected.resources;
5981
+ if (rejectedResources === null || rejectedResources === void 0 ? void 0 : rejectedResources[resource]) {
5982
+ var remove = new Set(scopes);
5983
+ var remaining = splitScope(rejectedResources[resource]).filter(function(scope) {
5984
+ return !remove.has(scope);
5985
+ });
5986
+ if (remaining.length > 0) {
5987
+ rejectedResources[resource] = remaining.join(' ');
5988
+ } else {
5989
+ delete rejectedResources[resource];
5990
+ }
5991
+ }
5992
+ }
5993
+ /**
5994
+ * Moves previously-rejected values the current request asks for again from the "encountered" set back into
5995
+ * the "missing" set, so a re-consent decides them afresh.
5996
+ *
5997
+ * oidc-provider counts a rejected value as encountered: it never reappears in the prompt's `missing*`
5998
+ * details, so without this a consent that names it again is a silent no-op and the value can never be
5999
+ * granted on that Grant — even when the user explicitly ticks it. Values the Grant has GRANTED are left in
6000
+ * `encountered`: they are already in force and need no re-application.
6001
+ *
6002
+ * @param input - The missing, encountered, rejected, and requested sets.
6003
+ * @returns The adjusted missing/encountered sets plus the reconsidered values.
6004
+ *
6005
+ * @__NO_SIDE_EFFECTS__
6006
+ */ function reconsiderRejectedValues(input) {
6007
+ var missing = input.missing, encountered = input.encountered, rejected = input.rejected, requested = input.requested;
6008
+ var missingSet = new Set(missing);
6009
+ var reconsidered = rejected.filter(function(value) {
6010
+ return requested.has(value) && !missingSet.has(value);
6011
+ });
6012
+ var reconsideredSet = new Set(reconsidered);
6013
+ return {
6014
+ missing: _to_consumable_array$2(missing).concat(_to_consumable_array$2(reconsidered)),
6015
+ encountered: encountered.filter(function(value) {
6016
+ return !reconsideredSet.has(value);
6017
+ }),
6018
+ reconsidered: reconsidered
6019
+ };
6020
+ }
6021
+ /**
6022
+ * Names every claim an authorization request's `claims` parameter asks for, across `id_token` and `userinfo`.
6023
+ *
6024
+ * @param claimsParam - The raw `claims` request parameter (a JSON string), or undefined.
6025
+ * @returns The requested claim names; empty when the parameter is absent or malformed.
6026
+ *
6027
+ * @__NO_SIDE_EFFECTS__
6028
+ */ function requestedOIDCClaimNames(claimsParam) {
6029
+ var names = new Set();
6030
+ if (typeof claimsParam === 'string' && claimsParam.length > 0) {
6031
+ var parsed;
6032
+ try {
6033
+ parsed = JSON.parse(claimsParam);
6034
+ } catch (unused) {
6035
+ parsed = undefined;
6036
+ }
6037
+ if (parsed != null && (typeof parsed === "undefined" ? "undefined" : _type_of(parsed)) === 'object') {
6038
+ for(var _i = 0, _iter = [
6039
+ 'id_token',
6040
+ 'userinfo'
6041
+ ]; _i < _iter.length; _i++){
6042
+ var key = _iter[_i];
6043
+ var section = parsed[key];
6044
+ if (section != null && (typeof section === "undefined" ? "undefined" : _type_of(section)) === 'object') {
6045
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
6046
+ try {
6047
+ for(var _iterator = Object.keys(section)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
6048
+ var claim = _step.value;
6049
+ names.add(claim);
6050
+ }
6051
+ } catch (err) {
6052
+ _didIteratorError = true;
6053
+ _iteratorError = err;
6054
+ } finally{
6055
+ try {
6056
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
6057
+ _iterator.return();
6058
+ }
6059
+ } finally{
6060
+ if (_didIteratorError) {
6061
+ throw _iteratorError;
6062
+ }
6063
+ }
6064
+ }
6065
+ }
6066
+ }
6067
+ }
6068
+ }
6069
+ return names;
6070
+ }
6071
+ /**
6072
+ * Normalizes an authorization request's `resource` parameter to its list of resource indicators.
6073
+ *
6074
+ * @param resourceParam - The raw `resource` request parameter (a string, an array of strings, or undefined).
6075
+ * @returns The resource indicators; empty when the parameter is absent.
6076
+ *
6077
+ * @__NO_SIDE_EFFECTS__
6078
+ */ function requestedResourceIndicators(resourceParam) {
6079
+ var indicators;
6080
+ if (typeof resourceParam === 'string') {
6081
+ indicators = [
6082
+ resourceParam
6083
+ ];
6084
+ } else if (Array.isArray(resourceParam)) {
6085
+ indicators = resourceParam.filter(function(value) {
6086
+ return typeof value === 'string';
6087
+ });
6088
+ } else {
6089
+ indicators = [];
6090
+ }
6091
+ return indicators;
6092
+ }
6093
+
6094
+ function _array_like_to_array$1(arr, len) {
6095
+ if (len == null || len > arr.length) len = arr.length;
6096
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6097
+ return arr2;
5901
6098
  }
5902
6099
  function _array_without_holes$1(arr) {
5903
6100
  if (Array.isArray(arr)) return _array_like_to_array$1(arr);
@@ -5966,39 +6163,9 @@ function _iterable_to_array$1(iter) {
5966
6163
  return Array.from(iter);
5967
6164
  }
5968
6165
  }
5969
- function _iterable_to_array_limit(arr, i) {
5970
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
5971
- if (_i == null) return;
5972
- var _arr = [];
5973
- var _n = true;
5974
- var _d = false;
5975
- var _s, _e;
5976
- try {
5977
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
5978
- _arr.push(_s.value);
5979
- if (i && _arr.length === i) break;
5980
- }
5981
- } catch (err) {
5982
- _d = true;
5983
- _e = err;
5984
- } finally{
5985
- try {
5986
- if (!_n && _i["return"] != null) _i["return"]();
5987
- } finally{
5988
- if (_d) throw _e;
5989
- }
5990
- }
5991
- return _arr;
5992
- }
5993
- function _non_iterable_rest() {
5994
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5995
- }
5996
6166
  function _non_iterable_spread$1() {
5997
6167
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5998
6168
  }
5999
- function _sliced_to_array(arr, i) {
6000
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest();
6001
- }
6002
6169
  function _to_consumable_array$1(arr) {
6003
6170
  return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
6004
6171
  }
@@ -6306,7 +6473,7 @@ var OidcInteractionController_1;
6306
6473
  * @throws {HttpException} HTTP 400 when the consent interaction cannot be completed.
6307
6474
  */ function postConsent(uid, body, res) {
6308
6475
  return _async_to_generator$2(function() {
6309
- var startedAt, clientId, accountId, _ref, _prompt_details_missingOIDCScope, _ref1, _this_accountService_providerConfig_adminOnlyScopes, _ref2, _ref3, _prompt_details_missingOIDCClaims, _prompt_details_missingResourceScopes, _this_accountService_delegate_isAdminUser, _this_accountService_delegate, _ref4, redirectTo, interaction, prompt, params, session, missingOIDCScope, existingGrant, _tmp, encounteredOIDCScopes, clientPayload, requestedOIDCScopeSet, providerProfiles, _oidcClientProviderProfileScopes, clientUnlockedScopes, clientRequiredScopes, profileGatedScopes, disallowedGatedScopes, _ref5, redirectTo1, missingRequiredScopes, _ref6, redirectTo2, effectiveOIDCScopes, heldOIDCScopes, consentedOIDCScopeSet, configAdminOnlyScopes, adminOnlyScopes, consentedAdminOnlyScopes, requestsServiceToken, isAdmin, _tmp1, _ref7, redirectTo3, requestedRawTtl, clientMaxSessionTtl, expiresInSeconds, grant, _tmp2, granted, rejected, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, value, encounteredOIDCClaims, missingOIDCClaims, _resolveEffectiveSubset, granted1, rejected1, missingResourceScopes, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _step_value, indicator, scopes, _ref8, _body_grantedResourceScopes, requestedSubset, encounteredResourceScopes, _resolveEffectiveSubset1, granted2, rejected2, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, value1, grantId, _ref9, redirectTo4, err;
6476
+ var startedAt, clientId, accountId, _ref, _params_scope, _prompt_details_missingOIDCScope, _ref1, _this_accountService_providerConfig_adminOnlyScopes, _ref2, _ref3, _prompt_details_missingOIDCClaims, _prompt_details_missingResourceScopes, _this_accountService_delegate_isAdminUser, _this_accountService_delegate, _ref4, redirectTo, interaction, prompt, params, session, existingGrant, _tmp, requestedScopeParam, oidcScopes, missingOIDCScope, encounteredOIDCScopes, clientPayload, requestedOIDCScopeSet, providerProfiles, _oidcClientProviderProfileScopes, clientUnlockedScopes, clientRequiredScopes, profileGatedScopes, disallowedGatedScopes, _ref5, redirectTo1, missingRequiredScopes, _ref6, redirectTo2, effectiveOIDCScopes, heldOIDCScopes, consentedOIDCScopeSet, configAdminOnlyScopes, adminOnlyScopes, consentedAdminOnlyScopes, requestsServiceToken, isAdmin, _tmp1, _ref7, redirectTo3, requestedRawTtl, clientMaxSessionTtl, expiresInSeconds, grant, _tmp2, granted, rejected, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, value, _reconsiderRejectedValues, missingOIDCClaims, encounteredOIDCClaims, _resolveEffectiveSubset, granted1, rejected1, missingResourceScopes, resourceIndicators, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, indicator, _missingResourceScopes_indicator, _ref8, _body_grantedResourceScopes, _reconsiderRejectedValues1, scopes, encounteredResourceScopes, requestedSubset, _resolveEffectiveSubset1, granted2, rejected2, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, value1, grantId, _ref9, redirectTo4, err;
6310
6477
  return _ts_generator$2(this, function(_state) {
6311
6478
  switch(_state.label){
6312
6479
  case 0:
@@ -6356,7 +6523,6 @@ var OidcInteractionController_1;
6356
6523
  prompt = interaction.prompt, params = interaction.params, session = interaction.session;
6357
6524
  clientId = params['client_id'];
6358
6525
  accountId = (_ref = session === null || session === void 0 ? void 0 : session.accountId) !== null && _ref !== void 0 ? _ref : '';
6359
- missingOIDCScope = (_prompt_details_missingOIDCScope = prompt.details['missingOIDCScope']) !== null && _prompt_details_missingOIDCScope !== void 0 ? _prompt_details_missingOIDCScope : [];
6360
6526
  if (!interaction.grantId) return [
6361
6527
  3,
6362
6528
  7
@@ -6381,7 +6547,20 @@ var OidcInteractionController_1;
6381
6547
  // but the consent UI sources its checkbox list from the auth URL's `scope=` param (the full request set)
6382
6548
  // and re-submits them all. We accept already-encountered values as silent no-ops so a re-consent on a
6383
6549
  // client the user has previously authorized doesn't fail validation.
6384
- encounteredOIDCScopes = existingGrant ? existingGrant.getOIDCScopeEncountered().split(' ').filter(Boolean) : [];
6550
+ //
6551
+ // A REJECTED value is the exception. oidc-provider counts it as encountered too, so it never comes back
6552
+ // in `missing*` — and a rejected scope is subtracted from `getOIDCScope()` on every read, so treating it
6553
+ // as a no-op would make it ungrantable on this Grant for good, even when the user explicitly ticks it
6554
+ // again. `reconsiderRejectedValues` moves the rejected values this request names back into `missing`
6555
+ // so this consent decides them afresh; a grant of one of those un-rejects it further down.
6556
+ requestedScopeParam = new Set(((_params_scope = params['scope']) !== null && _params_scope !== void 0 ? _params_scope : '').split(' ').filter(Boolean));
6557
+ oidcScopes = reconsiderRejectedValues({
6558
+ missing: (_prompt_details_missingOIDCScope = prompt.details['missingOIDCScope']) !== null && _prompt_details_missingOIDCScope !== void 0 ? _prompt_details_missingOIDCScope : [],
6559
+ encountered: existingGrant ? existingGrant.getOIDCScopeEncountered().split(' ').filter(Boolean) : [],
6560
+ rejected: existingGrant ? existingGrant.getRejectedOIDCScope().split(' ').filter(Boolean) : [],
6561
+ requested: requestedScopeParam
6562
+ });
6563
+ missingOIDCScope = oidcScopes.missing, encounteredOIDCScopes = oidcScopes.encountered;
6385
6564
  return [
6386
6565
  4,
6387
6566
  this.oidcService.findClientPayload(clientId)
@@ -6596,6 +6775,7 @@ var OidcInteractionController_1;
6596
6775
  if (missingOIDCScope.length > 0) {
6597
6776
  granted = effectiveOIDCScopes.granted, rejected = effectiveOIDCScopes.rejected;
6598
6777
  if (granted.length > 0) {
6778
+ unrejectOIDCScopes(grant, granted);
6599
6779
  grant.addOIDCScope(granted.join(' '));
6600
6780
  }
6601
6781
  _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
@@ -6619,8 +6799,14 @@ var OidcInteractionController_1;
6619
6799
  }
6620
6800
  }
6621
6801
  }
6622
- encounteredOIDCClaims = grant.getOIDCClaimsEncountered();
6623
- missingOIDCClaims = (_prompt_details_missingOIDCClaims = prompt.details['missingOIDCClaims']) !== null && _prompt_details_missingOIDCClaims !== void 0 ? _prompt_details_missingOIDCClaims : [];
6802
+ // Same reconsideration as the scopes above: a claim rejected on an earlier consent that this request's
6803
+ // `claims` parameter names again is decided afresh rather than silently kept rejected.
6804
+ _reconsiderRejectedValues = reconsiderRejectedValues({
6805
+ missing: (_prompt_details_missingOIDCClaims = prompt.details['missingOIDCClaims']) !== null && _prompt_details_missingOIDCClaims !== void 0 ? _prompt_details_missingOIDCClaims : [],
6806
+ encountered: grant.getOIDCClaimsEncountered(),
6807
+ rejected: grant.getRejectedOIDCClaims(),
6808
+ requested: requestedOIDCClaimNames(params['claims'])
6809
+ }), missingOIDCClaims = _reconsiderRejectedValues.missing, encounteredOIDCClaims = _reconsiderRejectedValues.encountered;
6624
6810
  if (missingOIDCClaims.length > 0) {
6625
6811
  _resolveEffectiveSubset = resolveEffectiveSubset({
6626
6812
  missing: missingOIDCClaims,
@@ -6628,6 +6814,7 @@ var OidcInteractionController_1;
6628
6814
  alreadyEncountered: encounteredOIDCClaims
6629
6815
  }), granted1 = _resolveEffectiveSubset.granted, rejected1 = _resolveEffectiveSubset.rejected;
6630
6816
  if (granted1.length > 0) {
6817
+ unrejectOIDCClaims(grant, granted1);
6631
6818
  grant.addOIDCClaims(granted1);
6632
6819
  }
6633
6820
  if (rejected1.length > 0) {
@@ -6635,12 +6822,25 @@ var OidcInteractionController_1;
6635
6822
  }
6636
6823
  }
6637
6824
  missingResourceScopes = (_prompt_details_missingResourceScopes = prompt.details['missingResourceScopes']) !== null && _prompt_details_missingResourceScopes !== void 0 ? _prompt_details_missingResourceScopes : {};
6825
+ // Resource indicators this consent decides: the ones oidc-provider reports as still undecided, plus any
6826
+ // the request names (`resource` param) that carry a rejection worth reconsidering. An indicator whose
6827
+ // every scope was rejected earlier is absent from `missingResourceScopes` entirely, which is exactly the
6828
+ // case that needs the second source.
6829
+ resourceIndicators = new Set(_to_consumable_array$1(Object.keys(missingResourceScopes)).concat(_to_consumable_array$1(requestedResourceIndicators(params['resource']).filter(function(indicator) {
6830
+ return grant.getRejectedResourceScope(indicator).length > 0;
6831
+ }))));
6638
6832
  _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
6639
6833
  try {
6640
- for(_iterator1 = Object.entries(missingResourceScopes)[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
6641
- _step_value = _sliced_to_array(_step1.value, 2), indicator = _step_value[0], scopes = _step_value[1];
6834
+ for(_iterator1 = resourceIndicators[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
6835
+ indicator = _step1.value;
6642
6836
  ;
6643
6837
  ;
6838
+ _reconsiderRejectedValues1 = reconsiderRejectedValues({
6839
+ missing: (_missingResourceScopes_indicator = missingResourceScopes[indicator]) !== null && _missingResourceScopes_indicator !== void 0 ? _missingResourceScopes_indicator : [],
6840
+ encountered: grant.getResourceScopeEncountered(indicator).split(' ').filter(Boolean),
6841
+ rejected: grant.getRejectedResourceScope(indicator).split(' ').filter(Boolean),
6842
+ requested: requestedScopeParam
6843
+ }), scopes = _reconsiderRejectedValues1.missing, encounteredResourceScopes = _reconsiderRejectedValues1.encountered;
6644
6844
  // A submission with no explicit per-resource selection falls back to the OIDC scope selection
6645
6845
  // rather than granting everything the resource server declares. A resource server's scope list
6646
6846
  // is drawn from the same provider scopes the consent UI renders as one checkbox list, so a scope
@@ -6650,13 +6850,13 @@ var OidcInteractionController_1;
6650
6850
  requestedSubset = (_ref8 = (_body_grantedResourceScopes = body.grantedResourceScopes) === null || _body_grantedResourceScopes === void 0 ? void 0 : _body_grantedResourceScopes[indicator]) !== null && _ref8 !== void 0 ? _ref8 : body.grantedOIDCScopes ? scopes.filter(function(scope) {
6651
6851
  return consentedOIDCScopeSet.has(scope);
6652
6852
  }) : undefined;
6653
- encounteredResourceScopes = grant.getResourceScopeEncountered(indicator).split(' ').filter(Boolean);
6654
6853
  _resolveEffectiveSubset1 = resolveEffectiveSubset({
6655
6854
  missing: scopes,
6656
6855
  requestedSubset: requestedSubset,
6657
6856
  alreadyEncountered: encounteredResourceScopes
6658
6857
  }), granted2 = _resolveEffectiveSubset1.granted, rejected2 = _resolveEffectiveSubset1.rejected;
6659
6858
  if (granted2.length > 0) {
6859
+ unrejectResourceScopes(grant, indicator, granted2);
6660
6860
  grant.addResourceScope(indicator, granted2.join(' '));
6661
6861
  }
6662
6862
  _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
@@ -7898,4 +8098,4 @@ function _unsupported_iterable_to_array(o, minLen) {
7898
8098
  };
7899
8099
  }
7900
8100
 
7901
- export { DBX_FIREBASE_SERVER_OIDC_PROVIDER_PROFILES_CLIENT_METADATA, DEFAULT_APP_OAUTH_CONSENT_PATH_PART, DEFAULT_APP_OAUTH_INTERACTION_PATH, DEFAULT_APP_OAUTH_LOGIN_PATH_PART, DEFAULT_MAX_ADMIN_LOGIN_DURATION_SECONDS, DEFAULT_MAX_NONADMIN_LOGIN_DURATION_SECONDS, DEFAULT_MAX_REQUESTED_LOGIN_DURATION_SECONDS, DEFAULT_MAX_SERVICE_TOKEN_LOGIN_DURATION_SECONDS, DEFAULT_MIN_REQUESTED_LOGIN_DURATION_SECONDS, DEFAULT_OIDC_ANALYTICS_EVENT_NAMES, DEFAULT_OIDC_ANALYTICS_EVENT_NAME_PREFIX, DEFAULT_OIDC_CODE_CHALLENGE_METHODS, DEFAULT_OIDC_ID_TOKEN_SIGNING_ALG_VALUES, DEFAULT_OIDC_ISSUER_PATH, DEFAULT_OIDC_ROUTES, DEFAULT_OIDC_SUBJECT_TYPES, DEFAULT_OIDC_TOKEN_ENDPOINT_AUTH_METHODS, DEFAULT_OIDC_TOKEN_LIFETIMES, DEFAULT_ROTATED_KEY_MAX_AGE, FIREBASE_SERVER_OIDC_ANALYTICS_CONFIG, FIREBASE_SERVER_OIDC_ROUTES_FOR_GLOBAL_ROUTE_EXCLUDE, FirebaseServerOidcAnalyticsService, GRANTABLE_MODEL_NAMES, JwksFirestoreCollections, JwksKeyDocument, JwksService, JwksServiceConfig, JwksServiceStorageConfig, OIDC_ANALYTICS_SERVICE, OIDC_ENCRYPTED_PAYLOAD_FIELDS, OIDC_JSON_RENDER_ERROR_FUNCTION, OIDC_JWKS_ENCRYPTION_SECRET_ENV_KEY, OidcAccountService, OidcAccountServiceDelegate, OidcAccountServiceUserContext, OidcAnalyticsService, OidcAuth, OidcAuthBearerTokenMiddleware, OidcAuthMiddlewareConfig, OidcClientService, OidcEncryptionService, OidcInteractionController, OidcInteractionService, OidcModelServerActions, OidcModuleConfig, OidcProviderConfigService, OidcProviderController, OidcServerFirestoreCollections, OidcService, OidcWellKnownController, STALE_SESSION_ACCOUNT_CHECK_REASON, activeJwksKeysQuery, adminOnlyScopesForOidcProviderConfig, allOidcScopesStringForProviderConfig, appOidcAnalyticsModuleMetadata, appOidcModelModuleMetadata, applyOidcAuthMiddleware, applyOidcCorsMiddleware, buildBearerChallenge, buildFirebaseServerMcpResourceServer, buildOidcInteractionPolicy, createAdapterFactory, createOidcClientFactory, deleteOidcClientFactory, deleteOidcTokenFactory, deriveResourceMetadataUrlFromEnv, emitOidcAnalyticsEvent, getOidcScopesFromRequest, jwksKeyCollectionReference, jwksKeyConverter, jwksKeyFirestoreCollection, jwksKeyIdentity, jwksKeysWithStatusQuery, nonRetiredJwksKeysQuery, noopOidcAnalyticsService, oidcClientProviderProfileScopes, oidcCorsOriginDelegate, oidcFirestoreCollectionsFactory, oidcModelServerActions, oidcModelServerActionsFactory, oidcModuleConfigFactory, oidcModuleMetadata, resolveEffectiveSubset, rotateOidcClientSecretFactory, rotatedJwksKeysQuery, updateOidcClientFactory };
8101
+ export { DBX_FIREBASE_SERVER_OIDC_PROVIDER_PROFILES_CLIENT_METADATA, DEFAULT_APP_OAUTH_CONSENT_PATH_PART, DEFAULT_APP_OAUTH_INTERACTION_PATH, DEFAULT_APP_OAUTH_LOGIN_PATH_PART, DEFAULT_MAX_ADMIN_LOGIN_DURATION_SECONDS, DEFAULT_MAX_NONADMIN_LOGIN_DURATION_SECONDS, DEFAULT_MAX_REQUESTED_LOGIN_DURATION_SECONDS, DEFAULT_MAX_SERVICE_TOKEN_LOGIN_DURATION_SECONDS, DEFAULT_MIN_REQUESTED_LOGIN_DURATION_SECONDS, DEFAULT_OIDC_ANALYTICS_EVENT_NAMES, DEFAULT_OIDC_ANALYTICS_EVENT_NAME_PREFIX, DEFAULT_OIDC_CODE_CHALLENGE_METHODS, DEFAULT_OIDC_ID_TOKEN_SIGNING_ALG_VALUES, DEFAULT_OIDC_ISSUER_PATH, DEFAULT_OIDC_ROUTES, DEFAULT_OIDC_SUBJECT_TYPES, DEFAULT_OIDC_TOKEN_ENDPOINT_AUTH_METHODS, DEFAULT_OIDC_TOKEN_LIFETIMES, DEFAULT_ROTATED_KEY_MAX_AGE, FIREBASE_SERVER_OIDC_ANALYTICS_CONFIG, FIREBASE_SERVER_OIDC_ROUTES_FOR_GLOBAL_ROUTE_EXCLUDE, FirebaseServerOidcAnalyticsService, GRANTABLE_MODEL_NAMES, JwksFirestoreCollections, JwksKeyDocument, JwksService, JwksServiceConfig, JwksServiceStorageConfig, OIDC_ANALYTICS_SERVICE, OIDC_ENCRYPTED_PAYLOAD_FIELDS, OIDC_JSON_RENDER_ERROR_FUNCTION, OIDC_JWKS_ENCRYPTION_SECRET_ENV_KEY, OidcAccountService, OidcAccountServiceDelegate, OidcAccountServiceUserContext, OidcAnalyticsService, OidcAuth, OidcAuthBearerTokenMiddleware, OidcAuthMiddlewareConfig, OidcClientService, OidcEncryptionService, OidcInteractionController, OidcInteractionService, OidcModelServerActions, OidcModuleConfig, OidcProviderConfigService, OidcProviderController, OidcServerFirestoreCollections, OidcService, OidcWellKnownController, STALE_SESSION_ACCOUNT_CHECK_REASON, activeJwksKeysQuery, adminOnlyScopesForOidcProviderConfig, allOidcScopesStringForProviderConfig, appOidcAnalyticsModuleMetadata, appOidcModelModuleMetadata, applyOidcAuthMiddleware, applyOidcCorsMiddleware, buildBearerChallenge, buildFirebaseServerMcpResourceServer, buildOidcInteractionPolicy, createAdapterFactory, createOidcClientFactory, deleteOidcClientFactory, deleteOidcTokenFactory, deriveResourceMetadataUrlFromEnv, emitOidcAnalyticsEvent, getOidcScopesFromRequest, jwksKeyCollectionReference, jwksKeyConverter, jwksKeyFirestoreCollection, jwksKeyIdentity, jwksKeysWithStatusQuery, nonRetiredJwksKeysQuery, noopOidcAnalyticsService, oidcClientProviderProfileScopes, oidcCorsOriginDelegate, oidcFirestoreCollectionsFactory, oidcModelServerActions, oidcModelServerActionsFactory, oidcModuleConfigFactory, oidcModuleMetadata, reconsiderRejectedValues, requestedOIDCClaimNames, requestedResourceIndicators, resolveEffectiveSubset, rotateOidcClientSecretFactory, rotatedJwksKeysQuery, unrejectOIDCClaims, unrejectOIDCScopes, unrejectResourceScopes, updateOidcClientFactory };