@frontegg/redux-store 6.127.0-alpha.1 → 6.128.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/auth/LoginState/consts.d.ts +23 -0
- package/auth/LoginState/consts.js +25 -0
- package/auth/SecurityCenterState/saga.d.ts +15 -0
- package/auth/SecurityCenterState/saga.js +43 -3
- package/auth/dummy.d.ts +3 -1
- package/auth/dummy.js +59 -2
- package/auth/initialState.js +2 -17
- package/auth/saga.js +2 -2
- package/index.js +1 -1
- package/node/auth/LoginState/consts.js +29 -2
- package/node/auth/SecurityCenterState/saga.js +46 -3
- package/node/auth/dummy.js +61 -2
- package/node/auth/initialState.js +2 -17
- package/node/auth/saga.js +1 -1
- package/node/index.js +1 -1
- package/package.json +2 -2
- package/subscriptions/Billing/Information/saga.d.ts +2 -2
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@notice these file is used inside next js middleware
|
|
3
|
+
middleware file in next js runs inside edge runtime
|
|
4
|
+
using redux-toolkit is not allowed inside edge runtime and breaks the build because it is using eval
|
|
5
|
+
please don't import from redux or from other files that import from redux
|
|
6
|
+
*/
|
|
1
7
|
import { AuthStrategyEnum } from '@frontegg/rest-api';
|
|
2
8
|
import { LoginStep } from './interfaces';
|
|
3
9
|
export declare const authStrategyLoginStepMap: Record<Exclude<AuthStrategyEnum, AuthStrategyEnum.NoLocalAuthentication>, LoginStep>;
|
|
10
|
+
export declare const defaultFronteggRoutes: {
|
|
11
|
+
authenticatedUrl: string;
|
|
12
|
+
loginUrl: string;
|
|
13
|
+
logoutUrl: string;
|
|
14
|
+
activateUrl: string;
|
|
15
|
+
impersonationUrl: string;
|
|
16
|
+
acceptInvitationUrl: string;
|
|
17
|
+
forgetPasswordUrl: string;
|
|
18
|
+
resetPhoneNumberUrl: string;
|
|
19
|
+
resetPasswordUrl: string;
|
|
20
|
+
socialLoginCallbackUrl: string;
|
|
21
|
+
signUpUrl: string;
|
|
22
|
+
oidcRedirectUrl: string;
|
|
23
|
+
samlCallbackUrl: string;
|
|
24
|
+
magicLinkCallbackUrl: string;
|
|
25
|
+
hostedLoginRedirectUrl: string;
|
|
26
|
+
};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@notice these file is used inside next js middleware
|
|
3
|
+
middleware file in next js runs inside edge runtime
|
|
4
|
+
using redux-toolkit is not allowed inside edge runtime and breaks the build because it is using eval
|
|
5
|
+
please don't import from redux or from other files that import from redux
|
|
6
|
+
*/
|
|
1
7
|
import { AuthStrategyEnum } from '@frontegg/rest-api';
|
|
2
8
|
import { LoginStep } from './interfaces';
|
|
3
9
|
export const authStrategyLoginStepMap = {
|
|
@@ -5,4 +11,23 @@ export const authStrategyLoginStepMap = {
|
|
|
5
11
|
[AuthStrategyEnum.EmailAndPassword]: LoginStep.loginWithPassword,
|
|
6
12
|
[AuthStrategyEnum.MagicLink]: LoginStep.magicLinkPreLoginSuccess,
|
|
7
13
|
[AuthStrategyEnum.SmsCode]: LoginStep.loginWithSmsOtc
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// don't remove this object because it is used in next js middleware (notice top of the file)
|
|
17
|
+
export const defaultFronteggRoutes = {
|
|
18
|
+
authenticatedUrl: '/',
|
|
19
|
+
loginUrl: '/account/login',
|
|
20
|
+
logoutUrl: '/account/logout',
|
|
21
|
+
activateUrl: '/account/activate',
|
|
22
|
+
impersonationUrl: '/account/impersonate',
|
|
23
|
+
acceptInvitationUrl: '/account/invitation/accept',
|
|
24
|
+
forgetPasswordUrl: '/account/forget-password',
|
|
25
|
+
resetPhoneNumberUrl: '/account/reset-phone-number',
|
|
26
|
+
resetPasswordUrl: '/account/reset-password',
|
|
27
|
+
socialLoginCallbackUrl: '/account/social/success',
|
|
28
|
+
signUpUrl: '/account/sign-up',
|
|
29
|
+
oidcRedirectUrl: '/account/oidc/callback',
|
|
30
|
+
samlCallbackUrl: '/account/saml/callback',
|
|
31
|
+
magicLinkCallbackUrl: '/account/login/magic-link',
|
|
32
|
+
hostedLoginRedirectUrl: '/oauth/callback'
|
|
8
33
|
};
|
|
@@ -40,3 +40,18 @@ export declare function sendResetBreachedPasswordEmails(): Generator<import("red
|
|
|
40
40
|
type: string;
|
|
41
41
|
}> | import("redux-saga/effects").CallEffect<void>, void, unknown>;
|
|
42
42
|
export declare function securityCenterSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
43
|
+
export declare function loadRecommendationsMock(): Generator<import("redux-saga/effects").PutEffect<{
|
|
44
|
+
payload: import("./types").SecurityCenterStateIndicator;
|
|
45
|
+
type: string;
|
|
46
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
47
|
+
payload: Partial<import("./interfaces").SecurityCenterState>;
|
|
48
|
+
type: string;
|
|
49
|
+
}> | import("redux-saga/effects").CallEffect<true>, void, unknown>;
|
|
50
|
+
export declare function loadInsightsMock(): Generator<import("redux-saga/effects").PutEffect<{
|
|
51
|
+
payload: import("./types").SecurityCenterStateIndicator;
|
|
52
|
+
type: string;
|
|
53
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
54
|
+
payload: Partial<import("./interfaces").SecurityCenterState>;
|
|
55
|
+
type: string;
|
|
56
|
+
}> | import("redux-saga/effects").CallEffect<true>, void, unknown>;
|
|
57
|
+
export declare function securityCenterSagasMock(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { call, put, takeEvery } from 'redux-saga/effects';
|
|
1
|
+
import { call, delay, put, takeEvery } from 'redux-saga/effects';
|
|
2
2
|
import { actions } from '../reducer';
|
|
3
3
|
import { errorHandler } from '../../utils';
|
|
4
4
|
import { api } from '@frontegg/rest-api';
|
|
5
5
|
import { SecurityCenterStateKeys } from './types';
|
|
6
|
-
import { getFeatureFlags } from '
|
|
6
|
+
import { getFeatureFlags } from '../../index';
|
|
7
|
+
import { securityCenterInsightsMock, securityCenterRecommendationsMock } from '../dummy';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* This function is used to wrap sagas of the security page.
|
|
@@ -31,13 +32,14 @@ export function* loadRecommendations() {
|
|
|
31
32
|
value: true
|
|
32
33
|
}));
|
|
33
34
|
try {
|
|
35
|
+
var _scoring$score;
|
|
34
36
|
const {
|
|
35
37
|
recommendations,
|
|
36
38
|
scoring
|
|
37
39
|
} = yield call(api.securityCenter.getRecommendations);
|
|
38
40
|
yield put(actions.setSecurityCenterState({
|
|
39
41
|
recommendations: recommendations.items,
|
|
40
|
-
score: scoring.score
|
|
42
|
+
score: (_scoring$score = scoring == null ? void 0 : scoring.score) != null ? _scoring$score : 0
|
|
41
43
|
}));
|
|
42
44
|
} catch (e) {
|
|
43
45
|
yield put(actions.setSecurityCenterStateError({
|
|
@@ -100,4 +102,42 @@ export function* securityCenterSagas() {
|
|
|
100
102
|
yield takeEvery(actions.loadRecommendations, loadRecommendations);
|
|
101
103
|
yield takeEvery(actions.loadInsights, loadInsights);
|
|
102
104
|
yield takeEvery(actions.sendResetBreachedPasswordEmails, sendResetBreachedPasswordEmails);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//MOCK SAGAS
|
|
108
|
+
|
|
109
|
+
export function* loadRecommendationsMock() {
|
|
110
|
+
const key = SecurityCenterStateKeys.RECOMMENDATIONS;
|
|
111
|
+
yield put(actions.setSecurityCenterStateLoader({
|
|
112
|
+
key,
|
|
113
|
+
value: true
|
|
114
|
+
}));
|
|
115
|
+
yield delay(500);
|
|
116
|
+
yield put(actions.setSecurityCenterState({
|
|
117
|
+
recommendations: securityCenterRecommendationsMock.recommendations.items,
|
|
118
|
+
score: securityCenterRecommendationsMock.scoring.score
|
|
119
|
+
}));
|
|
120
|
+
yield put(actions.setSecurityCenterStateLoader({
|
|
121
|
+
key,
|
|
122
|
+
value: false
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
export function* loadInsightsMock() {
|
|
126
|
+
const key = SecurityCenterStateKeys.INSIGHTS;
|
|
127
|
+
yield put(actions.setSecurityCenterStateLoader({
|
|
128
|
+
key,
|
|
129
|
+
value: true
|
|
130
|
+
}));
|
|
131
|
+
yield delay(500);
|
|
132
|
+
yield put(actions.setSecurityCenterState({
|
|
133
|
+
insights: securityCenterInsightsMock.insights.items
|
|
134
|
+
}));
|
|
135
|
+
yield put(actions.setSecurityCenterStateLoader({
|
|
136
|
+
key,
|
|
137
|
+
value: false
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
export function* securityCenterSagasMock() {
|
|
141
|
+
yield takeEvery(actions.loadRecommendations, loadRecommendationsMock);
|
|
142
|
+
yield takeEvery(actions.loadInsights, loadInsightsMock);
|
|
103
143
|
}
|
package/auth/dummy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRole, ISamlConfiguration, ISamlMetadata, ISecurityPolicy, ISecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyPasswordHistory, ITeamUser, ITeamUserPermission, ITeamUserRole, ITenantsResponse, IVendorConfig, ISubTenantUser, ISessionConfigurations, IpRestriction, IPRestrictionsConfig, ISessionResponse, IUserProfile } from '@frontegg/rest-api';
|
|
1
|
+
import { IRole, ISamlConfiguration, ISamlMetadata, ISecurityPolicy, ISecurityPolicyLockout, ISecurityPolicyMfa, ISecurityPolicyPasswordHistory, ITeamUser, ITeamUserPermission, ITeamUserRole, ITenantsResponse, IVendorConfig, ISubTenantUser, ISessionConfigurations, IpRestriction, IPRestrictionsConfig, ISessionResponse, IUserProfile, GetRecommendationsResponse, GetInsightsResponse } from '@frontegg/rest-api';
|
|
2
2
|
import { IApiTokensData, ITenantApiTokensData } from './ApiTokensState/interfaces';
|
|
3
3
|
import { IGroup } from '../auth/GroupsState/interfaces';
|
|
4
4
|
import { User } from './interfaces';
|
|
@@ -34,3 +34,5 @@ export declare const sessionsConfigDummies: ISessionConfigurations;
|
|
|
34
34
|
export declare const dummyIpConfig: IPRestrictionsConfig;
|
|
35
35
|
export declare const dummyIps: IpRestriction[];
|
|
36
36
|
export declare const allGroupsDummy: IGroup[];
|
|
37
|
+
export declare const securityCenterRecommendationsMock: GetRecommendationsResponse;
|
|
38
|
+
export declare const securityCenterInsightsMock: GetInsightsResponse;
|
package/auth/dummy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { AuthStrategyEnum, RestrictionType, GroupManagedByEnum } from '@frontegg/rest-api';
|
|
2
|
+
import { AuthStrategyEnum, RestrictionType, GroupManagedByEnum, InsightCode, RecommendationSeverity, RecommendationCode, SecurityCategory } from '@frontegg/rest-api';
|
|
3
3
|
import { MachineToMachineAuthStrategy } from './ApiTokensState/interfaces';
|
|
4
4
|
export const apiTokensDataDemo = {
|
|
5
5
|
clientId: 'CLIENT_ID_16806d3d-8fc3-4450-be97-abdaf66b723e',
|
|
@@ -472,4 +472,61 @@ export const allGroupsDummy = [{
|
|
|
472
472
|
users: generateGroupUsers(4),
|
|
473
473
|
roles: [generateRoleByName('Viewer')],
|
|
474
474
|
managedBy: GroupManagedByEnum.FRONTEGG
|
|
475
|
-
}];
|
|
475
|
+
}];
|
|
476
|
+
export const securityCenterRecommendationsMock = {
|
|
477
|
+
scoring: {
|
|
478
|
+
score: 79
|
|
479
|
+
},
|
|
480
|
+
recommendations: {
|
|
481
|
+
items: [{
|
|
482
|
+
code: RecommendationCode.FORCE_MFA,
|
|
483
|
+
severity: RecommendationSeverity.WARNING,
|
|
484
|
+
category: SecurityCategory.MFA
|
|
485
|
+
}, {
|
|
486
|
+
code: RecommendationCode.ENABLE_FORCE_RELOGIN,
|
|
487
|
+
severity: RecommendationSeverity.WARNING,
|
|
488
|
+
category: SecurityCategory.SESSIONS
|
|
489
|
+
}]
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
export const securityCenterInsightsMock = {
|
|
493
|
+
insights: {
|
|
494
|
+
items: [{
|
|
495
|
+
category: SecurityCategory.MFA,
|
|
496
|
+
code: InsightCode.PARTIALLY_FORCED_MFA,
|
|
497
|
+
metadata: {
|
|
498
|
+
totalUsers: 2,
|
|
499
|
+
mfa: {
|
|
500
|
+
enrolledUsersCount: 1
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}, {
|
|
504
|
+
category: SecurityCategory.SESSIONS,
|
|
505
|
+
code: InsightCode.PARTIAL_SESSION_SETTINGS,
|
|
506
|
+
metadata: {
|
|
507
|
+
totalUsers: 2,
|
|
508
|
+
sessions: {
|
|
509
|
+
idleTimeoutRecommendation: 1800
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}, {
|
|
513
|
+
category: SecurityCategory.PASSWORD,
|
|
514
|
+
code: InsightCode.IMPROVE_PASSWORD_HISTORY_POLICY,
|
|
515
|
+
metadata: {
|
|
516
|
+
password: {
|
|
517
|
+
userLockoutRecommendation: 5,
|
|
518
|
+
historyRecommendations: 5
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}, {
|
|
522
|
+
category: SecurityCategory.DOMAIN,
|
|
523
|
+
code: InsightCode.NO_IP_RESTRICTIONS,
|
|
524
|
+
metadata: {
|
|
525
|
+
restrictions: {
|
|
526
|
+
ipsCount: 1,
|
|
527
|
+
domainsCount: 1
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}]
|
|
531
|
+
}
|
|
532
|
+
};
|
package/auth/initialState.js
CHANGED
|
@@ -26,6 +26,7 @@ import { customLoginState } from './CustomLoginState';
|
|
|
26
26
|
import { allAccountsState } from './MSP/AllAccountsState';
|
|
27
27
|
import { allAccountsDialogsState } from './MSP/AllAccountsState/allAccountsDialogsState';
|
|
28
28
|
import { securityCenterState } from './SecurityCenterState';
|
|
29
|
+
import { defaultFronteggRoutes } from './LoginState/consts';
|
|
29
30
|
export const reinitializeState = {
|
|
30
31
|
isAuthenticated: false,
|
|
31
32
|
isLoading: true,
|
|
@@ -60,22 +61,6 @@ export const reinitializeState = {
|
|
|
60
61
|
securityCenterState
|
|
61
62
|
};
|
|
62
63
|
export const initialState = _extends({
|
|
63
|
-
routes:
|
|
64
|
-
authenticatedUrl: '/',
|
|
65
|
-
loginUrl: '/account/login',
|
|
66
|
-
logoutUrl: '/account/logout',
|
|
67
|
-
activateUrl: '/account/activate',
|
|
68
|
-
impersonationUrl: '/account/impersonate',
|
|
69
|
-
acceptInvitationUrl: '/account/invitation/accept',
|
|
70
|
-
forgetPasswordUrl: '/account/forget-password',
|
|
71
|
-
resetPhoneNumberUrl: '/account/reset-phone-number',
|
|
72
|
-
resetPasswordUrl: '/account/reset-password',
|
|
73
|
-
socialLoginCallbackUrl: '/account/social/success',
|
|
74
|
-
signUpUrl: '/account/sign-up',
|
|
75
|
-
oidcRedirectUrl: '/account/oidc/callback',
|
|
76
|
-
samlCallbackUrl: '/account/saml/callback',
|
|
77
|
-
magicLinkCallbackUrl: '/account/login/magic-link',
|
|
78
|
-
hostedLoginRedirectUrl: '/oauth/callback'
|
|
79
|
-
},
|
|
64
|
+
routes: defaultFronteggRoutes,
|
|
80
65
|
onRedirectTo: () => {}
|
|
81
66
|
}, reinitializeState);
|
package/auth/saga.js
CHANGED
|
@@ -26,7 +26,7 @@ import { groupsSagas, groupsSagasMock } from './GroupsState/saga';
|
|
|
26
26
|
import { customLoginSagas } from './CustomLoginState/saga';
|
|
27
27
|
import { allAccountsSagas } from './MSP/AllAccountsState/saga';
|
|
28
28
|
import { entitlementsSagas } from './Entitlements/saga';
|
|
29
|
-
import { securityCenterSagas } from './SecurityCenterState/saga';
|
|
29
|
+
import { securityCenterSagas, securityCenterSagasMock } from './SecurityCenterState/saga';
|
|
30
30
|
export function* sagas() {
|
|
31
31
|
yield all([call(loginSagas), call(activateSagas), call(acceptInvitationSagas), call(forgotPasswordSagas), call(resetPhoneNumberSagas), call(ssoSagas), call(ssoSagasV2), call(profileSagas), call(customLoginSagas), call(mfaSagas), call(teamSagas), call(groupsSagas), call(socialLoginsSaga), call(signUpSaga), call(apiTokensSaga), call(securityPolicySagas), call(accountSettingsSaga), call(tenantsSagas), call(rolesSagas), call(sessionsSaga), call(sessionsPolicySaga), call(restrictionsSagas), call(provisionSagas), call(impersonateSagas), call(passkeysSagas), call(allAccountsSagas), call(entitlementsSagas), call(securityCenterSagas)]);
|
|
32
32
|
}
|
|
@@ -37,5 +37,5 @@ export function* mockSagas() {
|
|
|
37
37
|
// call(forgotPasswordSagas),
|
|
38
38
|
// call(socialLoginsSaga),
|
|
39
39
|
// call(signUpSaga),
|
|
40
|
-
call(ssoSagasMock), call(profileSagasMock), call(mfaSagasMock), call(teamSagasMock), call(apiTokensSagaMock), call(securityPolicySagasMock), call(sessionsSagaMock), call(accountSettingsSagaMock), call(tenantsSagasMock), call(sessionsPolicySagaMock), call(restrictionsSagaMock), call(rolesSagasMock), call(groupsSagasMock)]);
|
|
40
|
+
call(ssoSagasMock), call(profileSagasMock), call(mfaSagasMock), call(teamSagasMock), call(apiTokensSagaMock), call(securityPolicySagasMock), call(sessionsSagaMock), call(accountSettingsSagaMock), call(tenantsSagasMock), call(sessionsPolicySagaMock), call(restrictionsSagaMock), call(rolesSagasMock), call(groupsSagasMock), call(securityCenterSagasMock)]);
|
|
41
41
|
}
|
package/index.js
CHANGED
|
@@ -3,13 +3,40 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.authStrategyLoginStepMap = void 0;
|
|
6
|
+
exports.defaultFronteggRoutes = exports.authStrategyLoginStepMap = void 0;
|
|
7
7
|
var _restApi = require("@frontegg/rest-api");
|
|
8
8
|
var _interfaces = require("./interfaces");
|
|
9
|
+
/**
|
|
10
|
+
@notice these file is used inside next js middleware
|
|
11
|
+
middleware file in next js runs inside edge runtime
|
|
12
|
+
using redux-toolkit is not allowed inside edge runtime and breaks the build because it is using eval
|
|
13
|
+
please don't import from redux or from other files that import from redux
|
|
14
|
+
*/
|
|
15
|
+
|
|
9
16
|
const authStrategyLoginStepMap = {
|
|
10
17
|
[_restApi.AuthStrategyEnum.Code]: _interfaces.LoginStep.loginWithOtc,
|
|
11
18
|
[_restApi.AuthStrategyEnum.EmailAndPassword]: _interfaces.LoginStep.loginWithPassword,
|
|
12
19
|
[_restApi.AuthStrategyEnum.MagicLink]: _interfaces.LoginStep.magicLinkPreLoginSuccess,
|
|
13
20
|
[_restApi.AuthStrategyEnum.SmsCode]: _interfaces.LoginStep.loginWithSmsOtc
|
|
14
21
|
};
|
|
15
|
-
|
|
22
|
+
|
|
23
|
+
// don't remove this object because it is used in next js middleware (notice top of the file)
|
|
24
|
+
exports.authStrategyLoginStepMap = authStrategyLoginStepMap;
|
|
25
|
+
const defaultFronteggRoutes = {
|
|
26
|
+
authenticatedUrl: '/',
|
|
27
|
+
loginUrl: '/account/login',
|
|
28
|
+
logoutUrl: '/account/logout',
|
|
29
|
+
activateUrl: '/account/activate',
|
|
30
|
+
impersonationUrl: '/account/impersonate',
|
|
31
|
+
acceptInvitationUrl: '/account/invitation/accept',
|
|
32
|
+
forgetPasswordUrl: '/account/forget-password',
|
|
33
|
+
resetPhoneNumberUrl: '/account/reset-phone-number',
|
|
34
|
+
resetPasswordUrl: '/account/reset-password',
|
|
35
|
+
socialLoginCallbackUrl: '/account/social/success',
|
|
36
|
+
signUpUrl: '/account/sign-up',
|
|
37
|
+
oidcRedirectUrl: '/account/oidc/callback',
|
|
38
|
+
samlCallbackUrl: '/account/saml/callback',
|
|
39
|
+
magicLinkCallbackUrl: '/account/login/magic-link',
|
|
40
|
+
hostedLoginRedirectUrl: '/oauth/callback'
|
|
41
|
+
};
|
|
42
|
+
exports.defaultFronteggRoutes = defaultFronteggRoutes;
|
|
@@ -4,16 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.loadInsights = loadInsights;
|
|
7
|
+
exports.loadInsightsMock = loadInsightsMock;
|
|
7
8
|
exports.loadRecommendations = loadRecommendations;
|
|
9
|
+
exports.loadRecommendationsMock = loadRecommendationsMock;
|
|
8
10
|
exports.securityCenterSagaWrapper = securityCenterSagaWrapper;
|
|
9
11
|
exports.securityCenterSagas = securityCenterSagas;
|
|
12
|
+
exports.securityCenterSagasMock = securityCenterSagasMock;
|
|
10
13
|
exports.sendResetBreachedPasswordEmails = sendResetBreachedPasswordEmails;
|
|
11
14
|
var _effects = require("redux-saga/effects");
|
|
12
15
|
var _reducer = require("../reducer");
|
|
13
16
|
var _utils = require("../../utils");
|
|
14
17
|
var _restApi = require("@frontegg/rest-api");
|
|
15
18
|
var _types = require("./types");
|
|
16
|
-
var
|
|
19
|
+
var _index = require("../../index");
|
|
20
|
+
var _dummy = require("../dummy");
|
|
17
21
|
/**
|
|
18
22
|
* This function is used to wrap sagas of the security page.
|
|
19
23
|
* This function returns function,
|
|
@@ -25,7 +29,7 @@ var _ = require("../..");
|
|
|
25
29
|
*/
|
|
26
30
|
function securityCenterSagaWrapper(action) {
|
|
27
31
|
return function* (props) {
|
|
28
|
-
const [securityCenterFeatureFlag] = yield (0, _effects.call)(
|
|
32
|
+
const [securityCenterFeatureFlag] = yield (0, _effects.call)(_index.getFeatureFlags, ['admin-portal-new-security-center-page']);
|
|
29
33
|
yield action(props);
|
|
30
34
|
if (securityCenterFeatureFlag) {
|
|
31
35
|
yield loadRecommendations();
|
|
@@ -40,13 +44,14 @@ function* loadRecommendations() {
|
|
|
40
44
|
value: true
|
|
41
45
|
}));
|
|
42
46
|
try {
|
|
47
|
+
var _scoring$score;
|
|
43
48
|
const {
|
|
44
49
|
recommendations,
|
|
45
50
|
scoring
|
|
46
51
|
} = yield (0, _effects.call)(_restApi.api.securityCenter.getRecommendations);
|
|
47
52
|
yield (0, _effects.put)(_reducer.actions.setSecurityCenterState({
|
|
48
53
|
recommendations: recommendations.items,
|
|
49
|
-
score: scoring.score
|
|
54
|
+
score: (_scoring$score = scoring == null ? void 0 : scoring.score) != null ? _scoring$score : 0
|
|
50
55
|
}));
|
|
51
56
|
} catch (e) {
|
|
52
57
|
yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateError({
|
|
@@ -109,4 +114,42 @@ function* securityCenterSagas() {
|
|
|
109
114
|
yield (0, _effects.takeEvery)(_reducer.actions.loadRecommendations, loadRecommendations);
|
|
110
115
|
yield (0, _effects.takeEvery)(_reducer.actions.loadInsights, loadInsights);
|
|
111
116
|
yield (0, _effects.takeEvery)(_reducer.actions.sendResetBreachedPasswordEmails, sendResetBreachedPasswordEmails);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
//MOCK SAGAS
|
|
120
|
+
|
|
121
|
+
function* loadRecommendationsMock() {
|
|
122
|
+
const key = _types.SecurityCenterStateKeys.RECOMMENDATIONS;
|
|
123
|
+
yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
|
|
124
|
+
key,
|
|
125
|
+
value: true
|
|
126
|
+
}));
|
|
127
|
+
yield (0, _effects.delay)(500);
|
|
128
|
+
yield (0, _effects.put)(_reducer.actions.setSecurityCenterState({
|
|
129
|
+
recommendations: _dummy.securityCenterRecommendationsMock.recommendations.items,
|
|
130
|
+
score: _dummy.securityCenterRecommendationsMock.scoring.score
|
|
131
|
+
}));
|
|
132
|
+
yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
|
|
133
|
+
key,
|
|
134
|
+
value: false
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
function* loadInsightsMock() {
|
|
138
|
+
const key = _types.SecurityCenterStateKeys.INSIGHTS;
|
|
139
|
+
yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
|
|
140
|
+
key,
|
|
141
|
+
value: true
|
|
142
|
+
}));
|
|
143
|
+
yield (0, _effects.delay)(500);
|
|
144
|
+
yield (0, _effects.put)(_reducer.actions.setSecurityCenterState({
|
|
145
|
+
insights: _dummy.securityCenterInsightsMock.insights.items
|
|
146
|
+
}));
|
|
147
|
+
yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
|
|
148
|
+
key,
|
|
149
|
+
value: false
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
function* securityCenterSagasMock() {
|
|
153
|
+
yield (0, _effects.takeEvery)(_reducer.actions.loadRecommendations, loadRecommendationsMock);
|
|
154
|
+
yield (0, _effects.takeEvery)(_reducer.actions.loadInsights, loadInsightsMock);
|
|
112
155
|
}
|
package/node/auth/dummy.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.usersDemo = exports.userTeamDemo2 = exports.userTeamDemo = exports.userSubTenantDemo = exports.userProfileDemo = exports.userDemo = exports.tenantsDemo = exports.ssoStateDemo = exports.sessionsMock = exports.sessionsConfigDummies = exports.samlMetadataDemo = exports.samlConfigurationDemo = exports.rolesDemo = exports.rolesAdminViewerDemo = exports.rolePermissionDemo = exports.roleDemo = exports.publicSecurityPolicy = exports.profileStateDemo = exports.policyPasswordHistoryDemo = exports.policyMfaDemo = exports.policyLockoutDemo = exports.policyDemo = exports.permissionsDemo = exports.dummyIps = exports.dummyIpConfig = exports.apiTokensDataTenantDemo = exports.apiTokensDataDemo = exports.allUsersDemo = exports.allGroupsDummy = void 0;
|
|
7
|
+
exports.usersDemo = exports.userTeamDemo2 = exports.userTeamDemo = exports.userSubTenantDemo = exports.userProfileDemo = exports.userDemo = exports.tenantsDemo = exports.ssoStateDemo = exports.sessionsMock = exports.sessionsConfigDummies = exports.securityCenterRecommendationsMock = exports.securityCenterInsightsMock = exports.samlMetadataDemo = exports.samlConfigurationDemo = exports.rolesDemo = exports.rolesAdminViewerDemo = exports.rolePermissionDemo = exports.roleDemo = exports.publicSecurityPolicy = exports.profileStateDemo = exports.policyPasswordHistoryDemo = exports.policyMfaDemo = exports.policyLockoutDemo = exports.policyDemo = exports.permissionsDemo = exports.dummyIps = exports.dummyIpConfig = exports.apiTokensDataTenantDemo = exports.apiTokensDataDemo = exports.allUsersDemo = exports.allGroupsDummy = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _restApi = require("@frontegg/rest-api");
|
|
10
10
|
var _interfaces = require("./ApiTokensState/interfaces");
|
|
@@ -507,4 +507,63 @@ const allGroupsDummy = [{
|
|
|
507
507
|
roles: [generateRoleByName('Viewer')],
|
|
508
508
|
managedBy: _restApi.GroupManagedByEnum.FRONTEGG
|
|
509
509
|
}];
|
|
510
|
-
exports.allGroupsDummy = allGroupsDummy;
|
|
510
|
+
exports.allGroupsDummy = allGroupsDummy;
|
|
511
|
+
const securityCenterRecommendationsMock = {
|
|
512
|
+
scoring: {
|
|
513
|
+
score: 79
|
|
514
|
+
},
|
|
515
|
+
recommendations: {
|
|
516
|
+
items: [{
|
|
517
|
+
code: _restApi.RecommendationCode.FORCE_MFA,
|
|
518
|
+
severity: _restApi.RecommendationSeverity.WARNING,
|
|
519
|
+
category: _restApi.SecurityCategory.MFA
|
|
520
|
+
}, {
|
|
521
|
+
code: _restApi.RecommendationCode.ENABLE_FORCE_RELOGIN,
|
|
522
|
+
severity: _restApi.RecommendationSeverity.WARNING,
|
|
523
|
+
category: _restApi.SecurityCategory.SESSIONS
|
|
524
|
+
}]
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
exports.securityCenterRecommendationsMock = securityCenterRecommendationsMock;
|
|
528
|
+
const securityCenterInsightsMock = {
|
|
529
|
+
insights: {
|
|
530
|
+
items: [{
|
|
531
|
+
category: _restApi.SecurityCategory.MFA,
|
|
532
|
+
code: _restApi.InsightCode.PARTIALLY_FORCED_MFA,
|
|
533
|
+
metadata: {
|
|
534
|
+
totalUsers: 2,
|
|
535
|
+
mfa: {
|
|
536
|
+
enrolledUsersCount: 1
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}, {
|
|
540
|
+
category: _restApi.SecurityCategory.SESSIONS,
|
|
541
|
+
code: _restApi.InsightCode.PARTIAL_SESSION_SETTINGS,
|
|
542
|
+
metadata: {
|
|
543
|
+
totalUsers: 2,
|
|
544
|
+
sessions: {
|
|
545
|
+
idleTimeoutRecommendation: 1800
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}, {
|
|
549
|
+
category: _restApi.SecurityCategory.PASSWORD,
|
|
550
|
+
code: _restApi.InsightCode.IMPROVE_PASSWORD_HISTORY_POLICY,
|
|
551
|
+
metadata: {
|
|
552
|
+
password: {
|
|
553
|
+
userLockoutRecommendation: 5,
|
|
554
|
+
historyRecommendations: 5
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}, {
|
|
558
|
+
category: _restApi.SecurityCategory.DOMAIN,
|
|
559
|
+
code: _restApi.InsightCode.NO_IP_RESTRICTIONS,
|
|
560
|
+
metadata: {
|
|
561
|
+
restrictions: {
|
|
562
|
+
ipsCount: 1,
|
|
563
|
+
domainsCount: 1
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}]
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
exports.securityCenterInsightsMock = securityCenterInsightsMock;
|
|
@@ -33,6 +33,7 @@ var _CustomLoginState = require("./CustomLoginState");
|
|
|
33
33
|
var _AllAccountsState = require("./MSP/AllAccountsState");
|
|
34
34
|
var _allAccountsDialogsState = require("./MSP/AllAccountsState/allAccountsDialogsState");
|
|
35
35
|
var _SecurityCenterState = require("./SecurityCenterState");
|
|
36
|
+
var _consts = require("./LoginState/consts");
|
|
36
37
|
const reinitializeState = {
|
|
37
38
|
isAuthenticated: false,
|
|
38
39
|
isLoading: true,
|
|
@@ -68,23 +69,7 @@ const reinitializeState = {
|
|
|
68
69
|
};
|
|
69
70
|
exports.reinitializeState = reinitializeState;
|
|
70
71
|
const initialState = (0, _extends2.default)({
|
|
71
|
-
routes:
|
|
72
|
-
authenticatedUrl: '/',
|
|
73
|
-
loginUrl: '/account/login',
|
|
74
|
-
logoutUrl: '/account/logout',
|
|
75
|
-
activateUrl: '/account/activate',
|
|
76
|
-
impersonationUrl: '/account/impersonate',
|
|
77
|
-
acceptInvitationUrl: '/account/invitation/accept',
|
|
78
|
-
forgetPasswordUrl: '/account/forget-password',
|
|
79
|
-
resetPhoneNumberUrl: '/account/reset-phone-number',
|
|
80
|
-
resetPasswordUrl: '/account/reset-password',
|
|
81
|
-
socialLoginCallbackUrl: '/account/social/success',
|
|
82
|
-
signUpUrl: '/account/sign-up',
|
|
83
|
-
oidcRedirectUrl: '/account/oidc/callback',
|
|
84
|
-
samlCallbackUrl: '/account/saml/callback',
|
|
85
|
-
magicLinkCallbackUrl: '/account/login/magic-link',
|
|
86
|
-
hostedLoginRedirectUrl: '/oauth/callback'
|
|
87
|
-
},
|
|
72
|
+
routes: _consts.defaultFronteggRoutes,
|
|
88
73
|
onRedirectTo: () => {}
|
|
89
74
|
}, reinitializeState);
|
|
90
75
|
exports.initialState = initialState;
|
package/node/auth/saga.js
CHANGED
|
@@ -44,5 +44,5 @@ function* mockSagas() {
|
|
|
44
44
|
// call(forgotPasswordSagas),
|
|
45
45
|
// call(socialLoginsSaga),
|
|
46
46
|
// call(signUpSaga),
|
|
47
|
-
(0, _effects.call)(_saga.ssoSagasMock), (0, _effects.call)(_saga3.profileSagasMock), (0, _effects.call)(_saga4.mfaSagasMock), (0, _effects.call)(_saga9.teamSagasMock), (0, _effects.call)(_saga12.apiTokensSagaMock), (0, _effects.call)(_saga13.securityPolicySagasMock), (0, _effects.call)(_saga18.sessionsSagaMock), (0, _effects.call)(_saga14.accountSettingsSagaMock), (0, _effects.call)(_saga15.tenantsSagasMock), (0, _effects.call)(_saga19.sessionsPolicySagaMock), (0, _effects.call)(_saga20.restrictionsSagaMock), (0, _effects.call)(_saga16.rolesSagasMock), (0, _effects.call)(_saga24.groupsSagasMock)]);
|
|
47
|
+
(0, _effects.call)(_saga.ssoSagasMock), (0, _effects.call)(_saga3.profileSagasMock), (0, _effects.call)(_saga4.mfaSagasMock), (0, _effects.call)(_saga9.teamSagasMock), (0, _effects.call)(_saga12.apiTokensSagaMock), (0, _effects.call)(_saga13.securityPolicySagasMock), (0, _effects.call)(_saga18.sessionsSagaMock), (0, _effects.call)(_saga14.accountSettingsSagaMock), (0, _effects.call)(_saga15.tenantsSagasMock), (0, _effects.call)(_saga19.sessionsPolicySagaMock), (0, _effects.call)(_saga20.restrictionsSagaMock), (0, _effects.call)(_saga16.rolesSagasMock), (0, _effects.call)(_saga24.groupsSagasMock), (0, _effects.call)(_saga28.securityCenterSagasMock)]);
|
|
48
48
|
}
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.128.0",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
|
-
"@frontegg/rest-api": "3.1.
|
|
9
|
+
"@frontegg/rest-api": "3.1.11",
|
|
10
10
|
"@reduxjs/toolkit": "1.8.5",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"redux-saga": "^1.2.1",
|
|
@@ -24,10 +24,10 @@ export declare function loadSummaries(tenantId: string, forceActive?: boolean):
|
|
|
24
24
|
payload: string | null;
|
|
25
25
|
type: string;
|
|
26
26
|
}>, void, ISubscriptionSummariesResponse & [undefined, IPlanResponse] & ISubscriptionResponse & IPlanResponse>;
|
|
27
|
-
export declare function loadSummariesMock(): Generator<import("redux-saga/effects").PutEffect<{
|
|
27
|
+
export declare function loadSummariesMock(): Generator<import("redux-saga/effects").CallEffect<true> | import("redux-saga/effects").PutEffect<{
|
|
28
28
|
payload: boolean;
|
|
29
29
|
type: string;
|
|
30
|
-
}> | import("redux-saga/effects").
|
|
30
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
31
31
|
payload: Partial<import("./interfaces").BillingInformationState>;
|
|
32
32
|
type: string;
|
|
33
33
|
}>, void, unknown>;
|