forked from wso2/identity-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.ts
More file actions
545 lines (528 loc) · 32.1 KB
/
app.ts
File metadata and controls
545 lines (528 loc) · 32.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
/**
* Copyright (c) 2023-2025, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { getActionsResourceEndpoints } from "@wso2is/admin.actions.v1/configs/endpoints";
import { getAdministratorsResourceEndpoints } from "@wso2is/admin.administrators.v1/config/endpoints";
import { getAgentsResourceEndpoints } from "@wso2is/admin.agents.v1/configs/endpoints";
import { getAPIResourceEndpoints } from "@wso2is/admin.api-resources.v2/configs/endpoint";
import { getApplicationTemplatesResourcesEndpoints } from "@wso2is/admin.application-templates.v1/configs/endpoints";
import { getApplicationsResourceEndpoints } from "@wso2is/admin.applications.v1/configs/endpoints";
import {
getWorkflowAssociationsResourceEndpoints,
getWorkflowsResourceEndpoints
} from "@wso2is/admin.approval-workflows.v1/configs/endpoints";
import {
getAskPasswordFlowBuilderResourceEndpoints
} from "@wso2is/admin.ask-password-flow-builder.v1/configs/endpoints";
import { getBrandingResourceEndpoints } from "@wso2is/admin.branding.v1/configs/endpoints";
import { getCustomerDataServiceEndpoints } from "@wso2is/admin.cds.v1/configs/endpoints";
import { getCertificatesResourceEndpoints } from "@wso2is/admin.certificates.v1";
import { getClaimResourceEndpoints } from "@wso2is/admin.claims.v1/configs/endpoints";
import { ClaimManagementConstants } from "@wso2is/admin.claims.v1/constants/claim-management-constants";
import { getConnectionResourceEndpoints } from "@wso2is/admin.connections.v1";
import { getEmailTemplatesResourceEndpoints } from "@wso2is/admin.email-templates.v1";
import { getExtendedFeatureResourceEndpoints } from "@wso2is/admin.extensions.v1/configs/endpoints";
import { getFeatureGateResourceEndpoints } from "@wso2is/admin.feature-gate.v1/configs/endpoints";
import { getFlowBuilderCoreResourceEndpoints } from "@wso2is/admin.flow-builder-core.v1/config/endpoints";
import { getFlowsResourceEndpoints } from "@wso2is/admin.flows.v1/configs/endpoints";
import { getGroupsResourceEndpoints } from "@wso2is/admin.groups.v1/configs/endpoints";
import { getIDVPResourceEndpoints } from "@wso2is/admin.identity-verification-providers.v1/configs/endpoints";
import { getRemoteLoggingEndpoints } from "@wso2is/admin.logs.v1/configs/endpoints";
import { getScopesResourceEndpoints } from "@wso2is/admin.oidc-scopes.v1";
import { getInsightsResourceEndpoints } from "@wso2is/admin.org-insights.v1/config/org-insights";
import { getOrganizationsResourceEndpoints } from "@wso2is/admin.organizations.v1/configs";
import { OrganizationUtils } from "@wso2is/admin.organizations.v1/utils";
import {
getPasswordRecoveryFlowBuilderResourceEndpoints
} from "@wso2is/admin.password-recovery-flow-builder.v1/config/endpoints";
import { getPolicyAdministrationResourceEndpoints } from "@wso2is/admin.policy-administration.v1/configs/endpoints";
import {
getPushProviderResourceEndpoints, getPushProviderTemplateEndpoints
} from "@wso2is/admin.push-providers.v1/configs/endpoints";
import {
getRegistrationFlowBuilderResourceEndpoints
} from "@wso2is/admin.registration-flow-builder.v1/config/endpoints";
import { getRemoteFetchConfigResourceEndpoints } from "@wso2is/admin.remote-repository-configuration.v1";
import { getRolesResourceEndpoints } from "@wso2is/admin.roles.v2/configs/endpoints";
import { getRulesEndpoints } from "@wso2is/admin.rules.v1/configs/endpoints";
import { getSecretsManagementEndpoints } from "@wso2is/admin.secrets.v1/configs/endpoints";
import { getServerConfigurationsResourceEndpoints } from "@wso2is/admin.server-configurations.v1/configs/endpoints";
import { getSmsTemplateResourceEndpoints } from "@wso2is/admin.sms-templates.v1/configs/endpoints";
import { getExtensionTemplatesEndpoints } from "@wso2is/admin.template-core.v1/configs/endpoints";
import { getTenantResourceEndpoints } from "@wso2is/admin.tenants.v1/configs/endpoints";
import { getUsersResourceEndpoints } from "@wso2is/admin.users.v1/configs/endpoints";
import { getUserstoreResourceEndpoints } from "@wso2is/admin.userstores.v1/configs/endpoints";
import { PRIMARY_USERSTORE } from "@wso2is/admin.userstores.v1/constants/user-store-constants";
import { getValidationServiceEndpoints } from "@wso2is/admin.validation.v1/configs";
import { getVCTemplateEndpoints } from "@wso2is/admin.verifiable-credentials.v1/configs/endpoints";
import { getWebhooksResourceEndpoints } from "@wso2is/admin.webhooks.v1/configs/endpoints";
import { getApprovalsResourceEndpoints } from "@wso2is/common.workflow-approvals.v1";
import {
I18nModuleConstants,
I18nModuleInitOptions,
I18nModuleOptionsInterface,
SupportedLanguagesMeta,
generateBackendPaths
} from "@wso2is/i18n";
import { getCompatibilitySettingsResourceEndpoints } from "./endpoints";
import { getWorkflowRequestsResourceEndpoints } from "../../admin.workflow-requests.v1/types/workflow-requests";
import { AppConstants } from "../constants/app-constants";
import { I18nConstants } from "../constants/i18n-constants";
import { UIConstants } from "../constants/ui-constants";
import { DeploymentConfigInterface, ServiceResourceEndpointsInterface, UIConfigInterface } from "../models/config";
import { store } from "../store";
/**
* Class to handle application config operations.
*/
export class Config {
/**
* Private constructor to avoid object instantiation from outside
* the class.
*
*/
private constructor() { }
/**
* This method adds organization path to the server host if an organization is selected.
*
* @param enforceOrgPath - Enforces the organization path
*
* @returns Server host.
*/
public static resolveServerHost(enforceOrgPath?: boolean, skipAuthzRuntimePath?: boolean): string {
// If tenant qualified URLs are disabled, return the server origin.
if (!this.isTenantQualifiedURLsEnabled()) {
return this.getDeploymentConfig()?.serverOrigin;
}
return this.resolveTenantedServerHost(skipAuthzRuntimePath);
}
/**
* This method resolves the server host without checking whether tenant-qualified URLs are enabled.
* This is for paths that require the tenanted path regardless of whether tenant-qualified URLS
* are enabled.
*
* @param skipAuthzRuntimePath - Skips the authorization runtime path.
*
* @returns Server host.
*/
public static resolveTenantedServerHost(skipAuthzRuntimePath?: boolean): string {
const serverOriginWithTenant: string = window[ "AppUtils" ]?.getConfig()?.serverOriginWithTenant;
if (skipAuthzRuntimePath && serverOriginWithTenant?.slice(-2) === "/o") {
return serverOriginWithTenant.substring(0,serverOriginWithTenant.lastIndexOf("/o"));
}
return serverOriginWithTenant;
}
/**
* This method adds organization path (t/org_uuid) to the server host if a sub-org is selected.
*
* @param enforceOrgPath - Enforces the organization path
*
* @returns Server host.
*/
public static resolveServerHostforFG(enforceOrgPath?: boolean): string {
if ((OrganizationUtils.isSuperOrganization(store.getState().organization.organization)
|| store.getState().organization.isFirstLevelOrganization) && !enforceOrgPath) {
return window[ "AppUtils" ]?.getConfig()?.serverOriginWithTenant;
} else {
return `${
window[ "AppUtils" ]?.getConfig()?.serverOrigin }/t/${ store.getState().organization.organization.id
}`;
}
}
/**
* This method directly returns the server host read from the deployment config.
*
* @returns server host.
*/
public static resolveServerHostFromConfig() {
if (!this.isTenantQualifiedURLsEnabled()) {
return this.getDeploymentConfig()?.serverOrigin;
} else {
return this.getDeploymentConfig()?.serverHost;
}
}
/**
* This method checks if tenant qualified URLs are enabled.
*
* @returns true if tenant qualified URLs are enabled.
*/
private static isTenantQualifiedURLsEnabled() {
return this.getDeploymentConfig()?.tenantContext?.enableTenantQualifiedUrls;
}
/**
* Get the deployment config.
*
* @returns Deployment config object.
*/
public static getDeploymentConfig(): DeploymentConfigInterface {
return {
__experimental__platformIdP: window[ "AppUtils" ]?.getConfig()?.__experimental__platformIdP,
accountApp: window[ "AppUtils" ]?.getConfig()?.accountApp,
adminApp: window[ "AppUtils" ]?.getConfig()?.adminApp,
allowMultipleAppProtocols: window[ "AppUtils" ]?.getConfig()?.allowMultipleAppProtocols,
appBaseName: window[ "AppUtils" ]?.getConfig()?.appBaseWithTenant,
appBaseNameWithoutTenant: window[ "AppUtils" ]?.getConfig()?.appBase,
appHomePath: window[ "AppUtils" ]?.getConfig()?.routes?.home,
appLoginPath: window[ "AppUtils" ]?.getConfig()?.routes?.login,
appLogoutPath: window[ "AppUtils" ]?.getConfig()?.routes?.logout,
centralDeploymentEnabled: window[ "AppUtils" ]?.getConfig()?.centralDeploymentEnabled,
clientHost: window[ "AppUtils" ]?.getConfig()?.clientOriginWithTenant,
clientID: window[ "AppUtils" ]?.getConfig()?.clientID,
clientOrigin: window[ "AppUtils" ]?.getConfig()?.clientOrigin,
clientOriginWithTenant: window[ "AppUtils" ]?.getConfig()?.clientOriginWithTenant,
customServerHost: window[ "AppUtils" ]?.getConfig()?.customServerHost,
developerApp: window[ "AppUtils" ]?.getConfig()?.developerApp,
docSiteURL: window[ "AppUtils" ]?.getConfig()?.docSiteUrl,
extensions: window[ "AppUtils" ]?.getConfig()?.extensions,
idpConfigs: window[ "AppUtils" ]?.getConfig()?.idpConfigs,
loginCallbackUrl: window[ "AppUtils" ]?.getConfig()?.loginCallbackURL,
organizationPrefix: window["AppUtils"]?.getConfig()?.organizationPrefix,
regionSelectionEnabled: window[ "AppUtils" ]?.getConfig()?.regionSelectionEnabled,
serverHost: window[ "AppUtils" ]?.getConfig()?.serverOriginWithTenant,
serverOrigin: window[ "AppUtils" ]?.getConfig()?.serverOrigin,
superTenant: window[ "AppUtils" ]?.getConfig()?.superTenant,
tenant: window[ "AppUtils" ]?.getConfig()?.tenant,
tenantContext: window[ "AppUtils" ]?.getConfig()?.tenantContext,
tenantPath: window[ "AppUtils" ]?.getConfig()?.tenantPath,
tenantPrefix: window[ "AppUtils" ]?.getConfig()?.tenantPrefix
};
}
/**
* I18n init options.
*
* @remarks
* Since the portals are not deployed per tenant, looking for static resources in tenant qualified URLs will fail.
* Using `appBaseNameWithoutTenant` will create a path without the tenant. Therefore, `loadPath()` function will
* look for resource files in `https://localhost:9443/<PORTAL>/resources/i18n` rather than looking for the
* files in `https://localhost:9443/t/wso2.com/<PORTAL>/resources/i18n`.
*
* @param metaFile - Meta File.
* @returns I18n init options.
*/
public static generateModuleInitOptions(metaFile: SupportedLanguagesMeta): I18nModuleInitOptions {
return {
backend: {
loadPath: (language: string[], namespace: string[]) => generateBackendPaths(
language,
namespace,
window[ "AppUtils" ]?.getConfig()?.appBase,
Config.getI18nConfig() ?? {
langAutoDetectEnabled: I18nConstants.LANG_AUTO_DETECT_ENABLED,
namespaceDirectories: I18nConstants.BUNDLE_NAMESPACE_DIRECTORIES,
overrideOptions: I18nConstants.INIT_OPTIONS_OVERRIDE,
resourceExtensionsPath: "/extensions/i18n",
resourcePath: "/resources/i18n",
xhrBackendPluginEnabled: I18nConstants.XHR_BACKEND_PLUGIN_ENABLED
},
metaFile
)
},
load: "currentOnly", // lookup only current lang key(en-US). Prevents 404 from `en`.
ns: [
I18nConstants.APPLICATION_ROLES_NAMESPACE,
I18nConstants.COMMON_NAMESPACE,
I18nConstants.CONSOLE_PORTAL_NAMESPACE,
I18nConstants.EXTENSIONS_NAMESPACE,
I18nConstants.USERSTORES_NAMESPACE,
I18nConstants.VALIDATION_NAMESPACE,
I18nConstants.IMPERSONATION_CONFIGURATION_NAMESPACE,
I18nConstants.TRANSFER_LIST_NAMESPACE,
I18nConstants.USER_NAMESPACE,
I18nConstants.USERS_NAMESPACE,
I18nConstants.PAGES_NAMESPACE,
I18nConstants.IDVP_NAMESPACE,
I18nConstants.INVITE_NAMESPACE,
I18nConstants.PARENT_ORG_INVITATIONS_NAMESPACE,
I18nConstants.OIDC_SCOPES_NAMESPACE,
I18nConstants.ONBOARDED_NAMESPACE,
I18nConstants.ORGANIZATION_DISCOVERY_NAMESPACE,
I18nConstants.ORGANIZATIONS_NAMESPACE,
I18nConstants.AUTHENTICATION_FLOW_NAMESPACE,
I18nConstants.REMOTE_FETCH_NAMESPACE,
I18nConstants.ROLES_NAMESPACE,
I18nConstants.SERVER_CONFIGS_NAMESPACE,
I18nConstants.SAML2_CONFIG_NAMESPACE,
I18nConstants.SESSION_MANAGEMENT_NAMESPACE,
I18nConstants.WS_FEDERATION_CONFIG_NAMESPACE,
I18nConstants.INSIGHTS_NAMESPACE,
I18nConstants.SMS_PROVIDERS_NAMESPACE,
I18nConstants.SMS_TEMPLATES_NAMESPACE,
I18nConstants.CLAIMS_NAMESPACE,
I18nConstants.EMAIL_LOCALE_NAMESPACE,
I18nConstants.HELP_PANEL_NAMESPACE,
I18nConstants.SUBORGANIZATIONS_NAMESPACE,
I18nConstants.CONSOLE_SETTINGS_NAMESPACE,
I18nConstants.SECRETS_NAMESPACE,
I18nConstants.BRANDING_NAMESPACE,
I18nConstants.EMAIL_TEMPLATES_NAMESPACE,
I18nConstants.AUTHENTICATION_PROVIDER_NAMESPACE,
I18nConstants.CERTIFICATES_NAMESPACE,
I18nConstants.GOVERNANCE_CONNECTORS_NAMESPACE,
I18nConstants.GROUPS_NAMESPACE,
I18nConstants.APPLICATIONS_NAMESPACE,
I18nConstants.IDP_NAMESPACE,
I18nConstants.API_RESOURCES_NAMESPACE,
I18nConstants.AI_NAMESPACE,
I18nConstants.TEMPLATE_CORE_NAMESPACE,
I18nConstants.APPLICATION_TEMPLATES_NAMESPACE,
I18nConstants.ACTIONS_NAMESPACE,
I18nConstants.TENANTS_NAMESPACE,
I18nConstants.CUSTOM_AUTHENTICATOR_NAMESPACE,
I18nConstants.POLICY_ADMINISTRATION_NAMESPACE,
I18nConstants.REMOTE_USER_STORES_NAMESPACE,
I18nConstants.RULES_NAMESPACE,
I18nConstants.PUSH_PROVIDERS_NAMESPACE,
I18nConstants.EXTERNAL_API_AUTHENTICATION_NAMESPACE,
I18nConstants.WEBHOOKS_NAMESPACE,
I18nConstants.APPROVAL_WORKFLOWS_NAMESPACE,
I18nConstants.AGENTS_NAMESPACE,
I18nConstants.FLOWS_NAMESPACE,
I18nConstants.COMMON_USERS_NAMESPACE,
I18nConstants.VERIFIABLE_CREDENTIALS_NAMESPACE,
I18nConstants.CUSTOMER_DATA_SERVICE_NAMESPACE
],
preload: []
};
}
/**
* Get i18n module config.
*
* @param metaFile - Meta file.
* @returns i18n config object.
*/
public static getI18nConfig(metaFile?: SupportedLanguagesMeta): I18nModuleOptionsInterface {
return {
initOptions: this.generateModuleInitOptions(metaFile),
langAutoDetectEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.i18nConfigs?.langAutoDetectEnabled
?? I18nConstants.LANG_AUTO_DETECT_ENABLED,
namespaceDirectories: I18nConstants.BUNDLE_NAMESPACE_DIRECTORIES,
overrideOptions: I18nConstants.INIT_OPTIONS_OVERRIDE,
resourceExtensionsPath: "/extensions/i18n",
resourcePath: "/resources/i18n",
xhrBackendPluginEnabled: I18nConstants.XHR_BACKEND_PLUGIN_ENABLED
};
}
/**
* Get the the list of service resource endpoints.
*
* @returns Service resource endpoints as an object.
*/
public static getServiceResourceEndpoints(): ServiceResourceEndpointsInterface {
return {
...getAPIResourceEndpoints(this.resolveServerHost()),
...getAdministratorsResourceEndpoints(this.resolveServerHost()),
...getApplicationsResourceEndpoints(this.resolveServerHost()),
...getApprovalsResourceEndpoints(this.resolveServerHostFromConfig()),
...getBrandingResourceEndpoints(this.resolveServerHost()),
...getClaimResourceEndpoints(this.resolveServerHostFromConfig(), this.resolveServerHost()),
...getCertificatesResourceEndpoints(this.resolveServerHostFromConfig()),
...getIDVPResourceEndpoints(this.resolveServerHost()),
...getEmailTemplatesResourceEndpoints(this.resolveServerHost()),
...getConnectionResourceEndpoints(this.resolveServerHost()),
...getRolesResourceEndpoints(this.resolveServerHost(), this.resolveServerHostFromConfig()),
...getServerConfigurationsResourceEndpoints(this.resolveServerHost()),
...getUsersResourceEndpoints(this.resolveServerHost()),
...getUserstoreResourceEndpoints(this.resolveServerHost()),
...getScopesResourceEndpoints(this.resolveServerHostFromConfig()),
...getGroupsResourceEndpoints(this.resolveServerHost()),
...getValidationServiceEndpoints(this.resolveServerHost()),
...getRemoteFetchConfigResourceEndpoints(this.resolveServerHostFromConfig()),
...getSecretsManagementEndpoints(this.resolveServerHostFromConfig()),
...getExtendedFeatureResourceEndpoints(this.resolveServerHost(), this.getDeploymentConfig()),
...getOrganizationsResourceEndpoints(this.resolveServerHost(true), this.resolveServerHostFromConfig()),
...getTenantResourceEndpoints(this.getDeploymentConfig().serverOrigin),
...getFeatureGateResourceEndpoints(this.resolveServerHostforFG(false)),
...getInsightsResourceEndpoints(this.resolveServerHostFromConfig()),
...getExtensionTemplatesEndpoints(this.resolveServerHost()),
...getApplicationTemplatesResourcesEndpoints(this.resolveServerHost()),
...getActionsResourceEndpoints(this.resolveServerHost()),
...getRulesEndpoints(this.resolveServerHost()),
...getSmsTemplateResourceEndpoints(this.resolveServerHost()),
...getPolicyAdministrationResourceEndpoints(this.resolveServerHost()),
...getPushProviderResourceEndpoints(this.resolveServerHost()),
...getPushProviderTemplateEndpoints(this.resolveServerHost()),
...getRemoteLoggingEndpoints(this.resolveServerHost()),
...getWorkflowsResourceEndpoints(this.resolveServerHost()),
...getWorkflowAssociationsResourceEndpoints(this.resolveServerHost()),
...getWorkflowRequestsResourceEndpoints(this.resolveServerHost()),
...getRegistrationFlowBuilderResourceEndpoints(this.resolveServerHost()),
...getPasswordRecoveryFlowBuilderResourceEndpoints(this.resolveServerHost()),
...getAskPasswordFlowBuilderResourceEndpoints(this.resolveServerHost()),
...getFlowsResourceEndpoints(this.resolveServerHost()),
...getWebhooksResourceEndpoints(this.resolveServerHost()),
...getAgentsResourceEndpoints(this.resolveServerHost()),
...getFlowBuilderCoreResourceEndpoints(this.resolveServerHost()),
...getVCTemplateEndpoints(this.resolveServerHost()),
...getCustomerDataServiceEndpoints(this.resolveServerHost()),
...getCompatibilitySettingsResourceEndpoints(this.resolveServerHost(true)),
CORSOrigins: `${ this.resolveServerHostFromConfig() }/api/server/v1/cors/origins`,
asyncStatus: `${ this.resolveServerHost(false, true) }/api/server/v1/async-operations`,
copilot: `${ this.resolveServerHost(false, true) }/api/server/v1/copilot`,
// TODO: Remove this endpoint and use ID token to get the details
me: `${ this.getDeploymentConfig()?.serverHost }/scim2/Me`,
saml2Meta: `${ this.resolveServerHost(false, true) }/identity/metadata/saml2`,
wellKnown: `${ this.resolveTenantedServerHost(true) }/oauth2/token/.well-known/openid-configuration`
};
}
/**
* Get a list of languages that can be translated in the UI.
* @remarks Currently, the Console only supports English.
* Tracker: https://github.com/wso2/product-is/issues/24778
*
* @returns List of translatable UI languages.
*/
public static getAppSupportedLocales(): string[] {
return [ I18nModuleConstants.DEFAULT_FALLBACK_LANGUAGE ];
}
/**
* Get UI config.
*
* @returns UI config object.
*/
public static getUIConfig(): UIConfigInterface {
return {
actions: window[ "AppUtils" ]?.getConfig()?.ui?.actions,
adminNotice: {
enabled: window[ "AppUtils" ]?.getConfig()?.ui?.adminNotice?.enabled,
plannedRollOutDate: window[ "AppUtils" ]?.getConfig()?.ui?.adminNotice?.plannedRollOutDate
},
administratorRoleDisplayName: window[ "AppUtils" ]?.getConfig()?.ui?.administratorRoleDisplayName ??
UIConstants.ADMINISTRATOR_ROLE_DISPLAY_NAME,
announcements: window[ "AppUtils" ]?.getConfig()?.ui?.announcements,
appCopyright: window[ "AppUtils" ]?.getConfig()?.ui?.appCopyright
.replace("${copyright}", "\u00A9")
.replace("${year}", new Date().getFullYear()),
appLogo: {
defaultLogoPath: window[ "AppUtils" ]?.getConfig()?.ui?.appLogo?.defaultLogoPath
?? window[ "AppUtils" ]?.getConfig()?.ui?.appLogoPath,
defaultWhiteLogoPath: window[ "AppUtils" ]?.getConfig()?.ui?.appLogo?.defaultWhiteLogoPath
?? window[ "AppUtils" ]?.getConfig()?.ui?.appWhiteLogoPath
},
appName: window[ "AppUtils" ]?.getConfig()?.ui?.appName,
appTitle: window[ "AppUtils" ]?.getConfig()?.ui?.appTitle,
applicationTemplateLoadingStrategy:
window[ "AppUtils" ]?.getConfig()?.ui?.applicationTemplateLoadingStrategy,
asyncOperationStatusPollingInterval:
window[ "AppUtils" ]?.getConfig()?.ui?.asyncOperationStatusPollingInterval,
connectionResourcesUrl: window[ "AppUtils" ]?.getConfig()?.ui?.connectionResourcesUrl,
cookiePolicyUrl: window[ "AppUtils" ]?.getConfig()?.ui?.cookiePolicyUrl,
customContent: window[ "AppUtils" ]?.getConfig()?.ui?.customContent ??
UIConstants.DEFAULT_CUSTOM_CONTENT_CONFIGS,
disableEmailTemplateForFreeTier: window[ "AppUtils" ]?.getConfig()?.ui?.disableEmailTemplateForFreeTier,
emailTemplates: {
defaultLogoUrl: window[ "AppUtils" ]?.getConfig()?.ui?.emailTemplates?.defaultLogoUrl,
defaultWhiteLogoUrl: window[ "AppUtils" ]?.getConfig()?.ui?.emailTemplates?.defaultWhiteLogoUrl
},
enableBlockingOutboundProvisioning:
window["AppUtils"]?.getConfig()?.ui?.enableBlockingOutboundProvisioning,
enableCustomEmailTemplates: window[ "AppUtils" ]?.getConfig()?.ui?.enableCustomEmailTemplates,
enableCustomSmsTemplates: window[ "AppUtils" ]?.getConfig()?.ui?.enableCustomSmsTemplates,
enableEmailDomain: window[ "AppUtils" ]?.getConfig()?.ui?.enableEmailDomain ?? false,
enableIdentityClaims: window[ "AppUtils" ]?.getConfig()?.ui?.enableIdentityClaims ?? true,
enableLegacyLocaleDropdown: window[ "AppUtils" ]?.getConfig()?.ui?.enableLegacyLocaleDropdown ?? false,
enableLegacySessionBoundTokenBehaviour:
window[ "AppUtils" ]?.getConfig()?.ui?.enableLegacySessionBoundTokenBehaviour ?? true,
enableOldUIForEmailProvider: window[ "AppUtils" ]?.getConfig()?.ui?.enableOldUIForEmailProvider,
enabledFeatureOverridesInConsoleRolePermissions:
window[ "AppUtils" ]?.getConfig()?.ui?.enabledFeatureOverridesInConsoleRolePermissions,
features: window[ "AppUtils" ]?.getConfig()?.ui?.features,
flowExecution: {
enableLegacyFlows:
window[ "AppUtils" ]?.getConfig()?.ui?.flowExecution?.enableLegacyFlows ?? true,
enableLegacyInvitedUserRegistrationFlow:
window[ "AppUtils" ]?.getConfig()?.ui?.flowExecution?.enableLegacyInvitedUserRegistrationFlow
?? window[ "AppUtils" ]?.getConfig()?.ui?.flowExecution?.enableLegacyFlows
?? true,
enableLegacyPasswordRecoveryFlow:
window[ "AppUtils" ]?.getConfig()?.ui?.flowExecution?.enableLegacyPasswordRecoveryFlow
?? window[ "AppUtils" ]?.getConfig()?.ui?.flowExecution?.enableLegacyFlows
?? true,
enableLegacySelfRegistrationFlow:
window[ "AppUtils" ]?.getConfig()?.ui?.flowExecution?.enableLegacySelfRegistrationFlow
?? window[ "AppUtils" ]?.getConfig()?.ui?.flowExecution?.enableLegacyFlows
?? true
},
googleOneTapEnabledTenants: window["AppUtils"]?.getConfig()?.ui?.googleOneTapEnabledTenants,
governanceConnectors: window["AppUtils"]?.getConfig()?.ui?.governanceConnectors,
gravatarConfig: window[ "AppUtils" ]?.getConfig()?.ui?.gravatarConfig,
hiddenApplicationTemplates: window[ "AppUtils" ]?.getConfig()?.ui?.hiddenApplicationTemplates ?? [],
hiddenAuthenticators: window[ "AppUtils" ]?.getConfig()?.ui?.hiddenAuthenticators,
hiddenConnectionTemplates: window[ "AppUtils" ]?.getConfig()?.ui?.hiddenConnectionTemplates,
hiddenOutboundProvisioningConnectors:
window[ "AppUtils" ]?.getConfig()?.ui?.hiddenOutboundProvisioningConnectors ?? [],
hiddenUserStores: window[ "AppUtils" ]?.getConfig()?.ui?.hiddenUserStores,
httpEmailProviderBodyMaxLength: window[ "AppUtils" ]?.getConfig()?.ui?.httpEmailProviderBodyMaxLength,
httpEmailProviderScopesMaxLength: window[ "AppUtils" ]?.getConfig()?.ui?.httpEmailProviderScopesMaxLength,
i18nConfigs: window[ "AppUtils" ]?.getConfig()?.ui?.i18nConfigs,
identityProviderTemplates: window[ "AppUtils" ]?.getConfig()?.ui?.identityProviderTemplates,
isClaimUniquenessValidationEnabled:
window[ "AppUtils" ]?.getConfig()?.ui?.isClaimUniquenessValidationEnabled ?? false,
isClientSecretHashEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isClientSecretHashEnabled,
isCookieConsentBannerEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isCookieConsentBannerEnabled,
isCustomClaimMappingEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isCustomClaimMappingEnabled,
isCustomClaimMappingMergeEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isCustomClaimMappingMergeEnabled,
isDefaultDialectEditingEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isDefaultDialectEditingEnabled,
isDialectAddingEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isDialectAddingEnabled,
isEditingSystemRolesAllowed: window[ "AppUtils" ]?.getConfig()?.ui?.isEditingSystemRolesAllowed,
isEnhancedOrganizationAuthenticationFeatureEnabled:
window[ "AppUtils" ]?.getConfig()?.ui?.isEnhancedOrganizationAuthenticationFeatureEnabled ?? false,
isFeatureGateEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isFeatureGateEnabled,
isGroupAndRoleSeparationEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isGroupAndRoleSeparationEnabled,
isHeaderAvatarLabelAllowed: window[ "AppUtils" ]?.getConfig()?.ui?.isHeaderAvatarLabelAllowed,
isLeftNavigationCategorized: window[ "AppUtils" ]?.getConfig()?.ui?.isLeftNavigationCategorized,
isMarketingConsentBannerEnabled: window["AppUtils"]?.getConfig()?.ui?.isMarketingConsentBannerEnabled,
isMultipleEmailsAndMobileNumbersEnabled:
window["AppUtils"]?.getConfig()?.ui?.isMultipleEmailsAndMobileNumbersEnabled,
isPasswordInputValidationEnabled: window["AppUtils"]?.getConfig()?.ui?.isPasswordInputValidationEnabled,
isPasswordResetEnforcementScopeEnabled:
window["AppUtils"]?.getConfig()?.ui?.isPasswordResetEnforcementScopeEnabled ?? false,
isRequestPathAuthenticationEnabled:
window[ "AppUtils" ]?.getConfig()?.ui?.isRequestPathAuthenticationEnabled,
isSAASDeployment: window[ "AppUtils" ]?.getConfig()?.ui?.isSAASDeployment,
isSignatureValidationCertificateAliasEnabled:
window[ "AppUtils" ]?.getConfig()?.ui?.isSignatureValidationCertificateAliasEnabled,
isTrustedAppConsentRequired: window[ "AppUtils" ]?.getConfig()?.ui?.isTrustedAppConsentRequired ?? false,
isWSFedProtocolTemplateEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isWSFedProtocolTemplateEnabled,
isXacmlConnectorEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isXacmlConnectorEnabled,
legacyMode: window[ "AppUtils" ]?.getConfig()?.ui?.legacyMode,
listAllAttributeDialects: window[ "AppUtils" ]?.getConfig()?.ui?.listAllAttributeDialects,
multiTenancy: window[ "AppUtils" ]?.getConfig()?.ui?.multiTenancy,
passwordPolicyConfigs: window[ "AppUtils" ]?.getConfig()?.ui?.passwordPolicyConfigs,
primaryUserStoreDomainName: window[ "AppUtils" ]?.getConfig()?.ui?.primaryUserStoreDomainName?.toUpperCase()
?? PRIMARY_USERSTORE,
privacyPolicyConfigs: window[ "AppUtils" ]?.getConfig()?.ui?.privacyPolicyConfigs,
privacyPolicyUrl: window[ "AppUtils" ]?.getConfig()?.ui?.privacyPolicyUrl,
productName: window[ "AppUtils" ]?.getConfig()?.ui?.productName,
productVersionConfig: window[ "AppUtils" ]?.getConfig()?.ui?.productVersionConfig,
routes: window[ "AppUtils" ]?.getConfig()?.ui?.routes ?? {
organizationEnabledRoutes: AppConstants.ORGANIZATION_ENABLED_ROUTES
},
selfAppIdentifier: window[ "AppUtils" ]?.getConfig()?.ui?.selfAppIdentifier,
showAppSwitchButton: window[ "AppUtils" ]?.getConfig()?.ui?.showAppSwitchButton,
showDocLinks: window[ "AppUtils" ]?.getConfig()?.ui?.showDocLinks ?? false,
showStatusLabelForNewAuthzRuntimeFeatures:
window[ "AppUtils" ]?.getConfig()?.ui?.showStatusLabelForNewAuthzRuntimeFeatures,
systemAppsIdentifiers: window[ "AppUtils" ]?.getConfig()?.ui?.systemAppsIdentifiers,
systemReservedUserStores: window[ "AppUtils" ]?.getConfig()?.ui?.systemReservedUserStores,
termsOfUseUrl: window[ "AppUtils" ]?.getConfig()?.ui?.termsOfUseURL,
theme: window[ "AppUtils" ]?.getConfig()?.ui?.theme,
useRoleClaimAsGroupClaim: window[ "AppUtils" ]?.getConfig()?.ui?.useRoleClaimAsGroupClaim,
userSchemaURI: window[ "AppUtils" ]?.getConfig()?.ui?.customUserSchemaURI
?? ClaimManagementConstants.DEFAULT_SCIM2_CUSTOM_USER_SCHEMA_URI,
userSurveyBanner: window[ "AppUtils" ]?.getConfig()?.ui?.userSurveyBanner
};
}
}