@frontegg/redux-store 5.54.2 → 5.57.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/audits/index.js +1 -14
- package/auth/SecurityPolicyState/index.d.ts +46 -0
- package/auth/SecurityPolicyState/interfaces.d.ts +1 -0
- package/auth/dummy.d.ts +1 -0
- package/auth/index.d.ts +6 -0
- package/auth/index.js +60 -10
- package/auth/reducer.d.ts +6 -0
- package/node/audits/index.js +1 -14
- package/node/auth/index.js +1 -1
- package/node/{index-320f87c9.js → index-c7535125.js} +60 -10
- package/node/index.js +1 -1
- package/node/toolkit/index.js +1 -1
- package/package.json +2 -2
package/audits/index.js
CHANGED
|
@@ -53,19 +53,6 @@ const { reducer, actions: sliceActions } = createSlice({
|
|
|
53
53
|
});
|
|
54
54
|
const actions = Object.assign(Object.assign(Object.assign({}, sliceActions), actions$2), actions$1);
|
|
55
55
|
|
|
56
|
-
const dummyUsersData = [
|
|
57
|
-
{ user: 'Dianne Deck', email: 'dianne@frontegg.com' },
|
|
58
|
-
{ user: 'Betty Martin', email: 'betty@frontegg.com' },
|
|
59
|
-
{ user: 'Joann Schmidt', email: 'joann@frontegg.com' },
|
|
60
|
-
{ user: 'Kristine Bodnar', email: 'kristine@frontegg.com' },
|
|
61
|
-
{ user: 'Harold Marcus', email: 'harold@frontegg.com' },
|
|
62
|
-
{ user: 'Alice Williams', email: 'allice@frontegg.com' },
|
|
63
|
-
{ user: 'Beatrice Wilkinson', email: 'beatrice@frontegg.com' },
|
|
64
|
-
];
|
|
65
|
-
const randomUser = () => {
|
|
66
|
-
const random = Math.floor(Math.random() * dummyUsersData.length);
|
|
67
|
-
return dummyUsersData[random];
|
|
68
|
-
};
|
|
69
56
|
const sortMethodBasedOnOrder = (sortBy, desc) => (a, b) => {
|
|
70
57
|
if (a[sortBy] > b[sortBy]) {
|
|
71
58
|
return desc ? -1 : 1;
|
|
@@ -131,7 +118,7 @@ const randomAction = () => {
|
|
|
131
118
|
};
|
|
132
119
|
const auditLogsDataDemo = {
|
|
133
120
|
total: 20,
|
|
134
|
-
data: Array.from(Array(
|
|
121
|
+
data: Array.from(Array(5).keys()).map((i) => (Object.assign(Object.assign({ ip: '198.143.51.1', user: 'Demo User Name', email: 'demo-user@frontegg.com' }, randomAction()), { json: { key1: 'value1', key2: 'value2', key3: 'value3', key4: 'value4' }, tenantId: 'my-tenant-id', vendorId: 'my-vendor-id', userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36', createdAt: `2022-04-07 10:${50 - i}:40.201` }))),
|
|
135
122
|
};
|
|
136
123
|
const auditLogsMetadataDemo = {
|
|
137
124
|
properties: [
|
|
@@ -167,6 +167,49 @@ declare const reducers: {
|
|
|
167
167
|
loaderComponent?: any;
|
|
168
168
|
};
|
|
169
169
|
};
|
|
170
|
+
setSecurityPolicyVendorMfaState: {
|
|
171
|
+
prepare: (payload: Partial<import("../../interfaces").WithStatus & {
|
|
172
|
+
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
173
|
+
}>) => {
|
|
174
|
+
payload: Partial<import("../../interfaces").WithStatus & {
|
|
175
|
+
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
};
|
|
178
|
+
reducer: (state: import("..").AuthState, { payload }: {
|
|
179
|
+
payload: Partial<import("../../interfaces").WithStatus & {
|
|
180
|
+
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
181
|
+
}>;
|
|
182
|
+
type: string;
|
|
183
|
+
}) => {
|
|
184
|
+
onRedirectTo: (path: string, opts?: import("@frontegg/rest-api").RedirectOptions | undefined) => void;
|
|
185
|
+
error?: any;
|
|
186
|
+
isAuthenticated: boolean;
|
|
187
|
+
isLoading: boolean;
|
|
188
|
+
keepSessionAlive?: boolean | undefined;
|
|
189
|
+
user?: import("..").User | null | undefined;
|
|
190
|
+
isSSOAuth: boolean;
|
|
191
|
+
ssoACS?: string | undefined;
|
|
192
|
+
loginState: import("..").LoginState;
|
|
193
|
+
activateState: import("..").ActivateAccountState;
|
|
194
|
+
acceptInvitationState: import("..").AcceptInvitationState;
|
|
195
|
+
forgotPasswordState: import("..").ForgotPasswordState;
|
|
196
|
+
resetPhoneNumberState: import("..").ResetPhoneNumberState;
|
|
197
|
+
ssoState: import("..").SSOState;
|
|
198
|
+
profileState: import("..").ProfileState;
|
|
199
|
+
mfaState: import("..").MFAState;
|
|
200
|
+
teamState: import("..").TeamState;
|
|
201
|
+
socialLoginState: import("..").SocialLoginState;
|
|
202
|
+
signUpState: import("..").SignUpState;
|
|
203
|
+
apiTokensState: import("..").ApiTokensState;
|
|
204
|
+
securityPolicyState: SecurityPolicyState;
|
|
205
|
+
accountSettingsState: import("..").AccountSettingsState;
|
|
206
|
+
tenantsState: import("..").TenantsState;
|
|
207
|
+
rolesState: import("..").RolesState;
|
|
208
|
+
routes: import("..").AuthPageRoutes;
|
|
209
|
+
header?: any;
|
|
210
|
+
loaderComponent?: any;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
170
213
|
setSecurityPolicyLockoutState: {
|
|
171
214
|
prepare: (payload: Partial<import("../../interfaces").WithStatus & {
|
|
172
215
|
policy?: import("@frontegg/rest-api").ISecurityPolicyLockout | undefined;
|
|
@@ -373,6 +416,7 @@ declare const actions: {
|
|
|
373
416
|
loadSecurityPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
374
417
|
loadPublicSecurityPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
375
418
|
loadSecurityPolicyMfa: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
419
|
+
loadSecurityPolicyVendorMfa: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
376
420
|
saveSecurityPolicyMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyMfa, import("@frontegg/rest-api").ISecurityPolicyMfa>], import("../../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyMfa, import("@frontegg/rest-api").ISecurityPolicyMfa>, string, never, never>;
|
|
377
421
|
loadSecurityPolicyLockout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
378
422
|
saveSecurityPolicyLockout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyLockout, import("@frontegg/rest-api").ISecurityPolicyLockout>], import("../../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyLockout, import("@frontegg/rest-api").ISecurityPolicyLockout>, string, never, never>;
|
|
@@ -390,6 +434,7 @@ declare type DispatchedActions = {
|
|
|
390
434
|
setSecurityPolicyGlobalState: (state: Partial<GlobalPolicyState>) => void;
|
|
391
435
|
setSecurityPolicyPublicState: (state: Partial<PublicPolicyState>) => void;
|
|
392
436
|
setSecurityPolicyMfaState: (state: Partial<MfaPolicyState>) => void;
|
|
437
|
+
setSecurityPolicyVendorMfaState: (state: Partial<MfaPolicyState>) => void;
|
|
393
438
|
setSecurityPolicyLockoutState: (state: Partial<LockoutPolicyState>) => void;
|
|
394
439
|
setSecurityPolicyCaptchaState: (state: Partial<CaptchaPolicyState>) => void;
|
|
395
440
|
setSecurityPolicyPasswordHistoryState: (state: Partial<PasswordHistoryPolicyState>) => void;
|
|
@@ -399,6 +444,7 @@ declare type DispatchedActions = {
|
|
|
399
444
|
loadPublicSecurityPolicy: () => void;
|
|
400
445
|
loadVendorPasswordConfig: () => void;
|
|
401
446
|
loadSecurityPolicyMfa: () => void;
|
|
447
|
+
loadSecurityPolicyVendorMfa: () => void;
|
|
402
448
|
saveSecurityPolicyMfa: (payload: SaveSecurityPolicyMfaPayload) => void;
|
|
403
449
|
loadSecurityPolicyLockout: () => void;
|
|
404
450
|
saveSecurityPolicyLockout: (payload: SaveSecurityPolicyLockoutPayload) => void;
|
|
@@ -14,6 +14,7 @@ export interface SecurityPolicyState {
|
|
|
14
14
|
globalPolicy: GlobalPolicyState;
|
|
15
15
|
publicPolicy: PublicPolicyState;
|
|
16
16
|
mfaPolicy: MfaPolicyState;
|
|
17
|
+
vendorMfaPolicy: MfaPolicyState;
|
|
17
18
|
lockoutPolicy: LockoutPolicyState;
|
|
18
19
|
captchaPolicy: CaptchaPolicyState;
|
|
19
20
|
passwordHistoryPolicy: PasswordHistoryPolicyState;
|
package/auth/dummy.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const samlMetadataDemo: ISamlMetadata;
|
|
|
20
20
|
export declare const rolesDemo: ITeamUserRole[];
|
|
21
21
|
export declare const ssoStateDemo: SSOState;
|
|
22
22
|
export declare const permissionsDemo: ITeamUserPermission[];
|
|
23
|
+
export declare const userTeamDemo2: ITeamUser;
|
|
23
24
|
export declare const userTeamDemo: ITeamUser;
|
|
24
25
|
export declare const usersDemo: ITeamUser[];
|
|
25
26
|
export declare const tenantsDemo: ITenantsResponse[];
|
package/auth/index.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ declare const _default: {
|
|
|
74
74
|
loadSecurityPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
75
75
|
loadPublicSecurityPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
76
76
|
loadSecurityPolicyMfa: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
77
|
+
loadSecurityPolicyVendorMfa: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
77
78
|
saveSecurityPolicyMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyMfa, import("@frontegg/rest-api").ISecurityPolicyMfa>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyMfa, import("@frontegg/rest-api").ISecurityPolicyMfa>, string, never, never>;
|
|
78
79
|
loadSecurityPolicyLockout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
79
80
|
saveSecurityPolicyLockout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyLockout, import("@frontegg/rest-api").ISecurityPolicyLockout>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyLockout, import("@frontegg/rest-api").ISecurityPolicyLockout>, string, never, never>;
|
|
@@ -296,6 +297,11 @@ declare const _default: {
|
|
|
296
297
|
}>], Partial<import("../interfaces").WithStatus & {
|
|
297
298
|
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
298
299
|
}>, string, never, never>;
|
|
300
|
+
setSecurityPolicyVendorMfaState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("../interfaces").WithStatus & {
|
|
301
|
+
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
302
|
+
}>], Partial<import("../interfaces").WithStatus & {
|
|
303
|
+
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
304
|
+
}>, string, never, never>;
|
|
299
305
|
setSecurityPolicyLockoutState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("../interfaces").WithStatus & {
|
|
300
306
|
policy?: import("@frontegg/rest-api").ISecurityPolicyLockout | undefined;
|
|
301
307
|
}>], Partial<import("../interfaces").WithStatus & {
|
package/auth/index.js
CHANGED
|
@@ -402,6 +402,9 @@ const securityPolicyState = {
|
|
|
402
402
|
publicPolicy: {
|
|
403
403
|
loading: false,
|
|
404
404
|
},
|
|
405
|
+
vendorMfaPolicy: {
|
|
406
|
+
loading: true,
|
|
407
|
+
},
|
|
405
408
|
mfaPolicy: {
|
|
406
409
|
loading: true,
|
|
407
410
|
},
|
|
@@ -423,6 +426,7 @@ const reducers$3 = {
|
|
|
423
426
|
setSecurityPolicyGlobalState: typeReducerNestedKey('securityPolicyState', 'globalPolicy'),
|
|
424
427
|
setSecurityPolicyPublicState: typeReducerNestedKey('securityPolicyState', 'publicPolicy'),
|
|
425
428
|
setSecurityPolicyMfaState: typeReducerNestedKey('securityPolicyState', 'mfaPolicy'),
|
|
429
|
+
setSecurityPolicyVendorMfaState: typeReducerNestedKey('securityPolicyState', 'vendorMfaPolicy'),
|
|
426
430
|
setSecurityPolicyLockoutState: typeReducerNestedKey('securityPolicyState', 'lockoutPolicy'),
|
|
427
431
|
setSecurityPolicyCaptchaState: typeReducerNestedKey('securityPolicyState', 'captchaPolicy'),
|
|
428
432
|
setSecurityPolicyPasswordHistoryState: typeReducerNestedKey('securityPolicyState', 'passwordHistoryPolicy'),
|
|
@@ -433,6 +437,7 @@ const actions$4 = {
|
|
|
433
437
|
loadSecurityPolicy: createAction(`${authStoreName}/loadSecurityPolicy`),
|
|
434
438
|
loadPublicSecurityPolicy: createAction(`${authStoreName}/loadPublicSecurityPolicy`),
|
|
435
439
|
loadSecurityPolicyMfa: createAction(`${authStoreName}/loadSecurityPolicyMfa`),
|
|
440
|
+
loadSecurityPolicyVendorMfa: createAction(`${authStoreName}/loadSecurityPolicyVendorMfa`),
|
|
436
441
|
saveSecurityPolicyMfa: createAction(`${authStoreName}/saveSecurityPolicyMfa`, (payload) => ({ payload })),
|
|
437
442
|
loadSecurityPolicyLockout: createAction(`${authStoreName}/loadSecurityPolicyLockout`),
|
|
438
443
|
saveSecurityPolicyLockout: createAction(`${authStoreName}/saveSecurityPolicyLockout`, (payload) => ({ payload })),
|
|
@@ -599,7 +604,7 @@ const apiTokensDataDemo = {
|
|
|
599
604
|
clientId: 'CLIENT_ID_16806d3d-8fc3-4450-be97-abdaf66b723e',
|
|
600
605
|
secret: 'SECRET_16806d3d-8fc3-4450-be97-abdaf66b723e',
|
|
601
606
|
createdAt: 'createdAt',
|
|
602
|
-
description: '
|
|
607
|
+
description: 'Demo API Token (preview only)',
|
|
603
608
|
};
|
|
604
609
|
const apiTokensDataTenantDemo = Object.assign(Object.assign({}, apiTokensDataDemo), { roleIds: [], tenantId: 'my-tenant-id', createdByUserId: 'createdByUserId' });
|
|
605
610
|
const roleDemo = [
|
|
@@ -630,8 +635,8 @@ const rolePermissionDemo = [
|
|
|
630
635
|
];
|
|
631
636
|
const userProfileDemo = {
|
|
632
637
|
id: 'testId',
|
|
633
|
-
name: '
|
|
634
|
-
email: '
|
|
638
|
+
name: 'Demo User Name',
|
|
639
|
+
email: 'demo-user@frontegg.com',
|
|
635
640
|
mfaEnrolled: true,
|
|
636
641
|
profileImage: undefined,
|
|
637
642
|
profilePictureUrl: 'https://www.gravatar.com/avatar/42b2ad2bad6fc9b9db5086dfcf8072ac?d=https://ui-avatars.com/api/fe/128/random?t=1617261890875?t=1617261917434',
|
|
@@ -640,7 +645,14 @@ const userProfileDemo = {
|
|
|
640
645
|
tenantId: 'my-tenant-id',
|
|
641
646
|
tenantIds: ['my-tenant-id'],
|
|
642
647
|
activatedForTenant: true,
|
|
643
|
-
metadata: {
|
|
648
|
+
metadata: JSON.stringify({
|
|
649
|
+
phoneNumber: '+972-54123456',
|
|
650
|
+
jobTitle: 'Developer',
|
|
651
|
+
address: {
|
|
652
|
+
city: "Tel Aviv",
|
|
653
|
+
country: "Israel"
|
|
654
|
+
}
|
|
655
|
+
}),
|
|
644
656
|
roleIds: undefined,
|
|
645
657
|
verified: undefined,
|
|
646
658
|
};
|
|
@@ -757,10 +769,10 @@ const permissionsDemo = [
|
|
|
757
769
|
categoryId: 'categoryId',
|
|
758
770
|
},
|
|
759
771
|
];
|
|
760
|
-
const
|
|
761
|
-
id: '
|
|
762
|
-
email: '
|
|
763
|
-
name: '
|
|
772
|
+
const userTeamDemo2 = {
|
|
773
|
+
id: 'id2',
|
|
774
|
+
email: 'demo-user2@frontegg.com',
|
|
775
|
+
name: 'Demo User Name2',
|
|
764
776
|
phone: undefined,
|
|
765
777
|
profileImage: undefined,
|
|
766
778
|
profileImageUrl: undefined,
|
|
@@ -768,18 +780,37 @@ const userTeamDemo = {
|
|
|
768
780
|
vendorId: 'vendorId',
|
|
769
781
|
roleIds: [],
|
|
770
782
|
activatedForTenant: true,
|
|
783
|
+
verified: false,
|
|
771
784
|
createdAt: new Date().toISOString(),
|
|
772
785
|
customData: undefined,
|
|
773
786
|
lastLogin: undefined,
|
|
774
787
|
mfaEnabled: undefined,
|
|
775
788
|
roles: [],
|
|
789
|
+
}; // TODO add verified to ITeamUser
|
|
790
|
+
const userTeamDemo = {
|
|
791
|
+
id: 'id',
|
|
792
|
+
email: 'demo-user@frontegg.com',
|
|
793
|
+
name: 'Demo User Name',
|
|
794
|
+
phone: undefined,
|
|
795
|
+
profileImage: undefined,
|
|
796
|
+
profileImageUrl: undefined,
|
|
797
|
+
tenantId: 'tenantId',
|
|
798
|
+
vendorId: 'vendorId',
|
|
799
|
+
roleIds: [],
|
|
800
|
+
activatedForTenant: true,
|
|
801
|
+
createdAt: new Date(2022, 4, 1).toISOString(),
|
|
802
|
+
verified: true,
|
|
803
|
+
customData: undefined,
|
|
804
|
+
lastLogin: new Date(2022, 5, 25).toISOString(),
|
|
805
|
+
mfaEnabled: undefined,
|
|
806
|
+
roles: [],
|
|
776
807
|
};
|
|
777
|
-
const usersDemo = [userTeamDemo];
|
|
808
|
+
const usersDemo = [userTeamDemo, userTeamDemo2];
|
|
778
809
|
const tenantsDemo = [
|
|
779
810
|
{
|
|
780
811
|
id: 'my-tenant-id',
|
|
781
812
|
isReseller: false,
|
|
782
|
-
name: '
|
|
813
|
+
name: 'Frontegg demo',
|
|
783
814
|
deletedAt: null,
|
|
784
815
|
metadata: undefined,
|
|
785
816
|
tenantId: 'my-tenant-id',
|
|
@@ -3051,6 +3082,7 @@ function* loadSecurityPolicy() {
|
|
|
3051
3082
|
yield put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
3052
3083
|
}
|
|
3053
3084
|
yield put(actions.loadSecurityPolicyMfa());
|
|
3085
|
+
yield put(actions.loadSecurityPolicyVendorMfa());
|
|
3054
3086
|
yield put(actions.loadSecurityPolicyLockout());
|
|
3055
3087
|
yield put(actions.loadSecurityPolicyCaptcha());
|
|
3056
3088
|
}
|
|
@@ -3074,6 +3106,16 @@ function* loadSecurityPolicyMfa() {
|
|
|
3074
3106
|
yield put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
3075
3107
|
}
|
|
3076
3108
|
}
|
|
3109
|
+
function* loadSecurityPolicyVendorMfa() {
|
|
3110
|
+
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3111
|
+
try {
|
|
3112
|
+
const policy = yield call(api.auth.getVendorMfaPolicy);
|
|
3113
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ policy, loading: false }));
|
|
3114
|
+
}
|
|
3115
|
+
catch (e) {
|
|
3116
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ error: e.message, loading: false }));
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3077
3119
|
function* saveSecurityPolicyMfa(_a) {
|
|
3078
3120
|
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3079
3121
|
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
@@ -3157,6 +3199,7 @@ function* securityPolicySagas() {
|
|
|
3157
3199
|
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
3158
3200
|
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
3159
3201
|
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
3202
|
+
yield takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfa);
|
|
3160
3203
|
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
3161
3204
|
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
3162
3205
|
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
@@ -3182,6 +3225,7 @@ function* loadSecurityPolicyMock() {
|
|
|
3182
3225
|
yield delay();
|
|
3183
3226
|
yield put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
3184
3227
|
yield put(actions.loadSecurityPolicyMfa());
|
|
3228
|
+
yield put(actions.loadSecurityPolicyVendorMfa());
|
|
3185
3229
|
yield put(actions.loadSecurityPolicyLockout());
|
|
3186
3230
|
yield put(actions.loadSecurityPolicyCaptcha());
|
|
3187
3231
|
}
|
|
@@ -3190,6 +3234,11 @@ function* loadSecurityPolicyMfaMock() {
|
|
|
3190
3234
|
yield delay();
|
|
3191
3235
|
yield put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3192
3236
|
}
|
|
3237
|
+
function* loadSecurityPolicyVendorMfaMock() {
|
|
3238
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ loading: true, error: null }));
|
|
3239
|
+
yield delay();
|
|
3240
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3241
|
+
}
|
|
3193
3242
|
function* saveSecurityPolicyMfaMock(_a) {
|
|
3194
3243
|
var _b;
|
|
3195
3244
|
var _c = _a.payload, { callback } = _c, newSecurityPolicy = __rest(_c, ["callback"]);
|
|
@@ -3235,6 +3284,7 @@ function* securityPolicySagasMock() {
|
|
|
3235
3284
|
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
3236
3285
|
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
3237
3286
|
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
3287
|
+
yield takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfaMock);
|
|
3238
3288
|
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
3239
3289
|
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
3240
3290
|
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
package/auth/reducer.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ declare const actions: {
|
|
|
47
47
|
loadSecurityPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
48
48
|
loadPublicSecurityPolicy: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
49
49
|
loadSecurityPolicyMfa: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
50
|
+
loadSecurityPolicyVendorMfa: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
50
51
|
saveSecurityPolicyMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyMfa, import("@frontegg/rest-api").ISecurityPolicyMfa>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyMfa, import("@frontegg/rest-api").ISecurityPolicyMfa>, string, never, never>;
|
|
51
52
|
loadSecurityPolicyLockout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
52
53
|
saveSecurityPolicyLockout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyLockout, import("@frontegg/rest-api").ISecurityPolicyLockout>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ISaveSecurityPolicyLockout, import("@frontegg/rest-api").ISecurityPolicyLockout>, string, never, never>;
|
|
@@ -269,6 +270,11 @@ declare const actions: {
|
|
|
269
270
|
}>], Partial<import("../interfaces").WithStatus & {
|
|
270
271
|
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
271
272
|
}>, string, never, never>;
|
|
273
|
+
setSecurityPolicyVendorMfaState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("../interfaces").WithStatus & {
|
|
274
|
+
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
275
|
+
}>], Partial<import("../interfaces").WithStatus & {
|
|
276
|
+
policy?: import("@frontegg/rest-api").ISecurityPolicyMfa | undefined;
|
|
277
|
+
}>, string, never, never>;
|
|
272
278
|
setSecurityPolicyLockoutState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("../interfaces").WithStatus & {
|
|
273
279
|
policy?: import("@frontegg/rest-api").ISecurityPolicyLockout | undefined;
|
|
274
280
|
}>], Partial<import("../interfaces").WithStatus & {
|
package/node/audits/index.js
CHANGED
|
@@ -56,19 +56,6 @@ const { reducer, actions: sliceActions } = toolkit.createSlice({
|
|
|
56
56
|
});
|
|
57
57
|
const actions = Object.assign(Object.assign(Object.assign({}, sliceActions), actions$2), actions$1);
|
|
58
58
|
|
|
59
|
-
const dummyUsersData = [
|
|
60
|
-
{ user: 'Dianne Deck', email: 'dianne@frontegg.com' },
|
|
61
|
-
{ user: 'Betty Martin', email: 'betty@frontegg.com' },
|
|
62
|
-
{ user: 'Joann Schmidt', email: 'joann@frontegg.com' },
|
|
63
|
-
{ user: 'Kristine Bodnar', email: 'kristine@frontegg.com' },
|
|
64
|
-
{ user: 'Harold Marcus', email: 'harold@frontegg.com' },
|
|
65
|
-
{ user: 'Alice Williams', email: 'allice@frontegg.com' },
|
|
66
|
-
{ user: 'Beatrice Wilkinson', email: 'beatrice@frontegg.com' },
|
|
67
|
-
];
|
|
68
|
-
const randomUser = () => {
|
|
69
|
-
const random = Math.floor(Math.random() * dummyUsersData.length);
|
|
70
|
-
return dummyUsersData[random];
|
|
71
|
-
};
|
|
72
59
|
const sortMethodBasedOnOrder = (sortBy, desc) => (a, b) => {
|
|
73
60
|
if (a[sortBy] > b[sortBy]) {
|
|
74
61
|
return desc ? -1 : 1;
|
|
@@ -134,7 +121,7 @@ const randomAction = () => {
|
|
|
134
121
|
};
|
|
135
122
|
const auditLogsDataDemo = {
|
|
136
123
|
total: 20,
|
|
137
|
-
data: Array.from(Array(
|
|
124
|
+
data: Array.from(Array(5).keys()).map((i) => (Object.assign(Object.assign({ ip: '198.143.51.1', user: 'Demo User Name', email: 'demo-user@frontegg.com' }, randomAction()), { json: { key1: 'value1', key2: 'value2', key3: 'value3', key4: 'value4' }, tenantId: 'my-tenant-id', vendorId: 'my-vendor-id', userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36', createdAt: `2022-04-07 10:${50 - i}:40.201` }))),
|
|
138
125
|
};
|
|
139
126
|
const auditLogsMetadataDemo = {
|
|
140
127
|
properties: [
|
package/node/auth/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('../index-
|
|
5
|
+
var auth_index = require('../index-c7535125.js');
|
|
6
6
|
var constants = require('../constants-52e37c08.js');
|
|
7
7
|
var restApi = require('@frontegg/rest-api');
|
|
8
8
|
require('@reduxjs/toolkit');
|
|
@@ -411,6 +411,9 @@ const securityPolicyState = {
|
|
|
411
411
|
publicPolicy: {
|
|
412
412
|
loading: false,
|
|
413
413
|
},
|
|
414
|
+
vendorMfaPolicy: {
|
|
415
|
+
loading: true,
|
|
416
|
+
},
|
|
414
417
|
mfaPolicy: {
|
|
415
418
|
loading: true,
|
|
416
419
|
},
|
|
@@ -432,6 +435,7 @@ const reducers$3 = {
|
|
|
432
435
|
setSecurityPolicyGlobalState: typeReducerNestedKey('securityPolicyState', 'globalPolicy'),
|
|
433
436
|
setSecurityPolicyPublicState: typeReducerNestedKey('securityPolicyState', 'publicPolicy'),
|
|
434
437
|
setSecurityPolicyMfaState: typeReducerNestedKey('securityPolicyState', 'mfaPolicy'),
|
|
438
|
+
setSecurityPolicyVendorMfaState: typeReducerNestedKey('securityPolicyState', 'vendorMfaPolicy'),
|
|
435
439
|
setSecurityPolicyLockoutState: typeReducerNestedKey('securityPolicyState', 'lockoutPolicy'),
|
|
436
440
|
setSecurityPolicyCaptchaState: typeReducerNestedKey('securityPolicyState', 'captchaPolicy'),
|
|
437
441
|
setSecurityPolicyPasswordHistoryState: typeReducerNestedKey('securityPolicyState', 'passwordHistoryPolicy'),
|
|
@@ -442,6 +446,7 @@ const actions$4 = {
|
|
|
442
446
|
loadSecurityPolicy: toolkit.createAction(`${constants.authStoreName}/loadSecurityPolicy`),
|
|
443
447
|
loadPublicSecurityPolicy: toolkit.createAction(`${constants.authStoreName}/loadPublicSecurityPolicy`),
|
|
444
448
|
loadSecurityPolicyMfa: toolkit.createAction(`${constants.authStoreName}/loadSecurityPolicyMfa`),
|
|
449
|
+
loadSecurityPolicyVendorMfa: toolkit.createAction(`${constants.authStoreName}/loadSecurityPolicyVendorMfa`),
|
|
445
450
|
saveSecurityPolicyMfa: toolkit.createAction(`${constants.authStoreName}/saveSecurityPolicyMfa`, (payload) => ({ payload })),
|
|
446
451
|
loadSecurityPolicyLockout: toolkit.createAction(`${constants.authStoreName}/loadSecurityPolicyLockout`),
|
|
447
452
|
saveSecurityPolicyLockout: toolkit.createAction(`${constants.authStoreName}/saveSecurityPolicyLockout`, (payload) => ({ payload })),
|
|
@@ -608,7 +613,7 @@ const apiTokensDataDemo = {
|
|
|
608
613
|
clientId: 'CLIENT_ID_16806d3d-8fc3-4450-be97-abdaf66b723e',
|
|
609
614
|
secret: 'SECRET_16806d3d-8fc3-4450-be97-abdaf66b723e',
|
|
610
615
|
createdAt: 'createdAt',
|
|
611
|
-
description: '
|
|
616
|
+
description: 'Demo API Token (preview only)',
|
|
612
617
|
};
|
|
613
618
|
const apiTokensDataTenantDemo = Object.assign(Object.assign({}, apiTokensDataDemo), { roleIds: [], tenantId: 'my-tenant-id', createdByUserId: 'createdByUserId' });
|
|
614
619
|
const roleDemo = [
|
|
@@ -639,8 +644,8 @@ const rolePermissionDemo = [
|
|
|
639
644
|
];
|
|
640
645
|
const userProfileDemo = {
|
|
641
646
|
id: 'testId',
|
|
642
|
-
name: '
|
|
643
|
-
email: '
|
|
647
|
+
name: 'Demo User Name',
|
|
648
|
+
email: 'demo-user@frontegg.com',
|
|
644
649
|
mfaEnrolled: true,
|
|
645
650
|
profileImage: undefined,
|
|
646
651
|
profilePictureUrl: 'https://www.gravatar.com/avatar/42b2ad2bad6fc9b9db5086dfcf8072ac?d=https://ui-avatars.com/api/fe/128/random?t=1617261890875?t=1617261917434',
|
|
@@ -649,7 +654,14 @@ const userProfileDemo = {
|
|
|
649
654
|
tenantId: 'my-tenant-id',
|
|
650
655
|
tenantIds: ['my-tenant-id'],
|
|
651
656
|
activatedForTenant: true,
|
|
652
|
-
metadata: {
|
|
657
|
+
metadata: JSON.stringify({
|
|
658
|
+
phoneNumber: '+972-54123456',
|
|
659
|
+
jobTitle: 'Developer',
|
|
660
|
+
address: {
|
|
661
|
+
city: "Tel Aviv",
|
|
662
|
+
country: "Israel"
|
|
663
|
+
}
|
|
664
|
+
}),
|
|
653
665
|
roleIds: undefined,
|
|
654
666
|
verified: undefined,
|
|
655
667
|
};
|
|
@@ -766,10 +778,10 @@ const permissionsDemo = [
|
|
|
766
778
|
categoryId: 'categoryId',
|
|
767
779
|
},
|
|
768
780
|
];
|
|
769
|
-
const
|
|
770
|
-
id: '
|
|
771
|
-
email: '
|
|
772
|
-
name: '
|
|
781
|
+
const userTeamDemo2 = {
|
|
782
|
+
id: 'id2',
|
|
783
|
+
email: 'demo-user2@frontegg.com',
|
|
784
|
+
name: 'Demo User Name2',
|
|
773
785
|
phone: undefined,
|
|
774
786
|
profileImage: undefined,
|
|
775
787
|
profileImageUrl: undefined,
|
|
@@ -777,18 +789,37 @@ const userTeamDemo = {
|
|
|
777
789
|
vendorId: 'vendorId',
|
|
778
790
|
roleIds: [],
|
|
779
791
|
activatedForTenant: true,
|
|
792
|
+
verified: false,
|
|
780
793
|
createdAt: new Date().toISOString(),
|
|
781
794
|
customData: undefined,
|
|
782
795
|
lastLogin: undefined,
|
|
783
796
|
mfaEnabled: undefined,
|
|
784
797
|
roles: [],
|
|
798
|
+
}; // TODO add verified to ITeamUser
|
|
799
|
+
const userTeamDemo = {
|
|
800
|
+
id: 'id',
|
|
801
|
+
email: 'demo-user@frontegg.com',
|
|
802
|
+
name: 'Demo User Name',
|
|
803
|
+
phone: undefined,
|
|
804
|
+
profileImage: undefined,
|
|
805
|
+
profileImageUrl: undefined,
|
|
806
|
+
tenantId: 'tenantId',
|
|
807
|
+
vendorId: 'vendorId',
|
|
808
|
+
roleIds: [],
|
|
809
|
+
activatedForTenant: true,
|
|
810
|
+
createdAt: new Date(2022, 4, 1).toISOString(),
|
|
811
|
+
verified: true,
|
|
812
|
+
customData: undefined,
|
|
813
|
+
lastLogin: new Date(2022, 5, 25).toISOString(),
|
|
814
|
+
mfaEnabled: undefined,
|
|
815
|
+
roles: [],
|
|
785
816
|
};
|
|
786
|
-
const usersDemo = [userTeamDemo];
|
|
817
|
+
const usersDemo = [userTeamDemo, userTeamDemo2];
|
|
787
818
|
const tenantsDemo = [
|
|
788
819
|
{
|
|
789
820
|
id: 'my-tenant-id',
|
|
790
821
|
isReseller: false,
|
|
791
|
-
name: '
|
|
822
|
+
name: 'Frontegg demo',
|
|
792
823
|
deletedAt: null,
|
|
793
824
|
metadata: undefined,
|
|
794
825
|
tenantId: 'my-tenant-id',
|
|
@@ -3060,6 +3091,7 @@ function* loadSecurityPolicy() {
|
|
|
3060
3091
|
yield effects.put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
3061
3092
|
}
|
|
3062
3093
|
yield effects.put(actions.loadSecurityPolicyMfa());
|
|
3094
|
+
yield effects.put(actions.loadSecurityPolicyVendorMfa());
|
|
3063
3095
|
yield effects.put(actions.loadSecurityPolicyLockout());
|
|
3064
3096
|
yield effects.put(actions.loadSecurityPolicyCaptcha());
|
|
3065
3097
|
}
|
|
@@ -3083,6 +3115,16 @@ function* loadSecurityPolicyMfa() {
|
|
|
3083
3115
|
yield effects.put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
3084
3116
|
}
|
|
3085
3117
|
}
|
|
3118
|
+
function* loadSecurityPolicyVendorMfa() {
|
|
3119
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3120
|
+
try {
|
|
3121
|
+
const policy = yield effects.call(restApi.api.auth.getVendorMfaPolicy);
|
|
3122
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ policy, loading: false }));
|
|
3123
|
+
}
|
|
3124
|
+
catch (e) {
|
|
3125
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ error: e.message, loading: false }));
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3086
3128
|
function* saveSecurityPolicyMfa(_a) {
|
|
3087
3129
|
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
3088
3130
|
yield effects.put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
@@ -3166,6 +3208,7 @@ function* securityPolicySagas() {
|
|
|
3166
3208
|
yield effects.takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
3167
3209
|
yield effects.takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
3168
3210
|
yield effects.takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
3211
|
+
yield effects.takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfa);
|
|
3169
3212
|
yield effects.takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
3170
3213
|
yield effects.takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
3171
3214
|
yield effects.takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
@@ -3191,6 +3234,7 @@ function* loadSecurityPolicyMock() {
|
|
|
3191
3234
|
yield delay();
|
|
3192
3235
|
yield effects.put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
3193
3236
|
yield effects.put(actions.loadSecurityPolicyMfa());
|
|
3237
|
+
yield effects.put(actions.loadSecurityPolicyVendorMfa());
|
|
3194
3238
|
yield effects.put(actions.loadSecurityPolicyLockout());
|
|
3195
3239
|
yield effects.put(actions.loadSecurityPolicyCaptcha());
|
|
3196
3240
|
}
|
|
@@ -3199,6 +3243,11 @@ function* loadSecurityPolicyMfaMock() {
|
|
|
3199
3243
|
yield delay();
|
|
3200
3244
|
yield effects.put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3201
3245
|
}
|
|
3246
|
+
function* loadSecurityPolicyVendorMfaMock() {
|
|
3247
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ loading: true, error: null }));
|
|
3248
|
+
yield delay();
|
|
3249
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3250
|
+
}
|
|
3202
3251
|
function* saveSecurityPolicyMfaMock(_a) {
|
|
3203
3252
|
var _b;
|
|
3204
3253
|
var _c = _a.payload, { callback } = _c, newSecurityPolicy = tslib.__rest(_c, ["callback"]);
|
|
@@ -3244,6 +3293,7 @@ function* securityPolicySagasMock() {
|
|
|
3244
3293
|
yield effects.takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
3245
3294
|
yield effects.takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
3246
3295
|
yield effects.takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
3296
|
+
yield effects.takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfaMock);
|
|
3247
3297
|
yield effects.takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
3248
3298
|
yield effects.takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
3249
3299
|
yield effects.takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
package/node/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('./index-
|
|
5
|
+
var auth_index = require('./index-c7535125.js');
|
|
6
6
|
var audits_index = require('./audits/index.js');
|
|
7
7
|
var connectivity_index = require('./connectivity/index.js');
|
|
8
8
|
var subscriptions_index = require('./subscriptions/index.js');
|
package/node/toolkit/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('../index-
|
|
5
|
+
var auth_index = require('../index-c7535125.js');
|
|
6
6
|
var toolkit = require('@reduxjs/toolkit');
|
|
7
7
|
var createSagaMiddleware = require('redux-saga');
|
|
8
8
|
var effects = require('redux-saga/effects');
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
3
|
"libName": "FronteggReduxStore",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.57.0",
|
|
5
5
|
"author": "Frontegg LTD",
|
|
6
6
|
"main": "./node/index.js",
|
|
7
7
|
"module": "./index.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@frontegg/rest-api": "2.10.
|
|
10
|
+
"@frontegg/rest-api": "2.10.74",
|
|
11
11
|
"@reduxjs/toolkit": "^1.5.0",
|
|
12
12
|
"redux-saga": "^1.1.0",
|
|
13
13
|
"tslib": "^2.3.1",
|