diff --git a/package-lock.json b/package-lock.json index 81d207924f..c1ae1dfc08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "firebase-admin", - "version": "13.2.0", + "version": "13.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "firebase-admin", - "version": "13.2.0", + "version": "13.3.0", "license": "Apache-2.0", "dependencies": { "@fastify/busboy": "^3.0.0", diff --git a/src/auth/tenant.ts b/src/auth/tenant.ts index 4b66cace3e..a58edb12a5 100644 --- a/src/auth/tenant.ts +++ b/src/auth/tenant.ts @@ -21,7 +21,7 @@ import { AuthClientErrorCode, FirebaseAuthError } from '../utils/error'; import { EmailSignInConfig, EmailSignInConfigServerRequest, MultiFactorAuthServerConfig, MultiFactorConfig, validateTestPhoneNumbers, EmailSignInProviderConfig, - MultiFactorAuthConfig, SmsRegionConfig, SmsRegionsAuthConfig, RecaptchaAuthConfig, RecaptchaConfig, + MultiFactorAuthConfig, SmsRegionConfig, SmsRegionsAuthConfig, RecaptchaAuthConfig, RecaptchaConfig, RecaptchaAuthServerConfig, PasswordPolicyConfig, PasswordPolicyAuthConfig, PasswordPolicyAuthServerConfig, EmailPrivacyConfig, EmailPrivacyAuthConfig, } from './auth-config'; @@ -61,7 +61,7 @@ export interface UpdateTenantRequest { * The SMS configuration to update on the project. */ smsRegionConfig?: SmsRegionConfig; - + /** * The reCAPTCHA configuration to update on the tenant. * By enabling reCAPTCHA Enterprise integration, you are @@ -103,6 +103,7 @@ export interface TenantServerResponse { displayName?: string; allowPasswordSignup?: boolean; enableEmailLinkSignin?: boolean; + disableAuth?: boolean; enableAnonymousUser?: boolean; mfaConfig?: MultiFactorAuthServerConfig; testPhoneNumbers?: {[key: string]: string}; @@ -144,6 +145,13 @@ export class Tenant { */ public readonly displayName?: string; + /** + * Whether authentication is disabled for the tenant. + * If true, the users under the disabled tenant are not allowed to sign-in. + * Admins of the disabled tenant are not able to manage its users. + */ + public readonly disableAuth: boolean + public readonly anonymousSignInEnabled: boolean; /** @@ -344,6 +352,7 @@ export class Tenant { allowPasswordSignup: false, }); } + this.disableAuth = !!response.disableAuth; this.anonymousSignInEnabled = !!response.enableAnonymousUser; if (typeof response.mfaConfig !== 'undefined') { this.multiFactorConfig_ = new MultiFactorAuthConfig(response.mfaConfig); @@ -397,6 +406,7 @@ export class Tenant { displayName: this.displayName, emailSignInConfig: this.emailSignInConfig_?.toJSON(), multiFactorConfig: this.multiFactorConfig_?.toJSON(), + disableAuth: this.disableAuth, anonymousSignInEnabled: this.anonymousSignInEnabled, testPhoneNumbers: this.testPhoneNumbers, smsRegionConfig: deepCopy(this.smsRegionConfig),