quidproquo-web-admin 0.0.262 → 0.1.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/README.md +53 -41
- package/lib/commonjs/App/App.d.ts +2 -0
- package/lib/commonjs/App/App.js +3 -2
- package/lib/commonjs/Auth/Auth.d.ts +1 -1
- package/lib/commonjs/Auth/Auth.js +12 -4
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/AuthChallengeMfaSetup.d.ts +6 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/AuthChallengeMfaSetup.js +50 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/index.d.ts +1 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/index.js +17 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/authActionCreator.d.ts +3 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/authActionCreator.js +15 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/authChallengeReducer.d.ts +3 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/authChallengeReducer.js +19 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/authChallengeTypes.d.ts +25 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/authChallengeTypes.js +8 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/index.d.ts +4 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/index.js +20 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeAssociateSoftwareToken.d.ts +2 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeAssociateSoftwareToken.js +18 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeSendMfaSetupCode.d.ts +2 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeSendMfaSetupCode.js +24 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/authChallengeLogic.d.ts +8 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/authChallengeLogic.js +11 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/index.d.ts +1 -0
- package/lib/commonjs/Auth/AuthChallengeMfaSetup/logic/runtime/index.js +17 -0
- package/lib/commonjs/Auth/AuthChallengeNewPasswordRequired/AuthChallengeNewPasswordRequired.d.ts +1 -1
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/AuthChallengeSoftwareTokenMfa.d.ts +6 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/AuthChallengeSoftwareTokenMfa.js +36 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/index.d.ts +1 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/index.js +17 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/authActionCreator.d.ts +2 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/authActionCreator.js +8 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeReducer.d.ts +3 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeReducer.js +13 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeTypes.d.ts +15 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeTypes.js +7 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/index.d.ts +4 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/index.js +20 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/askAuthChallengeSendMfaCode.d.ts +2 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/askAuthChallengeSendMfaCode.js +22 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/authChallengeLogic.d.ts +6 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/authChallengeLogic.js +9 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/index.d.ts +1 -0
- package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/index.js +17 -0
- package/lib/commonjs/Auth/Login.d.ts +1 -1
- package/lib/commonjs/Config/Config.d.ts +2 -1
- package/lib/commonjs/FederatedAddon.d.ts +6 -0
- package/lib/commonjs/FederatedAddonProvider.d.ts +8 -0
- package/lib/commonjs/FederatedAddonProvider.js +21 -0
- package/lib/commonjs/LogViewer/ActionHistoryItem.d.ts +1 -1
- package/lib/commonjs/LogViewer/ActionHistoryItemTimeStamp.d.ts +1 -1
- package/lib/commonjs/LogViewer/ActionRender/ActionRender.d.ts +2 -2
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.d.ts +1 -1
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.d.ts +1 -1
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogs.d.ts +1 -1
- package/lib/commonjs/LogViewer/ConsoleLogViewer.d.ts +2 -2
- package/lib/commonjs/LogViewer/LogCorrelationTree.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogCorrelationTree.js +9 -1
- package/lib/commonjs/LogViewer/LogCorrelations.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogDetails.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogDialog/LogDialog.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogMetadataGrid.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogRawJson.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogSearch.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogSummary.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogSummaryDetails.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogSummaryDetails.js +8 -1
- package/lib/commonjs/LogViewer/LogSummaryReturn.d.ts +1 -1
- package/lib/commonjs/LogViewer/LogSummaryReturn.js +8 -1
- package/lib/commonjs/LogViewer/TopSection.d.ts +1 -1
- package/lib/commonjs/LogViewer/TruncatedText.d.ts +1 -1
- package/lib/commonjs/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.d.ts +8 -8
- package/lib/commonjs/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.js +47 -9
- package/lib/commonjs/LogViewer/charts/CostPerService.d.ts +1 -1
- package/lib/commonjs/LogViewer/charts/ErrorsByType.d.ts +1 -1
- package/lib/commonjs/LogViewer/charts/ErrorsOverTime.d.ts +1 -1
- package/lib/commonjs/LogViewer/charts/RequestsByService.d.ts +1 -1
- package/lib/commonjs/LogViewer/logic/index.d.ts +0 -1
- package/lib/commonjs/LogViewer/logic/index.js +0 -1
- package/lib/commonjs/components/AdminDialog.d.ts +1 -1
- package/lib/commonjs/components/AsyncButton.d.ts +2 -2
- package/lib/commonjs/components/DataGrid.d.ts +1 -1
- package/lib/commonjs/components/DataGridPagination/DataGridPagination.d.ts +1 -1
- package/lib/commonjs/components/LastSeen/LastSeen.d.ts +1 -1
- package/lib/commonjs/components/LoadingBox/LoadingBox.d.ts +1 -1
- package/lib/commonjs/components/MainLayout/MainLayout.d.ts +1 -1
- package/lib/commonjs/index.d.ts +2 -0
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/logic/platform/apiRequest.js +29 -19
- package/lib/commonjs/useFederatedAddon.js +4 -33
- package/lib/esm/App/App.d.ts +2 -0
- package/lib/esm/App/App.js +3 -2
- package/lib/esm/Auth/Auth.d.ts +1 -1
- package/lib/esm/Auth/Auth.js +8 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/AuthChallengeMfaSetup.d.ts +6 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/AuthChallengeMfaSetup.js +43 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/index.d.ts +1 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/index.js +1 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/authActionCreator.d.ts +3 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/authActionCreator.js +11 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/authChallengeReducer.d.ts +3 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/authChallengeReducer.js +16 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/authChallengeTypes.d.ts +25 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/authChallengeTypes.js +5 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/index.d.ts +4 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/index.js +4 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeAssociateSoftwareToken.d.ts +2 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeAssociateSoftwareToken.js +15 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeSendMfaSetupCode.d.ts +2 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeSendMfaSetupCode.js +21 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/authChallengeLogic.d.ts +8 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/authChallengeLogic.js +8 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/index.d.ts +1 -0
- package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/index.js +1 -0
- package/lib/esm/Auth/AuthChallengeNewPasswordRequired/AuthChallengeNewPasswordRequired.d.ts +1 -1
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/AuthChallengeSoftwareTokenMfa.d.ts +6 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/AuthChallengeSoftwareTokenMfa.js +27 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/index.d.ts +1 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/index.js +1 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/authActionCreator.d.ts +2 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/authActionCreator.js +5 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeReducer.d.ts +3 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeReducer.js +10 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeTypes.d.ts +15 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/authChallengeTypes.js +4 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/index.d.ts +4 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/index.js +4 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/askAuthChallengeSendMfaCode.d.ts +2 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/askAuthChallengeSendMfaCode.js +19 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/authChallengeLogic.d.ts +6 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/authChallengeLogic.js +6 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/index.d.ts +1 -0
- package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/index.js +1 -0
- package/lib/esm/Auth/Login.d.ts +1 -1
- package/lib/esm/Config/Config.d.ts +2 -1
- package/lib/esm/FederatedAddon.d.ts +6 -0
- package/lib/esm/FederatedAddonProvider.d.ts +8 -0
- package/lib/esm/FederatedAddonProvider.js +7 -0
- package/lib/esm/LogViewer/ActionHistoryItem.d.ts +1 -1
- package/lib/esm/LogViewer/ActionHistoryItemTimeStamp.d.ts +1 -1
- package/lib/esm/LogViewer/ActionRender/ActionRender.d.ts +2 -2
- package/lib/esm/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.d.ts +1 -1
- package/lib/esm/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.d.ts +1 -1
- package/lib/esm/LogViewer/AdminLogs/AdminLogs.d.ts +1 -1
- package/lib/esm/LogViewer/ConsoleLogViewer.d.ts +2 -2
- package/lib/esm/LogViewer/LogCorrelationTree.d.ts +1 -1
- package/lib/esm/LogViewer/LogCorrelationTree.js +9 -1
- package/lib/esm/LogViewer/LogCorrelations.d.ts +1 -1
- package/lib/esm/LogViewer/LogDetails.d.ts +1 -1
- package/lib/esm/LogViewer/LogDialog/LogDialog.d.ts +1 -1
- package/lib/esm/LogViewer/LogMetadataGrid.d.ts +1 -1
- package/lib/esm/LogViewer/LogRawJson.d.ts +1 -1
- package/lib/esm/LogViewer/LogSearch.d.ts +1 -1
- package/lib/esm/LogViewer/LogSummary.d.ts +1 -1
- package/lib/esm/LogViewer/LogSummaryDetails.d.ts +1 -1
- package/lib/esm/LogViewer/LogSummaryDetails.js +6 -2
- package/lib/esm/LogViewer/LogSummaryReturn.d.ts +1 -1
- package/lib/esm/LogViewer/LogSummaryReturn.js +6 -2
- package/lib/esm/LogViewer/TopSection.d.ts +1 -1
- package/lib/esm/LogViewer/TruncatedText.d.ts +1 -1
- package/lib/esm/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.d.ts +8 -8
- package/lib/esm/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.js +47 -9
- package/lib/esm/LogViewer/charts/CostPerService.d.ts +1 -1
- package/lib/esm/LogViewer/charts/ErrorsByType.d.ts +1 -1
- package/lib/esm/LogViewer/charts/ErrorsOverTime.d.ts +1 -1
- package/lib/esm/LogViewer/charts/RequestsByService.d.ts +1 -1
- package/lib/esm/LogViewer/logic/index.d.ts +0 -1
- package/lib/esm/LogViewer/logic/index.js +0 -1
- package/lib/esm/components/AdminDialog.d.ts +1 -1
- package/lib/esm/components/AsyncButton.d.ts +2 -2
- package/lib/esm/components/DataGrid.d.ts +1 -1
- package/lib/esm/components/DataGridPagination/DataGridPagination.d.ts +1 -1
- package/lib/esm/components/LastSeen/LastSeen.d.ts +1 -1
- package/lib/esm/components/LoadingBox/LoadingBox.d.ts +1 -1
- package/lib/esm/components/MainLayout/MainLayout.d.ts +1 -1
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/logic/platform/apiRequest.js +29 -16
- package/lib/esm/useFederatedAddon.js +4 -33
- package/package.json +11 -23
- package/lib/commonjs/LogViewer/logic/getFederationManifestUrl.d.ts +0 -3
- package/lib/commonjs/LogViewer/logic/getFederationManifestUrl.js +0 -19
- package/lib/esm/LogViewer/logic/getFederationManifestUrl.d.ts +0 -3
- package/lib/esm/LogViewer/logic/getFederationManifestUrl.js +0 -5
package/lib/commonjs/index.js
CHANGED
|
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./addonSupport"), exports);
|
|
18
18
|
__exportStar(require("./App"), exports);
|
|
19
19
|
__exportStar(require("./components"), exports);
|
|
20
|
+
__exportStar(require("./FederatedAddon"), exports);
|
|
21
|
+
__exportStar(require("./FederatedAddonProvider"), exports);
|
|
@@ -8,36 +8,46 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.externalRequestGet = exports.apiRequestGet = exports.apiRequestPost = void 0;
|
|
16
|
-
const
|
|
13
|
+
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
17
14
|
const getHeaders = (accessToken) => (Object.assign({ 'Content-Type': 'application/json' }, (accessToken ? { Authorization: `Bearer ${accessToken}` } : {})));
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return instance;
|
|
15
|
+
const unwrap = (response) => {
|
|
16
|
+
if (response.status < 200 || response.status >= 300) {
|
|
17
|
+
throw new Error(`Request failed with status ${response.status}`);
|
|
18
|
+
}
|
|
19
|
+
return response.data;
|
|
24
20
|
};
|
|
25
21
|
const apiRequestPost = (path, body, apiBaseUrl, accessToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
const
|
|
27
|
-
|
|
22
|
+
const response = yield (0, quidproquo_webserver_1.preformNetworkRequest)({
|
|
23
|
+
method: 'POST',
|
|
24
|
+
url: path,
|
|
25
|
+
basePath: apiBaseUrl,
|
|
26
|
+
headers: getHeaders(accessToken),
|
|
27
|
+
body,
|
|
28
|
+
responseType: 'json',
|
|
29
|
+
});
|
|
30
|
+
return unwrap(response);
|
|
28
31
|
});
|
|
29
32
|
exports.apiRequestPost = apiRequestPost;
|
|
30
33
|
const apiRequestGet = (path, apiBaseUrl, accessToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
const
|
|
32
|
-
|
|
34
|
+
const response = yield (0, quidproquo_webserver_1.preformNetworkRequest)({
|
|
35
|
+
method: 'GET',
|
|
36
|
+
url: path,
|
|
37
|
+
basePath: apiBaseUrl,
|
|
38
|
+
headers: getHeaders(accessToken),
|
|
39
|
+
responseType: 'json',
|
|
40
|
+
});
|
|
41
|
+
return unwrap(response);
|
|
33
42
|
});
|
|
34
43
|
exports.apiRequestGet = apiRequestGet;
|
|
35
44
|
const externalRequestGet = (path) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
const
|
|
37
|
-
|
|
45
|
+
const response = yield (0, quidproquo_webserver_1.preformNetworkRequest)({
|
|
46
|
+
method: 'GET',
|
|
47
|
+
url: path,
|
|
38
48
|
headers: getHeaders(),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
49
|
+
responseType: 'json',
|
|
50
|
+
});
|
|
51
|
+
return unwrap(response);
|
|
42
52
|
});
|
|
43
53
|
exports.externalRequestGet = externalRequestGet;
|
|
@@ -12,47 +12,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.useFederatedAddon = useFederatedAddon;
|
|
13
13
|
const quidproquo_web_react_1 = require("quidproquo-web-react");
|
|
14
14
|
const react_1 = require("react");
|
|
15
|
-
const
|
|
16
|
-
const logic_1 = require("./LogViewer/logic");
|
|
15
|
+
const FederatedAddonProvider_1 = require("./FederatedAddonProvider");
|
|
17
16
|
function useFederatedAddon() {
|
|
18
17
|
const [federatedAddons, setFederatedAddons] = (0, react_1.useState)([]);
|
|
19
18
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
20
19
|
const accessToken = (0, quidproquo_web_react_1.useAuthAccessToken)();
|
|
21
20
|
const baseUrlResolvers = (0, quidproquo_web_react_1.useBaseUrlResolvers)();
|
|
21
|
+
const loadAddons = (0, FederatedAddonProvider_1.useLoadFederatedAddons)();
|
|
22
22
|
(0, react_1.useEffect)(() => {
|
|
23
23
|
const doAsyncWork = () => __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
setLoading(true);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
if (!manifestUrl) {
|
|
28
|
-
console.log(`Missing manifest Url`);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
console.log(`Reading manifest: [${manifestUrl}]`);
|
|
32
|
-
const manifest = yield (0, logic_1.getFederationManifest)(baseUrlResolvers.getApiUrl(), manifestUrl);
|
|
33
|
-
if (!manifest.id) {
|
|
34
|
-
console.log(`Manifest missing id`);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
// Update the remote
|
|
38
|
-
console.log(`Updating remote: [${manifest.id}]`);
|
|
39
|
-
(0, runtime_1.registerRemotes)([
|
|
40
|
-
{
|
|
41
|
-
name: manifest.id,
|
|
42
|
-
entry: manifestUrl,
|
|
43
|
-
},
|
|
44
|
-
], { force: true });
|
|
45
|
-
// Load the remote
|
|
46
|
-
console.log(`Loading remote: [${manifest.id}]`);
|
|
47
|
-
const remote = yield (0, runtime_1.loadRemote)(`${manifest.id}/shared`, {
|
|
48
|
-
from: 'runtime',
|
|
49
|
-
});
|
|
50
|
-
if (remote && typeof remote === 'object') {
|
|
51
|
-
const allAddons = Object.values(remote)
|
|
52
|
-
.filter((possibleAddon) => typeof possibleAddon === 'object')
|
|
53
|
-
.filter((possibleAddon) => possibleAddon.isQpqAdminFederatedAddon);
|
|
54
|
-
setFederatedAddons(allAddons);
|
|
55
|
-
}
|
|
25
|
+
const addons = yield loadAddons({ baseUrlResolvers, accessToken });
|
|
26
|
+
setFederatedAddons(addons);
|
|
56
27
|
});
|
|
57
28
|
doAsyncWork()
|
|
58
29
|
.catch((e) => {
|
package/lib/esm/App/App.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BaseUrlResolvers } from 'quidproquo-web-react';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { LoadFederatedAddons } from '../FederatedAddon';
|
|
3
4
|
export type AppProps = {
|
|
4
5
|
urlResolvers: BaseUrlResolvers;
|
|
6
|
+
loadAddons?: LoadFederatedAddons;
|
|
5
7
|
};
|
|
6
8
|
export declare const App: React.FC<AppProps>;
|
package/lib/esm/App/App.js
CHANGED
|
@@ -6,6 +6,7 @@ import CssBaseline from '@mui/material/CssBaseline';
|
|
|
6
6
|
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
|
7
7
|
import { Auth } from '../Auth/Auth';
|
|
8
8
|
import { MainLayout } from '../components';
|
|
9
|
+
import { FederatedAddonProvider } from '../FederatedAddonProvider';
|
|
9
10
|
import { baseUrlsContext } from '../platformLogic/contexts';
|
|
10
11
|
import { LoadingProvider } from '../view';
|
|
11
12
|
import { WebSocketAuthProvider } from '../WebSocketAuthProvider';
|
|
@@ -14,10 +15,10 @@ const darkTheme = createTheme({
|
|
|
14
15
|
mode: 'light',
|
|
15
16
|
},
|
|
16
17
|
});
|
|
17
|
-
export const App = ({ urlResolvers }) => {
|
|
18
|
+
export const App = ({ urlResolvers, loadAddons }) => {
|
|
18
19
|
const baseUrls = useMemo(() => ({
|
|
19
20
|
api: urlResolvers.getApiUrl(),
|
|
20
21
|
ws: urlResolvers.getWsUrl(),
|
|
21
22
|
}), [urlResolvers]);
|
|
22
|
-
return (_jsx(QpqContextProvider, { contextIdentifier: baseUrlsContext, value: baseUrls, children: _jsx(Router, { children: _jsx(BaseUrlProvider, { urlResolvers: urlResolvers, children: _jsxs(ThemeProvider, { theme: darkTheme, children: [_jsx(CssBaseline, {}), _jsx(LoadingProvider, { children: _jsx(Auth, { children: _jsx(WebsocketProvider, { wsUrl: urlResolvers.getWsUrl(), children: _jsx(WebSocketAuthProvider, { children: _jsx(MainLayout, {}) }) }) }) })] }) }) }) }));
|
|
23
|
+
return (_jsx(QpqContextProvider, { contextIdentifier: baseUrlsContext, value: baseUrls, children: _jsx(Router, { children: _jsx(BaseUrlProvider, { urlResolvers: urlResolvers, children: _jsxs(ThemeProvider, { theme: darkTheme, children: [_jsx(CssBaseline, {}), _jsx(LoadingProvider, { children: _jsx(Auth, { children: _jsx(WebsocketProvider, { wsUrl: urlResolvers.getWsUrl(), children: _jsx(WebSocketAuthProvider, { children: _jsx(FederatedAddonProvider, { loadAddons: loadAddons, children: _jsx(MainLayout, {}) }) }) }) }) })] }) }) }) }));
|
|
23
24
|
};
|
package/lib/esm/Auth/Auth.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
interface AuthProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
}
|
|
5
|
-
export declare function Auth({ children }: AuthProps): import("react
|
|
5
|
+
export declare function Auth({ children }: AuthProps): import("react").JSX.Element;
|
|
6
6
|
export {};
|
package/lib/esm/Auth/Auth.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { AuthenticateUserChallenge } from 'quidproquo-core';
|
|
3
3
|
import { authContext, createQpqRuntimeDefinition, QpqRuntimeEffectCatcher, useQpqRuntime } from 'quidproquo-web-react';
|
|
4
|
+
import { AuthChallengeMfaSetup } from './AuthChallengeMfaSetup/AuthChallengeMfaSetup';
|
|
4
5
|
import { AuthChallengeNewPasswordRequired } from './AuthChallengeNewPasswordRequired/AuthChallengeNewPasswordRequired';
|
|
6
|
+
import { AuthChallengeSoftwareTokenMfa } from './AuthChallengeSoftwareTokenMfa/AuthChallengeSoftwareTokenMfa';
|
|
5
7
|
import { isLoggedOn } from './logic/isLoggedOn';
|
|
6
8
|
import { askAuthMain } from './logic/runtime/askAuthMain';
|
|
7
9
|
import { authInitalState, authLogic, authReducer } from './logic';
|
|
@@ -13,6 +15,12 @@ export function Auth({ children }) {
|
|
|
13
15
|
if (state.authenticateUserResponse?.challenge === AuthenticateUserChallenge.NEW_PASSWORD_REQUIRED) {
|
|
14
16
|
return (_jsx(QpqRuntimeEffectCatcher, { runtime: authRuntime, children: _jsx(AuthChallengeNewPasswordRequired, { authState: state }) }));
|
|
15
17
|
}
|
|
18
|
+
if (state.authenticateUserResponse?.challenge === AuthenticateUserChallenge.SOFTWARE_TOKEN_MFA) {
|
|
19
|
+
return (_jsx(QpqRuntimeEffectCatcher, { runtime: authRuntime, children: _jsx(AuthChallengeSoftwareTokenMfa, { authState: state }) }));
|
|
20
|
+
}
|
|
21
|
+
if (state.authenticateUserResponse?.challenge === AuthenticateUserChallenge.MFA_SETUP) {
|
|
22
|
+
return (_jsx(QpqRuntimeEffectCatcher, { runtime: authRuntime, children: _jsx(AuthChallengeMfaSetup, { authState: state }) }));
|
|
23
|
+
}
|
|
16
24
|
return (_jsxs(QpqRuntimeEffectCatcher, { runtime: authRuntime, children: [!isAuthenticated && (_jsx(Login, { setUsername: api.authUISetUsername, setPassword: api.authUISetPassword, username: state.username, password: state.password, onLogin: api.authLogin })), isAuthenticated && (_jsx(authContext.Provider, { value: {
|
|
17
25
|
challenge: state.authenticateUserResponse?.challenge,
|
|
18
26
|
session: state.authenticateUserResponse?.session,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createQpqRuntimeDefinition, useQpqRuntime } from 'quidproquo-web-react';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import LockIcon from '@mui/icons-material/Lock';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
import Grid from '@mui/material/Grid';
|
|
7
|
+
import TextField from '@mui/material/TextField';
|
|
8
|
+
import Typography from '@mui/material/Typography';
|
|
9
|
+
import { AsyncButton } from '../../components';
|
|
10
|
+
import { authChallengeMfaSetupInitalState, authChallengeMfaSetupLogic, authChallengeMfaSetupReducer } from './logic';
|
|
11
|
+
const atom = createQpqRuntimeDefinition(authChallengeMfaSetupLogic, authChallengeMfaSetupInitalState, authChallengeMfaSetupReducer);
|
|
12
|
+
// otpauth:// URI consumed by authenticator apps when scanning / importing.
|
|
13
|
+
const buildOtpAuthUri = (email, secretCode) => {
|
|
14
|
+
const issuer = window.location.host;
|
|
15
|
+
const label = encodeURIComponent(`${issuer}:${email}`);
|
|
16
|
+
return `otpauth://totp/${label}?secret=${secretCode}&issuer=${encodeURIComponent(issuer)}`;
|
|
17
|
+
};
|
|
18
|
+
export function AuthChallengeMfaSetup({ authState }) {
|
|
19
|
+
const [api, state] = useQpqRuntime(atom);
|
|
20
|
+
const isCodeValid = /^\d{6}$/.test(state.mfaCode);
|
|
21
|
+
const challenge = authState.authenticateUserResponse?.challenge;
|
|
22
|
+
const session = authState.authenticateUserResponse?.session;
|
|
23
|
+
// Associate a software token once, using the MFA_SETUP challenge session.
|
|
24
|
+
const hasAssociated = useRef(false);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!hasAssociated.current && session) {
|
|
27
|
+
hasAssociated.current = true;
|
|
28
|
+
api.authChallengeAssociateSoftwareToken(session);
|
|
29
|
+
}
|
|
30
|
+
}, [api, session]);
|
|
31
|
+
if (!challenge || !session) {
|
|
32
|
+
return _jsx("div", { children: "Error, missing challenge / session" });
|
|
33
|
+
}
|
|
34
|
+
return (_jsx(Box, { sx: {
|
|
35
|
+
height: '100vh',
|
|
36
|
+
width: '100%',
|
|
37
|
+
p: 2,
|
|
38
|
+
display: 'flex',
|
|
39
|
+
flexDirection: 'column',
|
|
40
|
+
justifyContent: 'center',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
}, children: _jsx(Box, { component: "form", sx: { width: '100%', maxWidth: 360 }, children: _jsxs(Grid, { container: true, spacing: 2, children: [_jsx(Grid, { item: true, xs: 12, children: _jsxs(Typography, { variant: "h5", gutterBottom: true, sx: { display: 'flex', alignItems: 'center' }, children: [_jsx(LockIcon, { sx: { marginRight: 1 } }), "Set Up Authenticator"] }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(Typography, { variant: "body2", color: "text.secondary", children: "Add this account to your authenticator app, then enter the 6-digit code it generates." }) }), _jsxs(Grid, { item: true, xs: 12, children: [_jsx(Typography, { variant: "caption", color: "text.secondary", children: "Secret key" }), _jsx(Typography, { variant: "body1", sx: { fontFamily: 'monospace', wordBreak: 'break-all' }, children: state.secretCode || 'Loading…' })] }), state.secretCode && (_jsx(Grid, { item: true, xs: 12, children: _jsx(Typography, { variant: "caption", color: "text.secondary", sx: { wordBreak: 'break-all' }, children: buildOtpAuthUri(authState.username, state.secretCode) }) })), _jsx(Grid, { item: true, xs: 12, children: _jsx(TextField, { required: true, fullWidth: true, id: "mfaCode", label: "Authentication Code", autoFocus: true, inputProps: { inputMode: 'numeric', pattern: '[0-9]*', maxLength: 6 }, value: state.mfaCode, onChange: (event) => api.authChallengeSetMfaSetupCode(event.target.value.replace(/\D/g, '')) }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(AsyncButton, { onClick: () => api.authChallengeSendMfaSetupCode(challenge, authState.username), disabled: !isCodeValid || !state.secretCode, children: "Verify" }) })] }) }) }));
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AuthChallengeMfaSetup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AuthChallengeMfaSetup';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { askStateDispatchEffect } from 'quidproquo-core';
|
|
2
|
+
import { AuthChallengeMfaSetupEffect, } from './authChallengeTypes';
|
|
3
|
+
export function* askAuthChallengeSetMfaSetupCode(mfaCode) {
|
|
4
|
+
yield* askStateDispatchEffect(AuthChallengeMfaSetupEffect.SetMfaCode, mfaCode);
|
|
5
|
+
}
|
|
6
|
+
export function* askAuthChallengeSetMfaSetupAssociation(secretCode, session) {
|
|
7
|
+
yield* askStateDispatchEffect(AuthChallengeMfaSetupEffect.SetAssociation, {
|
|
8
|
+
secretCode,
|
|
9
|
+
session,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AuthChallengeMfaSetupEffects, AuthChallengeMfaSetupState } from './authChallengeTypes';
|
|
2
|
+
export declare const authChallengeMfaSetupInitalState: AuthChallengeMfaSetupState;
|
|
3
|
+
export declare const authChallengeMfaSetupReducer: (state: AuthChallengeMfaSetupState, effect: AuthChallengeMfaSetupEffects) => [AuthChallengeMfaSetupState, boolean];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { buildMutableEffectReducer } from 'quidproquo-core';
|
|
2
|
+
import { AuthChallengeMfaSetupEffect } from './authChallengeTypes';
|
|
3
|
+
export const authChallengeMfaSetupInitalState = {
|
|
4
|
+
secretCode: '',
|
|
5
|
+
session: '',
|
|
6
|
+
mfaCode: '',
|
|
7
|
+
};
|
|
8
|
+
export const authChallengeMfaSetupReducer = buildMutableEffectReducer({
|
|
9
|
+
[AuthChallengeMfaSetupEffect.SetMfaCode]: (state, mfaCode) => {
|
|
10
|
+
state.mfaCode = mfaCode;
|
|
11
|
+
},
|
|
12
|
+
[AuthChallengeMfaSetupEffect.SetAssociation]: (state, { secretCode, session }) => {
|
|
13
|
+
state.secretCode = secretCode;
|
|
14
|
+
state.session = session;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from 'quidproquo-core';
|
|
2
|
+
export type AuthChallengeMfaSetupState = {
|
|
3
|
+
secretCode: string;
|
|
4
|
+
session: string;
|
|
5
|
+
mfaCode: string;
|
|
6
|
+
};
|
|
7
|
+
export declare enum AuthChallengeMfaSetupEffect {
|
|
8
|
+
SetMfaCode = "authMfaSetup/SetMfaCode",
|
|
9
|
+
SetAssociation = "authMfaSetup/SetAssociation"
|
|
10
|
+
}
|
|
11
|
+
export type AuthChallengeMfaSetupSetMfaCodeEffect = Effect<AuthChallengeMfaSetupEffect.SetMfaCode, string>;
|
|
12
|
+
export type AuthChallengeMfaSetupSetAssociationEffect = Effect<AuthChallengeMfaSetupEffect.SetAssociation, {
|
|
13
|
+
secretCode: string;
|
|
14
|
+
session: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type AuthChallengeMfaSetupEffects = AuthChallengeMfaSetupSetMfaCodeEffect | AuthChallengeMfaSetupSetAssociationEffect;
|
|
17
|
+
export type AuthChallengeAssociateSoftwareTokenPayload = {
|
|
18
|
+
session: string;
|
|
19
|
+
};
|
|
20
|
+
export type AuthChallengeSendMfaSetupCodePayload = {
|
|
21
|
+
email: string;
|
|
22
|
+
session: string;
|
|
23
|
+
challenge: string;
|
|
24
|
+
mfaCode: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export var AuthChallengeMfaSetupEffect;
|
|
2
|
+
(function (AuthChallengeMfaSetupEffect) {
|
|
3
|
+
AuthChallengeMfaSetupEffect["SetMfaCode"] = "authMfaSetup/SetMfaCode";
|
|
4
|
+
AuthChallengeMfaSetupEffect["SetAssociation"] = "authMfaSetup/SetAssociation";
|
|
5
|
+
})(AuthChallengeMfaSetupEffect || (AuthChallengeMfaSetupEffect = {}));
|
package/lib/esm/Auth/AuthChallengeMfaSetup/logic/runtime/askAuthChallengeAssociateSoftwareToken.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { askPlatformRequest } from '../../../../platformLogic';
|
|
2
|
+
import { askAuthChallengeSetMfaSetupAssociation } from '../authActionCreator';
|
|
3
|
+
// Kicks off TOTP enrollment: trades the MFA_SETUP challenge session for the
|
|
4
|
+
// shared secret (to show as a QR / manual key) and a refreshed session.
|
|
5
|
+
export function* askAuthChallengeAssociateSoftwareToken(session) {
|
|
6
|
+
const response = yield* askPlatformRequest('POST', '/associateSoftwareToken', {
|
|
7
|
+
body: {
|
|
8
|
+
session,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
if (response.status < 200 || response.status >= 300) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
yield* askAuthChallengeSetMfaSetupAssociation(response.data.secretCode, response.data.session);
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { askStateRead } from 'quidproquo-core';
|
|
2
|
+
import { askPlatformRequest, askSaveAuthToken } from '../../../../platformLogic';
|
|
3
|
+
import { askAuthUISetAuthInfo } from '../../../logic';
|
|
4
|
+
// Completes MFA_SETUP. Sends the first TOTP code together with the refreshed
|
|
5
|
+
// session from the associate step; the server verifies the code and finishes login.
|
|
6
|
+
export function* askAuthChallengeSendMfaSetupCode(challenge, email) {
|
|
7
|
+
const { mfaCode, session } = yield* askStateRead('');
|
|
8
|
+
const response = yield* askPlatformRequest('POST', '/challenge', {
|
|
9
|
+
body: {
|
|
10
|
+
challenge,
|
|
11
|
+
email,
|
|
12
|
+
mfaCode,
|
|
13
|
+
session,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
if (response.status < 200 || response.status >= 300) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
yield* askSaveAuthToken(response.data);
|
|
20
|
+
yield* askAuthUISetAuthInfo(response.data);
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { askAuthChallengeSetMfaSetupCode } from '../authActionCreator';
|
|
2
|
+
import { askAuthChallengeAssociateSoftwareToken } from './askAuthChallengeAssociateSoftwareToken';
|
|
3
|
+
import { askAuthChallengeSendMfaSetupCode } from './askAuthChallengeSendMfaSetupCode';
|
|
4
|
+
export declare const authChallengeMfaSetupLogic: {
|
|
5
|
+
askAuthChallengeSetMfaSetupCode: typeof askAuthChallengeSetMfaSetupCode;
|
|
6
|
+
askAuthChallengeAssociateSoftwareToken: typeof askAuthChallengeAssociateSoftwareToken;
|
|
7
|
+
askAuthChallengeSendMfaSetupCode: typeof askAuthChallengeSendMfaSetupCode;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { askAuthChallengeSetMfaSetupCode } from '../authActionCreator';
|
|
2
|
+
import { askAuthChallengeAssociateSoftwareToken } from './askAuthChallengeAssociateSoftwareToken';
|
|
3
|
+
import { askAuthChallengeSendMfaSetupCode } from './askAuthChallengeSendMfaSetupCode';
|
|
4
|
+
export const authChallengeMfaSetupLogic = {
|
|
5
|
+
askAuthChallengeSetMfaSetupCode,
|
|
6
|
+
askAuthChallengeAssociateSoftwareToken,
|
|
7
|
+
askAuthChallengeSendMfaSetupCode,
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './authChallengeLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './authChallengeLogic';
|
|
@@ -2,5 +2,5 @@ import { AuthState } from '../logic';
|
|
|
2
2
|
interface AuthChallengeNewPasswordRequiredProps {
|
|
3
3
|
authState: AuthState;
|
|
4
4
|
}
|
|
5
|
-
export declare function AuthChallengeNewPasswordRequired({ authState }: AuthChallengeNewPasswordRequiredProps): import("react
|
|
5
|
+
export declare function AuthChallengeNewPasswordRequired({ authState }: AuthChallengeNewPasswordRequiredProps): import("react").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
|
|
3
|
+
import { createQpqRuntimeDefinition, useQpqRuntime } from 'quidproquo-web-react';
|
|
4
|
+
import LockIcon from '@mui/icons-material/Lock';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
import Grid from '@mui/material/Grid';
|
|
7
|
+
import TextField from '@mui/material/TextField';
|
|
8
|
+
import Typography from '@mui/material/Typography';
|
|
9
|
+
import { AsyncButton } from '../../components';
|
|
10
|
+
import { authChallengeMfaInitalState, authChallengeMfaLogic, authChallengeMfaReducer } from './logic';
|
|
11
|
+
const atom = createQpqRuntimeDefinition(authChallengeMfaLogic, authChallengeMfaInitalState, authChallengeMfaReducer);
|
|
12
|
+
export function AuthChallengeSoftwareTokenMfa({ authState }) {
|
|
13
|
+
const [api, state] = useQpqRuntime(atom);
|
|
14
|
+
const isCodeValid = /^\d{6}$/.test(state.mfaCode);
|
|
15
|
+
if (!authState.authenticateUserResponse || !authState.authenticateUserResponse.challenge || !authState.authenticateUserResponse.session) {
|
|
16
|
+
return _jsx("div", { children: "Error, missing challenge / session" });
|
|
17
|
+
}
|
|
18
|
+
return (_jsx(Box, { sx: {
|
|
19
|
+
height: '100vh',
|
|
20
|
+
width: '100%',
|
|
21
|
+
p: 2,
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
}, children: _jsx(Box, { component: "form", sx: { width: '100%', maxWidth: 360 }, children: _jsxs(Grid, { container: true, spacing: 2, children: [_jsx(Grid, { item: true, xs: 12, children: _jsxs(Typography, { variant: "h5", gutterBottom: true, sx: { display: 'flex', alignItems: 'center' }, children: [_jsx(LockIcon, { sx: { marginRight: 1 } }), "Verification Code"] }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(Typography, { variant: "body2", color: "text.secondary", children: "Enter the 6-digit code from your authenticator app." }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(TextField, { required: true, fullWidth: true, id: "mfaCode", label: "Authentication Code", autoFocus: true, inputProps: { inputMode: 'numeric', pattern: '[0-9]*', maxLength: 6 }, value: state.mfaCode, onChange: (event) => api.authChallengeSetMfaCode(event.target.value.replace(/\D/g, '')) }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(AsyncButton, { onClick: () => api.authChallengeSendMfaCode(authState.authenticateUserResponse?.challenge, authState.authenticateUserResponse?.session, authState.username), disabled: !isCodeValid, children: "Verify" }) })] }) }) }));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AuthChallengeSoftwareTokenMfa';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AuthChallengeSoftwareTokenMfa';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AuthChallengeMfaState } from './authChallengeTypes';
|
|
2
|
+
export declare const authChallengeMfaInitalState: AuthChallengeMfaState;
|
|
3
|
+
export declare const authChallengeMfaReducer: (state: AuthChallengeMfaState, effect: import("./authChallengeTypes").AuthChallengeSetMfaCodeEffect) => [AuthChallengeMfaState, boolean];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { buildMutableEffectReducer } from 'quidproquo-core';
|
|
2
|
+
import { AuthChallengeMfaEffect } from './authChallengeTypes';
|
|
3
|
+
export const authChallengeMfaInitalState = {
|
|
4
|
+
mfaCode: '',
|
|
5
|
+
};
|
|
6
|
+
export const authChallengeMfaReducer = buildMutableEffectReducer({
|
|
7
|
+
[AuthChallengeMfaEffect.SetMfaCode]: (state, mfaCode) => {
|
|
8
|
+
state.mfaCode = mfaCode;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Effect } from 'quidproquo-core';
|
|
2
|
+
export type AuthChallengeMfaState = {
|
|
3
|
+
mfaCode: string;
|
|
4
|
+
};
|
|
5
|
+
export declare enum AuthChallengeMfaEffect {
|
|
6
|
+
SetMfaCode = "authMfa/SetMfaCode"
|
|
7
|
+
}
|
|
8
|
+
export type AuthChallengeSetMfaCodeEffect = Effect<AuthChallengeMfaEffect.SetMfaCode, string>;
|
|
9
|
+
export type AuthChallengeMfaEffects = AuthChallengeSetMfaCodeEffect;
|
|
10
|
+
export type AuthChallengeSendMfaCodePayload = {
|
|
11
|
+
email: string;
|
|
12
|
+
session: string;
|
|
13
|
+
challenge: string;
|
|
14
|
+
mfaCode: string;
|
|
15
|
+
};
|
package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/logic/runtime/askAuthChallengeSendMfaCode.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { askStateRead } from 'quidproquo-core';
|
|
2
|
+
import { askPlatformRequest, askSaveAuthToken } from '../../../../platformLogic';
|
|
3
|
+
import { askAuthUISetAuthInfo } from '../../../logic';
|
|
4
|
+
export function* askAuthChallengeSendMfaCode(challenge, session, email) {
|
|
5
|
+
const { mfaCode } = yield* askStateRead('');
|
|
6
|
+
const response = yield* askPlatformRequest('POST', '/challenge', {
|
|
7
|
+
body: {
|
|
8
|
+
challenge,
|
|
9
|
+
email,
|
|
10
|
+
mfaCode,
|
|
11
|
+
session,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
if (response.status < 200 || response.status >= 300) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
yield* askSaveAuthToken(response.data);
|
|
18
|
+
yield* askAuthUISetAuthInfo(response.data);
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { askAuthChallengeSetMfaCode } from '../authActionCreator';
|
|
2
|
+
import { askAuthChallengeSendMfaCode } from './askAuthChallengeSendMfaCode';
|
|
3
|
+
export declare const authChallengeMfaLogic: {
|
|
4
|
+
askAuthChallengeSetMfaCode: typeof askAuthChallengeSetMfaCode;
|
|
5
|
+
askAuthChallengeSendMfaCode: typeof askAuthChallengeSendMfaCode;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './authChallengeLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './authChallengeLogic';
|
package/lib/esm/Auth/Login.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ interface LoginProps {
|
|
|
5
5
|
setPassword: (password: string) => void;
|
|
6
6
|
onLogin: () => Promise<void>;
|
|
7
7
|
}
|
|
8
|
-
export declare function Login({ username, password, setUsername, setPassword, onLogin }: LoginProps): import("react
|
|
8
|
+
export declare function Login({ username, password, setUsername, setPassword, onLogin }: LoginProps): import("react").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BaseUrlResolvers } from 'quidproquo-web-react';
|
|
1
2
|
export type FederatedTab = {
|
|
2
3
|
name: string;
|
|
3
4
|
View: React.ComponentType;
|
|
@@ -7,3 +8,8 @@ export type FederatedAddon = {
|
|
|
7
8
|
tab: FederatedTab;
|
|
8
9
|
isQpqAdminFederatedAddon: boolean;
|
|
9
10
|
};
|
|
11
|
+
export type LoadFederatedAddonsContext = {
|
|
12
|
+
baseUrlResolvers: BaseUrlResolvers;
|
|
13
|
+
accessToken?: string;
|
|
14
|
+
};
|
|
15
|
+
export type LoadFederatedAddons = (context: LoadFederatedAddonsContext) => Promise<FederatedAddon[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LoadFederatedAddons } from './FederatedAddon';
|
|
3
|
+
export type FederatedAddonProviderProps = {
|
|
4
|
+
loadAddons?: LoadFederatedAddons;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const FederatedAddonProvider: React.FC<FederatedAddonProviderProps>;
|
|
8
|
+
export declare const useLoadFederatedAddons: () => LoadFederatedAddons;
|