Skip to content

Commit 4e4893a

Browse files
Remove tenant level mobileLinksConfig CRUD. (#2731)
* removing tenant level mobileLinksConfig change
1 parent 592355d commit 4e4893a

File tree

3 files changed

+0
-86
lines changed

3 files changed

+0
-86
lines changed

etc/firebase-admin.auth.api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,6 @@ export class Tenant {
950950
readonly displayName?: string;
951951
readonly emailPrivacyConfig?: EmailPrivacyConfig;
952952
get emailSignInConfig(): EmailSignInProviderConfig | undefined;
953-
readonly mobileLinksConfig?: MobileLinksConfig;
954953
get multiFactorConfig(): MultiFactorConfig | undefined;
955954
readonly passwordPolicyConfig?: PasswordPolicyConfig;
956955
get recaptchaConfig(): RecaptchaConfig | undefined;
@@ -1032,7 +1031,6 @@ export interface UpdateTenantRequest {
10321031
displayName?: string;
10331032
emailPrivacyConfig?: EmailPrivacyConfig;
10341033
emailSignInConfig?: EmailSignInProviderConfig;
1035-
mobileLinksConfig?: MobileLinksConfig;
10361034
multiFactorConfig?: MultiFactorConfig;
10371035
passwordPolicyConfig?: PasswordPolicyConfig;
10381036
recaptchaConfig?: RecaptchaConfig;

src/auth/tenant.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
MultiFactorAuthConfig, SmsRegionConfig, SmsRegionsAuthConfig, RecaptchaAuthConfig, RecaptchaConfig,
2525
PasswordPolicyConfig,
2626
PasswordPolicyAuthConfig, PasswordPolicyAuthServerConfig, EmailPrivacyConfig, EmailPrivacyAuthConfig,
27-
MobileLinksConfig, MobileLinksAuthConfig
2827
} from './auth-config';
2928

3029
/**
@@ -78,11 +77,6 @@ export interface UpdateTenantRequest {
7877
* The email privacy configuration for the tenant
7978
*/
8079
emailPrivacyConfig?: EmailPrivacyConfig;
81-
82-
/**
83-
* The mobile links configuration for the project
84-
*/
85-
mobileLinksConfig?: MobileLinksConfig;
8680
}
8781

8882
/**
@@ -101,7 +95,6 @@ export interface TenantOptionsServerRequest extends EmailSignInConfigServerReque
10195
recaptchaConfig?: RecaptchaConfig;
10296
passwordPolicyConfig?: PasswordPolicyAuthServerConfig;
10397
emailPrivacyConfig?: EmailPrivacyConfig;
104-
mobileLinksConfig?: MobileLinksConfig;
10598
}
10699

107100
/** The tenant server response interface. */
@@ -117,7 +110,6 @@ export interface TenantServerResponse {
117110
recaptchaConfig? : RecaptchaConfig;
118111
passwordPolicyConfig?: PasswordPolicyAuthServerConfig;
119112
emailPrivacyConfig?: EmailPrivacyConfig;
120-
mobileLinksConfig?: MobileLinksConfig;
121113
}
122114

123115
/**
@@ -183,11 +175,6 @@ export class Tenant {
183175
* The email privacy configuration for the tenant
184176
*/
185177
public readonly emailPrivacyConfig?: EmailPrivacyConfig;
186-
/**
187-
* The mobile links configuration for the tenant
188-
*/
189-
public readonly mobileLinksConfig?: MobileLinksConfig
190-
191178

192179
/**
193180
* Builds the corresponding server request for a TenantOptions object.
@@ -230,9 +217,6 @@ export class Tenant {
230217
if (typeof tenantOptions.emailPrivacyConfig !== 'undefined') {
231218
request.emailPrivacyConfig = tenantOptions.emailPrivacyConfig;
232219
}
233-
if (typeof tenantOptions.mobileLinksConfig !== 'undefined') {
234-
request.mobileLinksConfig = tenantOptions.mobileLinksConfig;
235-
}
236220
return request;
237221
}
238222

@@ -270,7 +254,6 @@ export class Tenant {
270254
recaptchaConfig: true,
271255
passwordPolicyConfig: true,
272256
emailPrivacyConfig: true,
273-
mobileLinksConfig: true,
274257
};
275258
const label = createRequest ? 'CreateTenantRequest' : 'UpdateTenantRequest';
276259
if (!validator.isNonNullObject(request)) {
@@ -334,10 +317,6 @@ export class Tenant {
334317
if (typeof request.emailPrivacyConfig !== 'undefined') {
335318
EmailPrivacyAuthConfig.validate(request.emailPrivacyConfig);
336319
}
337-
// Validate Mobile Links Config if provided.
338-
if (typeof request.mobileLinksConfig !== 'undefined') {
339-
MobileLinksAuthConfig.validate(request.mobileLinksConfig);
340-
}
341320
}
342321

343322
/**
@@ -384,9 +363,6 @@ export class Tenant {
384363
if (typeof response.emailPrivacyConfig !== 'undefined') {
385364
this.emailPrivacyConfig = deepCopy(response.emailPrivacyConfig);
386365
}
387-
if (typeof response.mobileLinksConfig !== 'undefined') {
388-
this.mobileLinksConfig = deepCopy(response.mobileLinksConfig);
389-
}
390366
}
391367

392368
/**
@@ -427,7 +403,6 @@ export class Tenant {
427403
recaptchaConfig: this.recaptchaConfig_?.toJSON(),
428404
passwordPolicyConfig: deepCopy(this.passwordPolicyConfig),
429405
emailPrivacyConfig: deepCopy(this.emailPrivacyConfig),
430-
mobileLinksConfig: deepCopy(this.mobileLinksConfig),
431406
};
432407
if (typeof json.multiFactorConfig === 'undefined') {
433408
delete json.multiFactorConfig;
@@ -447,9 +422,6 @@ export class Tenant {
447422
if (typeof json.emailPrivacyConfig === 'undefined') {
448423
delete json.emailPrivacyConfig;
449424
}
450-
if (typeof json.mobileLinksConfig === 'undefined') {
451-
delete json.mobileLinksConfig;
452-
}
453425
return json;
454426
}
455427
}

test/unit/auth/tenant.spec.ts

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ describe('Tenant', () => {
103103
emailPrivacyConfig: {
104104
enableImprovedEmailPrivacy: true,
105105
},
106-
mobileLinksConfig: {
107-
domain: 'HOSTING_DOMAIN'
108-
},
109106
};
110107

111108
const clientRequest: UpdateTenantRequest = {
@@ -135,9 +132,6 @@ describe('Tenant', () => {
135132
emailPrivacyConfig: {
136133
enableImprovedEmailPrivacy: true,
137134
},
138-
mobileLinksConfig: {
139-
domain: 'HOSTING_DOMAIN'
140-
},
141135
};
142136

143137
const serverRequestWithoutMfa: TenantServerResponse = {
@@ -149,9 +143,6 @@ describe('Tenant', () => {
149143
emailPrivacyConfig: {
150144
enableImprovedEmailPrivacy: true,
151145
},
152-
mobileLinksConfig: {
153-
domain: 'HOSTING_DOMAIN'
154-
},
155146
};
156147

157148
const clientRequestWithoutMfa: UpdateTenantRequest = {
@@ -164,9 +155,6 @@ describe('Tenant', () => {
164155
emailPrivacyConfig: {
165156
enableImprovedEmailPrivacy: true,
166157
},
167-
mobileLinksConfig: {
168-
domain: 'HOSTING_DOMAIN'
169-
},
170158
};
171159

172160
const clientRequestWithRecaptcha: UpdateTenantRequest = {
@@ -231,9 +219,6 @@ describe('Tenant', () => {
231219
emailPrivacyConfig: {
232220
enableImprovedEmailPrivacy: true,
233221
},
234-
mobileLinksConfig: {
235-
domain: 'HOSTING_DOMAIN'
236-
},
237222
};
238223

239224
describe('buildServerRequest()', () => {
@@ -599,22 +584,6 @@ describe('Tenant', () => {
599584
}).to.throw('"EmailPrivacyConfig.enableImprovedEmailPrivacy" must be a valid boolean value.');
600585
});
601586

602-
it('should throw on invalid MobileLinksConfig attribute', () => {
603-
const tenantOptionsClientRequest = deepCopy(clientRequest) as any;
604-
tenantOptionsClientRequest.mobileLinksConfig.invalidParameter = 'invalid';
605-
expect(() => {
606-
Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest);
607-
}).to.throw('"invalidParameter" is not a valid "MobileLinksConfig" parameter.');
608-
});
609-
610-
it('should throw on invalid domain attribute', () => {
611-
const tenantOptionsClientRequest = deepCopy(clientRequest) as any;
612-
tenantOptionsClientRequest.mobileLinksConfig.domain = 'random domain';
613-
expect(() => {
614-
Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest);
615-
}).to.throw('"MobileLinksConfig.domain" must be either "HOSTING_DOMAIN" or "FIREBASE_DYNAMIC_LINK_DOMAIN".');
616-
});
617-
618587
it('should not throw on valid client request object', () => {
619588
const tenantOptionsClientRequest = deepCopy(clientRequestWithRecaptcha);
620589
expect(() => {
@@ -1010,22 +979,6 @@ describe('Tenant', () => {
1010979
}).to.throw('"EmailPrivacyConfig.enableImprovedEmailPrivacy" must be a valid boolean value.');
1011980
});
1012981

1013-
it('should throw on invalid MobileLinksConfig attribute', () => {
1014-
const tenantOptionsClientRequest = deepCopy(clientRequest) as any;
1015-
tenantOptionsClientRequest.mobileLinksConfig.invalidParameter = 'invalid';
1016-
expect(() => {
1017-
Tenant.buildServerRequest(tenantOptionsClientRequest, createRequest);
1018-
}).to.throw('"invalidParameter" is not a valid "MobileLinksConfig" parameter.');
1019-
});
1020-
1021-
it('should throw on invalid domain attribute', () => {
1022-
const tenantOptionsClientRequest = deepCopy(clientRequest) as any;
1023-
tenantOptionsClientRequest.mobileLinksConfig.domain = 'random domain';
1024-
expect(() => {
1025-
Tenant.buildServerRequest(tenantOptionsClientRequest, createRequest);
1026-
}).to.throw('"MobileLinksConfig.domain" must be either "HOSTING_DOMAIN" or "FIREBASE_DYNAMIC_LINK_DOMAIN".');
1027-
});
1028-
1029982
const nonObjects = [null, NaN, 0, 1, true, false, '', 'a', [], [1, 'a'], _.noop];
1030983
nonObjects.forEach((request) => {
1031984
it('should throw on invalid CreateTenantRequest:' + JSON.stringify(request), () => {
@@ -1145,13 +1098,6 @@ describe('Tenant', () => {
11451098
deepCopy(clientRequest.passwordPolicyConfig));
11461099
});
11471100

1148-
it('should set readonly property mobileLinksConfig', () => {
1149-
const expectedMobileLinksConfig = {
1150-
domain: 'HOSTING_DOMAIN',
1151-
};
1152-
expect(clientRequest.mobileLinksConfig).to.deep.equal(expectedMobileLinksConfig);
1153-
});
1154-
11551101
it('should set readonly property emailPrivacyConfig', () => {
11561102
const expectedEmailPrivacyConfig = {
11571103
enableImprovedEmailPrivacy: true,
@@ -1201,7 +1147,6 @@ describe('Tenant', () => {
12011147
recaptchaConfig: deepCopy(serverResponseWithRecaptcha.recaptchaConfig),
12021148
passwordPolicyConfig: deepCopy(clientRequest.passwordPolicyConfig),
12031149
emailPrivacyConfig: deepCopy(clientRequest.emailPrivacyConfig),
1204-
mobileLinksConfig: deepCopy(clientRequest.mobileLinksConfig),
12051150
});
12061151
});
12071152

@@ -1213,7 +1158,6 @@ describe('Tenant', () => {
12131158
delete serverRequestCopyWithoutMfa.recaptchaConfig;
12141159
delete serverRequestCopyWithoutMfa.passwordPolicyConfig;
12151160
delete serverRequestCopyWithoutMfa.emailPrivacyConfig;
1216-
delete serverRequestCopyWithoutMfa.mobileLinksConfig;
12171161
expect(new Tenant(serverRequestCopyWithoutMfa).toJSON()).to.deep.equal({
12181162
tenantId: 'TENANT-ID',
12191163
displayName: 'TENANT-DISPLAY-NAME',

0 commit comments

Comments
 (0)