UNPKG

4.57 kBTypeScriptView Raw
1/*! firebase-admin v10.0.0 */
2/*!
3 * Copyright 2019 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17import { EmailSignInConfigServerRequest, MultiFactorAuthServerConfig, MultiFactorConfig, EmailSignInProviderConfig } from './auth-config';
18/**
19 * Interface representing the properties to update on the provided tenant.
20 */
21export interface UpdateTenantRequest {
22 /**
23 * The tenant display name.
24 */
25 displayName?: string;
26 /**
27 * The email sign in configuration.
28 */
29 emailSignInConfig?: EmailSignInProviderConfig;
30 /**
31 * Whether the anonymous provider is enabled.
32 */
33 anonymousSignInEnabled?: boolean;
34 /**
35 * The multi-factor auth configuration to update on the tenant.
36 */
37 multiFactorConfig?: MultiFactorConfig;
38 /**
39 * The updated map containing the test phone number / code pairs for the tenant.
40 * Passing null clears the previously save phone number / code pairs.
41 */
42 testPhoneNumbers?: {
43 [phoneNumber: string]: string;
44 } | null;
45}
46/**
47 * Interface representing the properties to set on a new tenant.
48 */
49export declare type CreateTenantRequest = UpdateTenantRequest;
50/** The corresponding server side representation of a TenantOptions object. */
51export interface TenantOptionsServerRequest extends EmailSignInConfigServerRequest {
52 displayName?: string;
53 enableAnonymousUser?: boolean;
54 mfaConfig?: MultiFactorAuthServerConfig;
55 testPhoneNumbers?: {
56 [key: string]: string;
57 };
58}
59/** The tenant server response interface. */
60export interface TenantServerResponse {
61 name: string;
62 displayName?: string;
63 allowPasswordSignup?: boolean;
64 enableEmailLinkSignin?: boolean;
65 enableAnonymousUser?: boolean;
66 mfaConfig?: MultiFactorAuthServerConfig;
67 testPhoneNumbers?: {
68 [key: string]: string;
69 };
70}
71/**
72 * Represents a tenant configuration.
73 *
74 * Multi-tenancy support requires Google Cloud's Identity Platform
75 * (GCIP). To learn more about GCIP, including pricing and features,
76 * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
77 *
78 * Before multi-tenancy can be used on a Google Cloud Identity Platform project,
79 * tenants must be allowed on that project via the Cloud Console UI.
80 *
81 * A tenant configuration provides information such as the display name, tenant
82 * identifier and email authentication configuration.
83 * For OIDC/SAML provider configuration management, `TenantAwareAuth` instances should
84 * be used instead of a `Tenant` to retrieve the list of configured IdPs on a tenant.
85 * When configuring these providers, note that tenants will inherit
86 * whitelisted domains and authenticated redirect URIs of their parent project.
87 *
88 * All other settings of a tenant will also be inherited. These will need to be managed
89 * from the Cloud Console UI.
90 */
91export declare class Tenant {
92 /**
93 * The tenant identifier.
94 */
95 readonly tenantId: string;
96 /**
97 * The tenant display name.
98 */
99 readonly displayName?: string;
100 readonly anonymousSignInEnabled: boolean;
101 /**
102 * The map containing the test phone number / code pairs for the tenant.
103 */
104 readonly testPhoneNumbers?: {
105 [phoneNumber: string]: string;
106 };
107 private readonly emailSignInConfig_?;
108 private readonly multiFactorConfig_?;
109 /**
110 * Validates a tenant options object. Throws an error on failure.
111 *
112 * @param request - The tenant options object to validate.
113 * @param createRequest - Whether this is a create request.
114 */
115 private static validate;
116 /**
117 * The email sign in provider configuration.
118 */
119 get emailSignInConfig(): EmailSignInProviderConfig | undefined;
120 /**
121 * The multi-factor auth configuration on the current tenant.
122 */
123 get multiFactorConfig(): MultiFactorConfig | undefined;
124 /**
125 * Returns a JSON-serializable representation of this object.
126 *
127 * @returns A JSON-serializable representation of this object.
128 */
129 toJSON(): object;
130}