@dereekb/firebase-server 13.12.9 → 13.13.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/test/index.cjs.js CHANGED
@@ -4922,20 +4922,28 @@ function _ts_generator$1(thisArg, body) {
4922
4922
  }
4923
4923
  /**
4924
4924
  * Resolves the scopes string from config, or falls back to all registered scopes
4925
- * from `OidcAccountService.allRegisteredScopes`.
4925
+ * from the provider config — excluding any `adminOnlyScopes`.
4926
+ *
4927
+ * Admin-only scopes (e.g. `token.service`) are dropped from the default "all scopes" request because
4928
+ * the provider hard-rejects them for non-admin users, and this default flow logs in an arbitrary
4929
+ * (often non-admin) user. Tests that need an admin-only scope pass it explicitly via `config.scopes`.
4926
4930
  *
4927
4931
  * @param nestApp - Initialized NestJS application used to resolve {@link OidcAccountService} when no scopes override is given.
4928
4932
  * @param config - Optional flow config; when `config.scopes` is set, it is returned verbatim.
4929
4933
  * @returns The space-separated scope string to pass to the `/oidc/auth` endpoint.
4930
4934
  */ function resolveScopes(nestApp, config) {
4931
4935
  return _async_to_generator$1(function() {
4932
- var result, accountService;
4936
+ var result, _providerConfig_adminOnlyScopes, accountService, providerConfig, adminOnlyScopes;
4933
4937
  return _ts_generator$1(this, function(_state) {
4934
4938
  if (config === null || config === void 0 ? void 0 : config.scopes) {
4935
4939
  result = config.scopes;
4936
4940
  } else {
4937
4941
  accountService = nestApp.get(oidc.OidcAccountService);
4938
- result = Object.keys(accountService.providerConfig.claims).join(' ');
4942
+ providerConfig = accountService.providerConfig;
4943
+ adminOnlyScopes = new Set((_providerConfig_adminOnlyScopes = providerConfig.adminOnlyScopes) !== null && _providerConfig_adminOnlyScopes !== void 0 ? _providerConfig_adminOnlyScopes : []);
4944
+ result = Object.keys(providerConfig.claims).filter(function(scope) {
4945
+ return !adminOnlyScopes.has(scope);
4946
+ }).join(' ');
4939
4947
  }
4940
4948
  return [
4941
4949
  2,
package/test/index.esm.js CHANGED
@@ -4921,20 +4921,28 @@ function _ts_generator$1(thisArg, body) {
4921
4921
  }
4922
4922
  /**
4923
4923
  * Resolves the scopes string from config, or falls back to all registered scopes
4924
- * from `OidcAccountService.allRegisteredScopes`.
4924
+ * from the provider config — excluding any `adminOnlyScopes`.
4925
+ *
4926
+ * Admin-only scopes (e.g. `token.service`) are dropped from the default "all scopes" request because
4927
+ * the provider hard-rejects them for non-admin users, and this default flow logs in an arbitrary
4928
+ * (often non-admin) user. Tests that need an admin-only scope pass it explicitly via `config.scopes`.
4925
4929
  *
4926
4930
  * @param nestApp - Initialized NestJS application used to resolve {@link OidcAccountService} when no scopes override is given.
4927
4931
  * @param config - Optional flow config; when `config.scopes` is set, it is returned verbatim.
4928
4932
  * @returns The space-separated scope string to pass to the `/oidc/auth` endpoint.
4929
4933
  */ function resolveScopes(nestApp, config) {
4930
4934
  return _async_to_generator$1(function() {
4931
- var result, accountService;
4935
+ var result, _providerConfig_adminOnlyScopes, accountService, providerConfig, adminOnlyScopes;
4932
4936
  return _ts_generator$1(this, function(_state) {
4933
4937
  if (config === null || config === void 0 ? void 0 : config.scopes) {
4934
4938
  result = config.scopes;
4935
4939
  } else {
4936
4940
  accountService = nestApp.get(OidcAccountService);
4937
- result = Object.keys(accountService.providerConfig.claims).join(' ');
4941
+ providerConfig = accountService.providerConfig;
4942
+ adminOnlyScopes = new Set((_providerConfig_adminOnlyScopes = providerConfig.adminOnlyScopes) !== null && _providerConfig_adminOnlyScopes !== void 0 ? _providerConfig_adminOnlyScopes : []);
4943
+ result = Object.keys(providerConfig.claims).filter(function(scope) {
4944
+ return !adminOnlyScopes.has(scope);
4945
+ }).join(' ');
4938
4946
  }
4939
4947
  return [
4940
4948
  2,
package/test/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/test",
3
- "version": "13.12.9",
3
+ "version": "13.13.0",
4
4
  "peerDependencies": {
5
- "@dereekb/analytics": "13.12.9",
6
- "@dereekb/date": "13.12.9",
7
- "@dereekb/firebase": "13.12.9",
8
- "@dereekb/firebase-server": "13.12.9",
9
- "@dereekb/firebase-server/oidc": "13.12.9",
10
- "@dereekb/model": "13.12.9",
11
- "@dereekb/nestjs": "13.12.9",
12
- "@dereekb/rxjs": "13.12.9",
13
- "@dereekb/util": "13.12.9",
5
+ "@dereekb/analytics": "13.13.0",
6
+ "@dereekb/date": "13.13.0",
7
+ "@dereekb/firebase": "13.13.0",
8
+ "@dereekb/firebase-server": "13.13.0",
9
+ "@dereekb/firebase-server/oidc": "13.13.0",
10
+ "@dereekb/model": "13.13.0",
11
+ "@dereekb/nestjs": "13.13.0",
12
+ "@dereekb/rxjs": "13.13.0",
13
+ "@dereekb/util": "13.13.0",
14
14
  "@google-cloud/firestore": "^7.11.6",
15
15
  "@google-cloud/storage": "^7.19.0",
16
16
  "@nestjs/common": "^11.1.19",
@@ -23,7 +23,7 @@
23
23
  "supertest": "^7.2.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@dereekb/nestjs": "13.12.9"
26
+ "@dereekb/nestjs": "13.13.0"
27
27
  },
28
28
  "exports": {
29
29
  "./package.json": "./package.json",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/twilio",
3
- "version": "13.12.9",
3
+ "version": "13.13.0",
4
4
  "peerDependencies": {
5
- "@dereekb/date": "13.12.9",
6
- "@dereekb/firebase": "13.12.9",
7
- "@dereekb/firebase-server": "13.12.9",
8
- "@dereekb/model": "13.12.9",
9
- "@dereekb/nestjs": "13.12.9",
10
- "@dereekb/rxjs": "13.12.9",
11
- "@dereekb/util": "13.12.9"
5
+ "@dereekb/date": "13.13.0",
6
+ "@dereekb/firebase": "13.13.0",
7
+ "@dereekb/firebase-server": "13.13.0",
8
+ "@dereekb/model": "13.13.0",
9
+ "@dereekb/nestjs": "13.13.0",
10
+ "@dereekb/rxjs": "13.13.0",
11
+ "@dereekb/util": "13.13.0"
12
12
  },
13
13
  "exports": {
14
14
  "./package.json": "./package.json",
package/zoho/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/zoho",
3
- "version": "13.12.9",
3
+ "version": "13.13.0",
4
4
  "peerDependencies": {
5
- "@dereekb/analytics": "13.12.9",
6
- "@dereekb/date": "13.12.9",
7
- "@dereekb/model": "13.12.9",
8
- "@dereekb/nestjs": "13.12.9",
9
- "@dereekb/rxjs": "13.12.9",
10
- "@dereekb/firebase": "13.12.9",
11
- "@dereekb/util": "13.12.9",
12
- "@dereekb/zoho": "13.12.9"
5
+ "@dereekb/analytics": "13.13.0",
6
+ "@dereekb/date": "13.13.0",
7
+ "@dereekb/model": "13.13.0",
8
+ "@dereekb/nestjs": "13.13.0",
9
+ "@dereekb/rxjs": "13.13.0",
10
+ "@dereekb/firebase": "13.13.0",
11
+ "@dereekb/util": "13.13.0",
12
+ "@dereekb/zoho": "13.13.0"
13
13
  },
14
14
  "exports": {
15
15
  "./package.json": "./package.json",