@frontegg/rest-api 6.0.1-alpha.4 → 7.28.0-alpha.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/BaseApiClient.d.ts +16 -0
- package/BaseApiClient.js +30 -0
- package/ContextHolder/index.d.ts +160 -0
- package/ContextHolder/index.js +278 -0
- package/ContextHolder/package.json +6 -0
- package/FetchClient.d.ts +42 -0
- package/FetchClient.js +260 -0
- package/account-settings/index.d.ts +21 -7
- package/account-settings/index.js +25 -6
- package/account-settings/interfaces.d.ts +9 -2
- package/applications/index.d.ts +51 -0
- package/applications/index.js +55 -0
- package/applications/interfaces.d.ts +49 -0
- package/applications/interfaces.js +5 -0
- package/applications/package.json +6 -0
- package/audits/index.d.ts +27 -15
- package/audits/index.js +29 -16
- package/audits/interfaces.d.ts +3 -2
- package/auth/constants.d.ts +5 -0
- package/auth/constants.js +5 -0
- package/auth/enums.d.ts +8 -1
- package/auth/enums.js +9 -4
- package/auth/index.d.ts +833 -428
- package/auth/index.js +768 -385
- package/auth/interfaces.d.ts +341 -39
- package/auth/interfaces.js +19 -9
- package/auth/secutiry-poilicy/index.d.ts +60 -41
- package/auth/secutiry-poilicy/index.js +99 -45
- package/auth/secutiry-poilicy/interfaces.d.ts +62 -2
- package/auth/secutiry-poilicy/interfaces.js +5 -1
- package/auth/utils.d.ts +10 -0
- package/auth/utils.js +35 -0
- package/connectivity/index.d.ts +126 -27
- package/connectivity/index.js +120 -114
- package/constants.d.ts +115 -0
- package/constants.js +122 -5
- package/directory/index.d.ts +32 -0
- package/directory/index.js +30 -0
- package/directory/interfaces.d.ts +30 -0
- package/directory/interfaces.js +7 -0
- package/directory/package.json +6 -0
- package/entitlements/index.d.ts +15 -0
- package/entitlements/index.js +20 -0
- package/entitlements/interfaces.d.ts +13 -0
- package/entitlements/interfaces.js +11 -0
- package/entitlements/package.json +6 -0
- package/error.js +0 -2
- package/feature-flags/index.d.ts +18 -0
- package/feature-flags/index.js +44 -0
- package/feature-flags/interfaces.d.ts +5 -0
- package/feature-flags/interfaces.js +1 -0
- package/feature-flags/package.json +6 -0
- package/groups/enums.d.ts +9 -0
- package/groups/enums.js +11 -0
- package/groups/index.d.ts +73 -0
- package/groups/index.js +62 -0
- package/groups/interfaces.d.ts +64 -0
- package/groups/interfaces.js +1 -0
- package/groups/package.json +6 -0
- package/impersonate/index.d.ts +17 -0
- package/impersonate/index.js +23 -0
- package/impersonate/interfaces.d.ts +12 -0
- package/impersonate/interfaces.js +1 -0
- package/impersonate/package.json +6 -0
- package/index.d.ts +148 -53
- package/index.js +103 -31
- package/interfaces.d.ts +82 -1
- package/interfaces.js +28 -1
- package/jwt.js +19 -20
- package/metadata/index.d.ts +68 -5
- package/metadata/index.js +53 -23
- package/metadata/interfaces.d.ts +10 -2
- package/node/BaseApiClient.js +37 -0
- package/node/ContextHolder/index.js +286 -0
- package/node/FetchClient.js +268 -0
- package/node/account-settings/index.js +26 -11
- package/node/applications/index.js +62 -0
- package/node/applications/interfaces.js +12 -0
- package/node/audits/index.js +32 -27
- package/node/auth/constants.js +13 -0
- package/node/auth/enums.js +11 -5
- package/node/auth/index.js +807 -644
- package/node/auth/interfaces.js +27 -13
- package/node/auth/secutiry-poilicy/index.js +100 -66
- package/node/auth/secutiry-poilicy/interfaces.js +8 -1
- package/node/auth/utils.js +44 -0
- package/node/connectivity/index.js +123 -197
- package/node/constants.js +124 -6
- package/node/directory/index.js +37 -0
- package/node/directory/interfaces.js +14 -0
- package/node/entitlements/index.js +27 -0
- package/node/entitlements/interfaces.js +18 -0
- package/node/error.js +0 -4
- package/node/feature-flags/index.js +54 -0
- package/node/feature-flags/interfaces.js +5 -0
- package/node/groups/enums.js +19 -0
- package/node/groups/index.js +70 -0
- package/node/groups/interfaces.js +5 -0
- package/node/impersonate/index.js +29 -0
- package/node/impersonate/interfaces.js +5 -0
- package/node/index.js +324 -94
- package/node/interfaces.js +34 -1
- package/node/jwt.js +19 -25
- package/node/metadata/index.js +57 -38
- package/node/notifications/index.js +34 -31
- package/node/reports/index.js +79 -83
- package/node/roles/index.js +55 -60
- package/node/roles/interfaces.js +9 -1
- package/node/routers.js +52 -6
- package/node/security-center/index.js +26 -0
- package/node/security-center/interfaces.js +74 -0
- package/node/sub-tenants/index.js +82 -29
- package/node/sub-tenants/interfaces.js +9 -1
- package/node/subscriptions/enums.js +13 -9
- package/node/subscriptions/index.js +64 -109
- package/node/subscriptions/interfaces.js +0 -2
- package/node/subscriptions/invoices.js +20 -21
- package/node/subscriptions/managedSubscriptions.js +28 -33
- package/node/subscriptions/paymentMethods.js +23 -27
- package/node/subscriptions/paymentProviders.js +11 -8
- package/node/subscriptions/plans.js +13 -12
- package/node/subscriptions/providers/stripe/index.js +22 -27
- package/node/subscriptions/subscriptions.js +28 -33
- package/node/subscriptions/summaries.js +11 -8
- package/node/subscriptions/tenantConfiguration.js +13 -12
- package/node/subscriptions/vendorPublicConfigurations.js +17 -0
- package/node/teams/index.js +108 -121
- package/node/teams/interfaces.js +8 -1
- package/node/tenants/index.js +63 -21
- package/node/tenants/interfaces.js +18 -1
- package/node/user-phone-numbers/index.js +38 -0
- package/node/user-phone-numbers/interfaces.js +5 -0
- package/node/users/index.js +64 -0
- package/node/users/interfaces.js +27 -0
- package/node/velo/index.js +75 -0
- package/node/velo/interfaces.js +5 -0
- package/node/vendor/index.js +16 -8
- package/notifications/index.d.ts +22 -16
- package/notifications/index.js +33 -22
- package/package.json +4 -2
- package/reports/index.d.ts +50 -44
- package/reports/index.js +77 -68
- package/reports/interfaces.d.ts +2 -2
- package/roles/index.d.ts +45 -34
- package/roles/index.js +52 -41
- package/roles/interfaces.d.ts +25 -9
- package/roles/interfaces.js +6 -1
- package/routers.d.ts +6 -1
- package/routers.js +45 -2
- package/security-center/index.d.ts +15 -0
- package/security-center/index.js +19 -0
- package/security-center/interfaces.d.ts +115 -0
- package/security-center/interfaces.js +63 -0
- package/security-center/package.json +6 -0
- package/sub-tenants/index.d.ts +57 -8
- package/sub-tenants/index.js +84 -19
- package/sub-tenants/interfaces.d.ts +68 -10
- package/sub-tenants/interfaces.js +6 -1
- package/subscriptions/enums.d.ts +7 -0
- package/subscriptions/enums.js +10 -8
- package/subscriptions/index.d.ts +55 -9
- package/subscriptions/index.js +56 -9
- package/subscriptions/interfaces.d.ts +7 -3
- package/subscriptions/interfaces.js +1 -1
- package/subscriptions/invoices.d.ts +16 -13
- package/subscriptions/invoices.js +19 -14
- package/subscriptions/managedSubscriptions.d.ts +18 -15
- package/subscriptions/managedSubscriptions.js +27 -22
- package/subscriptions/paymentMethods.d.ts +16 -13
- package/subscriptions/paymentMethods.js +22 -18
- package/subscriptions/paymentProviders.d.ts +8 -5
- package/subscriptions/paymentProviders.js +9 -4
- package/subscriptions/plans.d.ts +11 -8
- package/subscriptions/plans.js +11 -6
- package/subscriptions/providers/stripe/index.d.ts +24 -21
- package/subscriptions/providers/stripe/index.js +21 -16
- package/subscriptions/subscriptions.d.ts +24 -21
- package/subscriptions/subscriptions.js +27 -22
- package/subscriptions/summaries.d.ts +7 -4
- package/subscriptions/summaries.js +8 -3
- package/subscriptions/tenantConfiguration.d.ts +6 -3
- package/subscriptions/tenantConfiguration.js +12 -7
- package/subscriptions/vendorPublicConfigurations.d.ts +5 -0
- package/subscriptions/vendorPublicConfigurations.js +10 -0
- package/teams/index.d.ts +38 -115
- package/teams/index.js +105 -79
- package/teams/interfaces.d.ts +47 -42
- package/teams/interfaces.js +5 -1
- package/tenants/index.d.ts +25 -26
- package/tenants/index.js +61 -12
- package/tenants/interfaces.d.ts +85 -0
- package/tenants/interfaces.js +14 -1
- package/user-phone-numbers/index.d.ts +32 -0
- package/user-phone-numbers/index.js +31 -0
- package/user-phone-numbers/interfaces.d.ts +32 -0
- package/user-phone-numbers/interfaces.js +1 -0
- package/user-phone-numbers/package.json +6 -0
- package/users/index.d.ts +24 -0
- package/users/index.js +55 -0
- package/users/interfaces.d.ts +144 -0
- package/users/interfaces.js +18 -0
- package/users/package.json +6 -0
- package/velo/index.d.ts +46 -0
- package/velo/index.js +68 -0
- package/velo/interfaces.d.ts +108 -0
- package/velo/interfaces.js +1 -0
- package/velo/package.json +6 -0
- package/vendor/index.d.ts +12 -6
- package/vendor/index.js +15 -4
- package/ContextHolder.d.ts +0 -29
- package/ContextHolder.js +0 -80
- package/fetch.d.ts +0 -19
- package/fetch.js +0 -203
- package/node/ContextHolder.js +0 -90
- package/node/fetch.js +0 -234
- package/node/subscriptions/providers/index.js +0 -18
- package/subscriptions/providers/index.d.ts +0 -1
- package/subscriptions/providers/index.js +0 -1
|
@@ -1,41 +1,60 @@
|
|
|
1
|
-
import { ISaveSecurityPolicyMfa, ISaveSecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyLockout, ISecurityPolicyCaptcha, ISecurityPolicyPasswordHistory, ISaveSecurityPolicyPasswordHistory, ISecurityPolicyPasswordConfig, ISecurityPolicy } from './interfaces';
|
|
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
|
-
|
|
1
|
+
import { ISaveSecurityPolicyMfa, ISaveSecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyLockout, ISecurityPolicyCaptcha, ISecurityPolicyPasswordHistory, ISaveSecurityPolicyPasswordHistory, ISecurityPolicyPasswordConfig, ISecurityPolicy, DomainRestriction, DomainRestrictionConfig, CreateDomainRestriction, UpdateDomainRestrictionsConfig, IpRestriction, IPRestrictionsConfig, BulkCreateIpRestriction, CreateIpRestriction, GetIPRestrictionsParams, IPValidResponse } from './interfaces';
|
|
2
|
+
import { FronteggPaginationResult } from '../../interfaces';
|
|
3
|
+
import { BaseApiClient } from '../../BaseApiClient';
|
|
4
|
+
export declare class SecurityPolicyApi extends BaseApiClient {
|
|
5
|
+
constructor(appName: string);
|
|
6
|
+
/** Get global secure access configuration */
|
|
7
|
+
getGlobalSecurityPolicy: () => Promise<ISecurityPolicy>;
|
|
8
|
+
/** Get Mfa configuration from security policy */
|
|
9
|
+
getMfaPolicy: () => Promise<ISecurityPolicyMfa>;
|
|
10
|
+
/** Get Vendor Mfa configuration from security policy */
|
|
11
|
+
getVendorMfaPolicy: () => Promise<ISecurityPolicyMfa>;
|
|
12
|
+
/** Create/Update Mfa configuration from security policy */
|
|
13
|
+
saveMfaPolicy: (body: ISaveSecurityPolicyMfa) => Promise<ISecurityPolicyMfa>;
|
|
14
|
+
/** Get Lockout configuration from security policy */
|
|
15
|
+
getLockoutPolicy: () => Promise<ISecurityPolicyLockout>;
|
|
16
|
+
/** Get Vendor Lockout configuration from security policy */
|
|
17
|
+
getVendorLockoutPolicy: () => Promise<ISecurityPolicyLockout>;
|
|
18
|
+
/** Create/Update Lockout configuration from security policy */
|
|
19
|
+
saveLockoutPolicy: (body: ISaveSecurityPolicyLockout) => Promise<ISecurityPolicyLockout>;
|
|
20
|
+
/** Get Captcha configuration from security policy */
|
|
21
|
+
getCaptchaPolicy: () => Promise<ISecurityPolicyCaptcha | null>;
|
|
22
|
+
/** Get Password History configuration from security policy */
|
|
23
|
+
getPasswordHistoryPolicy: () => Promise<ISecurityPolicyPasswordHistory>;
|
|
24
|
+
/** Get Vendor Password History configuration from security policy */
|
|
25
|
+
getVendorPasswordHistoryPolicy: () => Promise<ISecurityPolicyPasswordHistory>;
|
|
26
|
+
/** Create/Update Password History configuration from security policy */
|
|
27
|
+
savePasswordHistoryPolicy: (body: ISaveSecurityPolicyPasswordHistory) => Promise<ISecurityPolicyPasswordHistory>;
|
|
28
|
+
/** Load vendor password configuration */
|
|
29
|
+
getPasswordConfigPolicy: () => Promise<ISecurityPolicyPasswordConfig>;
|
|
30
|
+
/** Get domain restrictions for tenant */
|
|
31
|
+
getDomainRestrictions: () => Promise<{
|
|
32
|
+
items: DomainRestriction[];
|
|
33
|
+
}>;
|
|
34
|
+
/** Get domain restrictions config for tenant */
|
|
35
|
+
getDomainRestrictionsConfig: () => Promise<DomainRestrictionConfig>;
|
|
36
|
+
/** Create domain restriction for tenant */
|
|
37
|
+
createDomainRestriction: (body: CreateDomainRestriction) => Promise<DomainRestriction>;
|
|
38
|
+
/** Update domain restrictions config for tenant */
|
|
39
|
+
updateDomainRestrictionConfig: (body: UpdateDomainRestrictionsConfig) => Promise<DomainRestrictionConfig>;
|
|
40
|
+
/** Delete domain restriction for tenant by id */
|
|
41
|
+
deleteDomainRestriction: (id: string) => Promise<void>;
|
|
42
|
+
/** Get IP restrictions for tenant */
|
|
43
|
+
getIPRestrictions: (params: GetIPRestrictionsParams) => Promise<FronteggPaginationResult<IpRestriction[]>>;
|
|
44
|
+
/** Get IP restrictions config for tenant */
|
|
45
|
+
getIPRestrictionsConfig: () => Promise<IPRestrictionsConfig>;
|
|
46
|
+
/** Create IP restriction for tenant */
|
|
47
|
+
createIPRestriction: (body: CreateIpRestriction) => Promise<void>;
|
|
48
|
+
/** Create bulk IP restrictions for tenant */
|
|
49
|
+
bulkCreateIPRestriction: (body: BulkCreateIpRestriction) => Promise<void>;
|
|
50
|
+
/** Update IP restrictions config for tenant */
|
|
51
|
+
updateIPRestrictionConfig: (body: IPRestrictionsConfig) => Promise<void>;
|
|
52
|
+
/** Delete IP restriction for tenant by id */
|
|
53
|
+
deleteIPRestriction: (id: string) => Promise<void>;
|
|
54
|
+
/** Test current user IP restriction */
|
|
55
|
+
testCurrentIp: () => Promise<IPValidResponse>;
|
|
56
|
+
/** Test current user IP restriction is in allow list */
|
|
57
|
+
testCurrentIpInAllowList: () => Promise<IPValidResponse>;
|
|
58
|
+
}
|
|
59
|
+
declare const _default: SecurityPolicyApi;
|
|
60
|
+
export default _default;
|
|
@@ -1,48 +1,102 @@
|
|
|
1
|
-
import { Get, Patch, Post } from '../../fetch';
|
|
2
1
|
import { urls } from '../../constants';
|
|
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
|
-
|
|
2
|
+
import { BaseApiClient } from '../../BaseApiClient';
|
|
3
|
+
export class SecurityPolicyApi extends BaseApiClient {
|
|
4
|
+
constructor(appName) {
|
|
5
|
+
super(appName);
|
|
6
|
+
this.getGlobalSecurityPolicy = async () => {
|
|
7
|
+
return this.get(urls.identity.configurations.v1);
|
|
8
|
+
};
|
|
9
|
+
this.getMfaPolicy = async () => {
|
|
10
|
+
return this.get(`${urls.identity.configurations.v1}/mfa-policy`);
|
|
11
|
+
};
|
|
12
|
+
this.getVendorMfaPolicy = async () => {
|
|
13
|
+
return this.get(`${urls.identity.configurations.v1}/mfa-policy/vendor`);
|
|
14
|
+
};
|
|
15
|
+
this.saveMfaPolicy = async body => {
|
|
16
|
+
if (body.id) {
|
|
17
|
+
return this.patch(`${urls.identity.configurations.v1}/mfa-policy`, body);
|
|
18
|
+
} else {
|
|
19
|
+
return this.post(`${urls.identity.configurations.v1}/mfa-policy`, body);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.getLockoutPolicy = async () => {
|
|
23
|
+
return this.get(`${urls.identity.configurations.v1}/lockout-policy`);
|
|
24
|
+
};
|
|
25
|
+
this.getVendorLockoutPolicy = async () => {
|
|
26
|
+
return this.get(`${urls.identity.configurations.v1}/lockout-policy/vendor`);
|
|
27
|
+
};
|
|
28
|
+
this.saveLockoutPolicy = async body => {
|
|
29
|
+
if (body.id) {
|
|
30
|
+
return this.patch(`${urls.identity.configurations.v1}/lockout-policy`, body);
|
|
31
|
+
} else {
|
|
32
|
+
return this.post(`${urls.identity.configurations.v1}/lockout-policy`, body);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
this.getCaptchaPolicy = async () => {
|
|
36
|
+
try {
|
|
37
|
+
return await this.get(`${urls.identity.configurations.v1}/captcha-policy/public`);
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
this.getPasswordHistoryPolicy = async () => {
|
|
43
|
+
return this.get(`${urls.identity.configurations.v1}/password-history-policy`);
|
|
44
|
+
};
|
|
45
|
+
this.getVendorPasswordHistoryPolicy = async () => {
|
|
46
|
+
return this.get(`${urls.identity.configurations.v1}/password-history-policy/vendor`);
|
|
47
|
+
};
|
|
48
|
+
this.savePasswordHistoryPolicy = async body => {
|
|
49
|
+
if (body.id) {
|
|
50
|
+
return this.patch(`${urls.identity.configurations.v1}/password-history-policy`, body);
|
|
51
|
+
} else {
|
|
52
|
+
return this.post(`${urls.identity.configurations.v1}/password-history-policy`, body);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
this.getPasswordConfigPolicy = async () => {
|
|
56
|
+
return this.get(`${urls.identity.configurations.v1}/password`);
|
|
57
|
+
};
|
|
58
|
+
this.getDomainRestrictions = async () => {
|
|
59
|
+
return this.get(`${urls.identity.restrictions.emailDomain.v1}`);
|
|
60
|
+
};
|
|
61
|
+
this.getDomainRestrictionsConfig = async () => {
|
|
62
|
+
return this.get(`${urls.identity.restrictions.emailDomain.v1}/config`);
|
|
63
|
+
};
|
|
64
|
+
this.createDomainRestriction = async body => {
|
|
65
|
+
return this.post(`${urls.identity.restrictions.emailDomain.v1}`, body);
|
|
66
|
+
};
|
|
67
|
+
this.updateDomainRestrictionConfig = async body => {
|
|
68
|
+
return this.post(`${urls.identity.restrictions.emailDomain.v1}/config`, body);
|
|
69
|
+
};
|
|
70
|
+
this.deleteDomainRestriction = async id => {
|
|
71
|
+
return this.delete(`${urls.identity.restrictions.emailDomain.v1}/${id}`);
|
|
72
|
+
};
|
|
73
|
+
this.getIPRestrictions = async params => {
|
|
74
|
+
return this.get(`${urls.identity.restrictions.ip.v1}`, params);
|
|
75
|
+
};
|
|
76
|
+
this.getIPRestrictionsConfig = async () => {
|
|
77
|
+
return this.get(`${urls.identity.restrictions.ip.v1}/config`);
|
|
78
|
+
};
|
|
79
|
+
this.createIPRestriction = async body => {
|
|
80
|
+
return this.post(`${urls.identity.restrictions.ip.v1}`, body);
|
|
81
|
+
};
|
|
82
|
+
this.bulkCreateIPRestriction = async body => {
|
|
83
|
+
return this.post(`${urls.identity.restrictions.ip.v1}/bulk`, body);
|
|
84
|
+
};
|
|
85
|
+
this.updateIPRestrictionConfig = async body => {
|
|
86
|
+
return this.post(`${urls.identity.restrictions.ip.v1}/config`, body);
|
|
87
|
+
};
|
|
88
|
+
this.deleteIPRestriction = async id => {
|
|
89
|
+
return this.delete(`${urls.identity.restrictions.ip.v1}/${id}`);
|
|
90
|
+
};
|
|
91
|
+
this.testCurrentIp = async () => {
|
|
92
|
+
return this.post(`${urls.identity.restrictions.ip.v1}/verify`);
|
|
93
|
+
};
|
|
94
|
+
this.testCurrentIpInAllowList = async () => {
|
|
95
|
+
return this.post(`${urls.identity.restrictions.ip.v1}/verify/allow`);
|
|
96
|
+
};
|
|
44
97
|
}
|
|
98
|
+
|
|
99
|
+
/** Get global secure access configuration */
|
|
45
100
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
101
|
+
|
|
102
|
+
export default new SecurityPolicyApi('default');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EnforceMFAType = 'DontForce' | 'Force' | 'ForceExceptSAML';
|
|
2
2
|
export interface ISecurityPolicy {
|
|
3
3
|
id: string;
|
|
4
4
|
enforceMFAType?: EnforceMFAType;
|
|
@@ -67,4 +67,64 @@ export interface TestConfig {
|
|
|
67
67
|
minPhraseLength: number;
|
|
68
68
|
minOptionalTestsToPass: number;
|
|
69
69
|
}
|
|
70
|
-
export
|
|
70
|
+
export type ISecurityPolicyPasswordConfig = Partial<TestConfig>;
|
|
71
|
+
export declare enum RestrictionType {
|
|
72
|
+
ALLOW = "ALLOW",
|
|
73
|
+
BLOCK = "BLOCK"
|
|
74
|
+
}
|
|
75
|
+
export interface UpdateDomainRestrictionsConfig {
|
|
76
|
+
active: boolean;
|
|
77
|
+
blockPublicDomains?: boolean;
|
|
78
|
+
type?: RestrictionType;
|
|
79
|
+
}
|
|
80
|
+
export interface CreateDomainRestriction {
|
|
81
|
+
domain: string;
|
|
82
|
+
type: RestrictionType;
|
|
83
|
+
}
|
|
84
|
+
export interface DomainRestriction {
|
|
85
|
+
id: string;
|
|
86
|
+
domain: string;
|
|
87
|
+
type: RestrictionType;
|
|
88
|
+
}
|
|
89
|
+
export interface DomainRestrictionConfig {
|
|
90
|
+
active: boolean;
|
|
91
|
+
listType: RestrictionType;
|
|
92
|
+
blockPublicDomains: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface IPRestrictionsConfig {
|
|
95
|
+
isActive: boolean;
|
|
96
|
+
strategy?: RestrictionType;
|
|
97
|
+
}
|
|
98
|
+
export interface GetIPRestrictionsParams {
|
|
99
|
+
_offset: number;
|
|
100
|
+
_limit: number;
|
|
101
|
+
_filter: string;
|
|
102
|
+
}
|
|
103
|
+
export interface IPValidResponse {
|
|
104
|
+
valid: boolean;
|
|
105
|
+
}
|
|
106
|
+
export interface CreateIpRestriction {
|
|
107
|
+
ip: string;
|
|
108
|
+
strategy?: RestrictionType;
|
|
109
|
+
isActive?: boolean;
|
|
110
|
+
description?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface UpdateIpRestriction {
|
|
113
|
+
id: string;
|
|
114
|
+
ip: string;
|
|
115
|
+
strategy: RestrictionType;
|
|
116
|
+
isActive?: boolean;
|
|
117
|
+
description?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface BulkCreateIpRestriction {
|
|
120
|
+
ips: CreateIpRestriction[];
|
|
121
|
+
}
|
|
122
|
+
export interface IpRestriction {
|
|
123
|
+
id: string;
|
|
124
|
+
ip: string;
|
|
125
|
+
strategy: RestrictionType;
|
|
126
|
+
isActive: boolean;
|
|
127
|
+
description?: string;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
updatedAt: Date;
|
|
130
|
+
}
|
package/auth/utils.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GetCurrentUserTenantsResponse } from '../users/interfaces';
|
|
2
|
+
export interface ConditionalAction<T = any> {
|
|
3
|
+
action: () => Promise<T>;
|
|
4
|
+
shouldLoad: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function executeConditionalPromise({ shouldLoad, action }: ConditionalAction): Promise<any>;
|
|
7
|
+
export declare function setTabTenantInSessionStorage(tenantId: string): void;
|
|
8
|
+
export declare function removeTabTenantFromSessionStorage(): void;
|
|
9
|
+
export declare function getTabTenantFromSessionStorage(appName: string): string | null;
|
|
10
|
+
export declare function getCurrentUserTenantsFunction(appName: string): () => Promise<GetCurrentUserTenantsResponse>;
|
package/auth/utils.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ContextHolder } from '../ContextHolder';
|
|
2
|
+
import { USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF } from './constants';
|
|
3
|
+
import { FeatureFlags } from '../feature-flags';
|
|
4
|
+
import { UsersApi } from '../users';
|
|
5
|
+
import { FRONTEGG_SEPARATE_TABS_BY_TENANT } from './constants';
|
|
6
|
+
export async function executeConditionalPromise({
|
|
7
|
+
shouldLoad,
|
|
8
|
+
action
|
|
9
|
+
}) {
|
|
10
|
+
if (!shouldLoad) return;
|
|
11
|
+
return await action();
|
|
12
|
+
}
|
|
13
|
+
export function setTabTenantInSessionStorage(tenantId) {
|
|
14
|
+
if (!tenantId) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
sessionStorage.setItem(FRONTEGG_SEPARATE_TABS_BY_TENANT, tenantId);
|
|
18
|
+
}
|
|
19
|
+
export function removeTabTenantFromSessionStorage() {
|
|
20
|
+
sessionStorage.removeItem(FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
21
|
+
}
|
|
22
|
+
export function getTabTenantFromSessionStorage(appName) {
|
|
23
|
+
if (!ContextHolder.for(appName).isSessionPerTenantEnabled()) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return sessionStorage.getItem(FRONTEGG_SEPARATE_TABS_BY_TENANT);
|
|
27
|
+
}
|
|
28
|
+
export function getCurrentUserTenantsFunction(appName) {
|
|
29
|
+
const usersApi = new UsersApi(appName);
|
|
30
|
+
const [useCurrentUserTenantsV1] = FeatureFlags.getFeatureFlags([USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF], appName);
|
|
31
|
+
if (ContextHolder.for(appName).isSessionPerTenantEnabled()) {
|
|
32
|
+
return usersApi.getCurrentUserTenantsV1;
|
|
33
|
+
}
|
|
34
|
+
return useCurrentUserTenantsV1 ? usersApi.getCurrentUserTenantsV1 : usersApi.getCurrentUserTenantsV3;
|
|
35
|
+
}
|
package/connectivity/index.d.ts
CHANGED
|
@@ -1,27 +1,126 @@
|
|
|
1
|
-
import { IWebhookTest, IWebhooksSaveData, ISlackSubscription, IEmailSMSConfigResponse, IEmailSMSSubscriptionResponse } from './interfaces';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { IWebhookTest, IWebhooksSaveData, ISlackSubscription, IEmailSMSConfigResponse, IEmailSMSSubscriptionResponse, ISlackChannel, ISlackConfigurations, IWebhookLog, ICategory, IChannelsMap } from './interfaces';
|
|
2
|
+
import { BaseApiClient } from '../BaseApiClient';
|
|
3
|
+
export declare class ConnectivityApi extends BaseApiClient {
|
|
4
|
+
constructor(appName: string);
|
|
5
|
+
/** Get Slack configuration */
|
|
6
|
+
getSlackConfiguration: () => Promise<ISlackConfigurations>;
|
|
7
|
+
/** Get Slack scope */
|
|
8
|
+
getSlackScope: () => Promise<unknown>;
|
|
9
|
+
/** Get Slack channels */
|
|
10
|
+
getSlackChannels: () => Promise<ISlackChannel[] | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Post Slack configuration
|
|
13
|
+
* @param data Slack subscription data
|
|
14
|
+
*/
|
|
15
|
+
postSlackConfiguration: (data: ISlackSubscription) => Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Delete Slack configuration
|
|
18
|
+
* @param data Required Slack subscription data
|
|
19
|
+
*/
|
|
20
|
+
deleteSlackConfiguration: (data: Required<ISlackSubscription>) => Promise<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Post Slack code
|
|
23
|
+
* @param code Slack authorization code
|
|
24
|
+
*/
|
|
25
|
+
postSlackCode: (code: string) => Promise<unknown>;
|
|
26
|
+
/** Get email configuration */
|
|
27
|
+
getEmailConfiguration: () => Promise<IEmailSMSConfigResponse[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Post email configuration
|
|
30
|
+
* @param data Email configuration data
|
|
31
|
+
*/
|
|
32
|
+
postEmailConfiguration: ({ eventKey, ...data }: IEmailSMSConfigResponse) => Promise<null>;
|
|
33
|
+
/**
|
|
34
|
+
* Patch email configuration
|
|
35
|
+
* @param enabled Email configuration enabled status
|
|
36
|
+
* @param eventKey Email event key
|
|
37
|
+
*/
|
|
38
|
+
patchEmailConfiguration: ({ eventKey, enabled, }: Pick<IEmailSMSConfigResponse, "eventKey" | "enabled">) => Promise<null>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete email subscriptions
|
|
41
|
+
* @param eventKey Email event key
|
|
42
|
+
* @param subscriptionId Email subscription ID
|
|
43
|
+
*/
|
|
44
|
+
deleteEmailSubscriptions: (eventKey: string, subscriptionId: string) => Promise<null>;
|
|
45
|
+
/**
|
|
46
|
+
* Put email subscriptions
|
|
47
|
+
* @param subscriptionId Email subscription ID
|
|
48
|
+
* @param eventKey Email event key
|
|
49
|
+
* @param data Email subscription data
|
|
50
|
+
*/
|
|
51
|
+
putEmailSubscriptions: (subscriptionId: string, eventKey: string, data: IEmailSMSSubscriptionResponse) => Promise<null>;
|
|
52
|
+
/**
|
|
53
|
+
* Delete email configuration
|
|
54
|
+
* @param eventKey Email event key
|
|
55
|
+
*/
|
|
56
|
+
deleteEmailConfiguration: (eventKey: string) => Promise<null>;
|
|
57
|
+
/** Get SMS configuration */
|
|
58
|
+
getSMSConfiguration: () => Promise<IEmailSMSConfigResponse[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Post SMS configuration
|
|
61
|
+
* @param data SMS configuration data
|
|
62
|
+
*/
|
|
63
|
+
postSMSConfiguration: ({ eventKey, ...data }: IEmailSMSConfigResponse) => Promise<unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* Patch SMS configuration
|
|
66
|
+
* @param enabled SMS configuration enabled status
|
|
67
|
+
* @param eventKey SMS event key
|
|
68
|
+
*/
|
|
69
|
+
patchSMSConfiguration: ({ eventKey, enabled, }: Pick<IEmailSMSConfigResponse, "eventKey" | "enabled">) => Promise<null>;
|
|
70
|
+
/**
|
|
71
|
+
* Delete SMS subscriptions
|
|
72
|
+
* @param eventKey SMS event key
|
|
73
|
+
* @param subscriptionId SMS subscription ID
|
|
74
|
+
*/
|
|
75
|
+
deleteSMSSubscriptions: (eventKey: string, subscriptionId: string) => Promise<null>;
|
|
76
|
+
/**
|
|
77
|
+
* Put SMS subscriptions
|
|
78
|
+
* @param subscriptionId SMS subscription ID
|
|
79
|
+
* @param eventKey SMS event key
|
|
80
|
+
* @param data SMS subscription data
|
|
81
|
+
*/
|
|
82
|
+
putSMSSubscriptions: (subscriptionId: string, eventKey: string, data: IEmailSMSSubscriptionResponse) => Promise<null>;
|
|
83
|
+
/**
|
|
84
|
+
* Delete SMS configuration
|
|
85
|
+
* @param eventKey SMS event key
|
|
86
|
+
*/
|
|
87
|
+
deleteSMSConfiguration: (eventKey: string) => Promise<null>;
|
|
88
|
+
/** Get webhooks configurations */
|
|
89
|
+
getWebhooksConfigurations: () => Promise<unknown>;
|
|
90
|
+
/**
|
|
91
|
+
* Post webhooks configuration
|
|
92
|
+
* @param data Webhooks save data
|
|
93
|
+
*/
|
|
94
|
+
postWebhooksConfiguration: (data: IWebhooksSaveData) => Promise<unknown>;
|
|
95
|
+
/**
|
|
96
|
+
* Delete webhooks configuration
|
|
97
|
+
* @param id Webhook ID
|
|
98
|
+
*/
|
|
99
|
+
deleteWebhooksConfiguration: (id: string) => Promise<null>;
|
|
100
|
+
/**
|
|
101
|
+
* Get webhook log
|
|
102
|
+
* @param id Webhook ID
|
|
103
|
+
* @param offset Pagination offset
|
|
104
|
+
* @param limit Pagination limit
|
|
105
|
+
*/
|
|
106
|
+
getWebhookLog: (id: string, offset?: number, limit?: number) => Promise<unknown>;
|
|
107
|
+
/**
|
|
108
|
+
* Post webhook test
|
|
109
|
+
* @param data Webhook test data
|
|
110
|
+
*/
|
|
111
|
+
postWebhookTest: (data: IWebhookTest) => Promise<IWebhookLog>;
|
|
112
|
+
/**
|
|
113
|
+
* Post webhook retry
|
|
114
|
+
* @param id Webhook log ID
|
|
115
|
+
*/
|
|
116
|
+
postWebhookRetry: (id: string) => Promise<IWebhookLog>;
|
|
117
|
+
/** Get event categories */
|
|
118
|
+
getCategories: () => Promise<ICategory[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Get channel maps
|
|
121
|
+
* @param channels Channel names
|
|
122
|
+
*/
|
|
123
|
+
getChannelMaps: (channels: string) => Promise<IChannelsMap[]>;
|
|
124
|
+
}
|
|
125
|
+
declare const _default: ConnectivityApi;
|
|
126
|
+
export default _default;
|