quidproquo-webserver 0.0.263 → 0.1.1
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/lib/commonjs/actionProcessor/api/getHttpApiEventAutoRespondActionProcessor.js +1 -2
- package/lib/commonjs/actionProcessor/api/getHttpApiEventGetStorySessionActionProcessor.js +1 -2
- package/lib/commonjs/actionProcessor/routeAuthValidation/getRouteAuthValidationDecodeActionProcessor.js +1 -2
- package/lib/commonjs/actions/index.d.ts +0 -1
- package/lib/commonjs/actions/index.js +0 -1
- package/lib/commonjs/config/QPQConfig.d.ts +2 -1
- package/lib/commonjs/config/QPQConfig.js +1 -0
- package/lib/commonjs/config/settings/{logs.d.ts → defineAdminSettings/defineAdminSettings.d.ts} +2 -2
- package/lib/commonjs/config/settings/defineAdminSettings/defineAdminSettings.js +127 -0
- package/lib/commonjs/config/settings/defineAdminSettings/index.d.ts +1 -0
- package/lib/commonjs/config/settings/{defineExposeAdminAdvancedSettings → defineAdminSettings}/index.js +1 -1
- package/lib/commonjs/config/settings/defineAuthSystem/defineAuthSystem.d.ts +10 -0
- package/lib/commonjs/config/settings/defineAuthSystem/defineAuthSystem.js +46 -0
- package/lib/commonjs/config/settings/defineAuthSystem/index.d.ts +1 -0
- package/lib/commonjs/{actions/extract → config/settings/defineAuthSystem}/index.js +1 -3
- package/lib/commonjs/config/settings/index.d.ts +3 -2
- package/lib/commonjs/config/settings/index.js +3 -2
- package/lib/commonjs/config/settings/migration.js +1 -1
- package/lib/commonjs/config/settings/storageDriveCorsSettings.d.ts +19 -0
- package/lib/commonjs/config/settings/storageDriveCorsSettings.js +16 -0
- package/lib/commonjs/config/settings/webEntry.d.ts +8 -0
- package/lib/commonjs/config/settings/webEntry.js +1 -0
- package/lib/commonjs/services/auth/config/constants.d.ts +1 -0
- package/lib/commonjs/services/auth/config/constants.js +7 -0
- package/lib/commonjs/services/auth/config/defineAuthServiceRoute.d.ts +4 -0
- package/lib/commonjs/services/auth/config/defineAuthServiceRoute.js +10 -0
- package/lib/commonjs/services/auth/config/index.d.ts +2 -0
- package/lib/commonjs/services/auth/config/index.js +18 -0
- package/lib/commonjs/services/auth/entry/controller/authController.d.ts +9 -0
- package/lib/commonjs/services/auth/entry/controller/authController.js +81 -0
- package/lib/commonjs/services/auth/index.d.ts +2 -0
- package/lib/commonjs/services/auth/index.js +18 -0
- package/lib/commonjs/services/auth/logic/auth/askAssociateSoftwareToken.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askAssociateSoftwareToken.js +9 -0
- package/lib/commonjs/services/auth/logic/auth/askChangePassword.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askChangePassword.js +9 -0
- package/lib/commonjs/services/auth/logic/auth/askConfirmForgotPassword.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askConfirmForgotPassword.js +10 -0
- package/lib/commonjs/services/auth/logic/auth/askForgotPassword.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askForgotPassword.js +10 -0
- package/lib/commonjs/services/auth/logic/auth/askGetAuthUserDirectoryName.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askGetAuthUserDirectoryName.js +8 -0
- package/lib/commonjs/services/auth/logic/auth/askLogin.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askLogin.js +10 -0
- package/lib/commonjs/services/auth/logic/auth/askRefreshToken.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askRefreshToken.js +10 -0
- package/lib/commonjs/services/auth/logic/auth/askRespondToAuthChallenge.d.ts +2 -0
- package/lib/commonjs/services/auth/logic/auth/askRespondToAuthChallenge.js +9 -0
- package/lib/commonjs/services/auth/logic/auth/index.d.ts +8 -0
- package/lib/commonjs/services/auth/logic/auth/index.js +24 -0
- package/lib/commonjs/services/auth/logic/index.d.ts +1 -0
- package/lib/commonjs/services/auth/logic/index.js +37 -0
- package/lib/commonjs/services/auth/types/challengePayloadGuards.d.ts +4 -0
- package/lib/commonjs/services/auth/types/challengePayloadGuards.js +10 -0
- package/lib/commonjs/services/auth/types/index.d.ts +2 -0
- package/lib/commonjs/services/auth/types/index.js +18 -0
- package/lib/commonjs/services/auth/types/types.d.ts +41 -0
- package/lib/commonjs/services/getServiceEntryQpqFunctionRuntime.d.ts +2 -2
- package/lib/commonjs/services/index.d.ts +1 -0
- package/lib/commonjs/services/index.js +1 -0
- package/lib/commonjs/services/log/entry/controller/logController.js +3 -3
- package/lib/commonjs/services/log/entry/data/logData.js +1 -2
- package/lib/commonjs/services/log/entry/data/logLogData.js +1 -1
- package/lib/commonjs/services/log/entry/data/logMetadataData.js +4 -5
- package/lib/commonjs/services/log/logic/logs/askGetLogs.js +1 -1
- package/lib/commonjs/services/log/logic/notifyError/askProcessOnError.js +1 -1
- package/lib/commonjs/services/log/logic/notifyError/askProcessOnThrottle.js +1 -1
- package/lib/commonjs/services/log/logic/notifyError/askProcessOnTimeout.js +1 -1
- package/lib/commonjs/services/webSocketQueue/logic/webSocket/messageProcessors/askProcessOnAuthenticate.js +12 -1
- package/lib/commonjs/services/webSocketQueue/logic/webSocket/messageProcessors/askProcessOnUnauthenticate.js +4 -0
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageAuthenticated.d.ts +4 -0
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageAuthenticated.js +2 -0
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageUnauthenticated.d.ts +4 -0
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageUnauthenticated.js +2 -0
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/WebSocketQueueServerMessageEventType.d.ts +3 -1
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/WebSocketQueueServerMessageEventType.js +2 -0
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/index.d.ts +2 -0
- package/lib/commonjs/services/webSocketQueue/types/serverMessages/index.js +2 -0
- package/lib/commonjs/stories/askGetHttpApiEventStorySession.js +1 -1
- package/lib/commonjs/utils/headerUtils.js +10 -3
- package/lib/commonjs/utils/httpEventUtils.js +2 -2
- package/lib/commonjs/utils/index.d.ts +2 -1
- package/lib/commonjs/utils/index.js +2 -1
- package/lib/commonjs/utils/jwtUtils.d.ts +2 -1
- package/lib/commonjs/utils/jwtUtils.js +3 -2
- package/lib/commonjs/utils/networkRequestUtils.d.ts +2 -0
- package/lib/commonjs/utils/networkRequestUtils.js +142 -0
- package/lib/commonjs/utils/preformNetworkRequest.d.ts +2 -0
- package/lib/commonjs/utils/preformNetworkRequest.js +29 -0
- package/lib/commonjs/utils/qpqConfigAccessorsUtils.d.ts +16 -0
- package/lib/commonjs/utils/qpqConfigAccessorsUtils.js +33 -1
- package/lib/esm/actionProcessor/api/getHttpApiEventAutoRespondActionProcessor.js +2 -3
- package/lib/esm/actionProcessor/api/getHttpApiEventGetStorySessionActionProcessor.js +2 -3
- package/lib/esm/actionProcessor/routeAuthValidation/getRouteAuthValidationDecodeActionProcessor.js +2 -3
- package/lib/esm/actions/index.d.ts +0 -1
- package/lib/esm/actions/index.js +0 -1
- package/lib/esm/config/QPQConfig.d.ts +2 -1
- package/lib/esm/config/QPQConfig.js +1 -0
- package/lib/esm/config/settings/{logs.d.ts → defineAdminSettings/defineAdminSettings.d.ts} +2 -2
- package/lib/esm/config/settings/defineAdminSettings/defineAdminSettings.js +121 -0
- package/lib/esm/config/settings/defineAdminSettings/index.d.ts +1 -0
- package/lib/esm/config/settings/defineAdminSettings/index.js +1 -0
- package/lib/esm/config/settings/defineAuthSystem/defineAuthSystem.d.ts +10 -0
- package/lib/esm/config/settings/defineAuthSystem/defineAuthSystem.js +44 -0
- package/lib/esm/config/settings/defineAuthSystem/index.d.ts +1 -0
- package/lib/esm/config/settings/defineAuthSystem/index.js +1 -0
- package/lib/esm/config/settings/index.d.ts +3 -2
- package/lib/esm/config/settings/index.js +3 -2
- package/lib/esm/config/settings/migration.js +2 -2
- package/lib/esm/config/settings/storageDriveCorsSettings.d.ts +19 -0
- package/lib/esm/config/settings/storageDriveCorsSettings.js +12 -0
- package/lib/esm/config/settings/webEntry.d.ts +8 -0
- package/lib/esm/config/settings/webEntry.js +1 -0
- package/lib/esm/services/auth/config/constants.d.ts +1 -0
- package/lib/esm/services/auth/config/constants.js +4 -0
- package/lib/esm/services/auth/config/defineAuthServiceRoute.d.ts +4 -0
- package/lib/esm/services/auth/config/defineAuthServiceRoute.js +6 -0
- package/lib/esm/services/auth/config/index.d.ts +2 -0
- package/lib/esm/services/auth/config/index.js +2 -0
- package/lib/esm/services/auth/entry/controller/authController.d.ts +9 -0
- package/lib/esm/services/auth/entry/controller/authController.js +72 -0
- package/lib/esm/services/auth/index.d.ts +2 -0
- package/lib/esm/services/auth/index.js +2 -0
- package/lib/esm/services/auth/logic/auth/askAssociateSoftwareToken.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askAssociateSoftwareToken.js +6 -0
- package/lib/esm/services/auth/logic/auth/askChangePassword.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askChangePassword.js +6 -0
- package/lib/esm/services/auth/logic/auth/askConfirmForgotPassword.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askConfirmForgotPassword.js +7 -0
- package/lib/esm/services/auth/logic/auth/askForgotPassword.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askForgotPassword.js +7 -0
- package/lib/esm/services/auth/logic/auth/askGetAuthUserDirectoryName.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askGetAuthUserDirectoryName.js +5 -0
- package/lib/esm/services/auth/logic/auth/askLogin.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askLogin.js +7 -0
- package/lib/esm/services/auth/logic/auth/askRefreshToken.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askRefreshToken.js +7 -0
- package/lib/esm/services/auth/logic/auth/askRespondToAuthChallenge.d.ts +2 -0
- package/lib/esm/services/auth/logic/auth/askRespondToAuthChallenge.js +6 -0
- package/lib/esm/services/auth/logic/auth/index.d.ts +8 -0
- package/lib/esm/services/auth/logic/auth/index.js +8 -0
- package/lib/esm/services/auth/logic/index.d.ts +1 -0
- package/lib/esm/services/auth/logic/index.js +1 -0
- package/lib/esm/services/auth/types/challengePayloadGuards.d.ts +4 -0
- package/lib/esm/services/auth/types/challengePayloadGuards.js +4 -0
- package/lib/esm/services/auth/types/index.d.ts +2 -0
- package/lib/esm/services/auth/types/index.js +2 -0
- package/lib/esm/services/auth/types/types.d.ts +41 -0
- package/lib/esm/services/getServiceEntryQpqFunctionRuntime.d.ts +2 -2
- package/lib/esm/services/index.d.ts +1 -0
- package/lib/esm/services/index.js +1 -0
- package/lib/esm/services/log/entry/controller/logController.js +4 -4
- package/lib/esm/services/log/entry/data/logData.js +2 -3
- package/lib/esm/services/log/entry/data/logLogData.js +2 -2
- package/lib/esm/services/log/entry/data/logMetadataData.js +5 -6
- package/lib/esm/services/log/logic/logs/askGetLogs.js +2 -2
- package/lib/esm/services/log/logic/notifyError/askProcessOnError.js +1 -1
- package/lib/esm/services/log/logic/notifyError/askProcessOnThrottle.js +1 -1
- package/lib/esm/services/log/logic/notifyError/askProcessOnTimeout.js +1 -1
- package/lib/esm/services/webSocketQueue/logic/webSocket/messageProcessors/askProcessOnAuthenticate.js +14 -3
- package/lib/esm/services/webSocketQueue/logic/webSocket/messageProcessors/askProcessOnUnauthenticate.js +5 -1
- package/lib/esm/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageAuthenticated.d.ts +4 -0
- package/lib/esm/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageAuthenticated.js +1 -0
- package/lib/esm/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageUnauthenticated.d.ts +4 -0
- package/lib/esm/services/webSocketQueue/types/serverMessages/WebSocketQueueServerEventMessageUnauthenticated.js +1 -0
- package/lib/esm/services/webSocketQueue/types/serverMessages/WebSocketQueueServerMessageEventType.d.ts +3 -1
- package/lib/esm/services/webSocketQueue/types/serverMessages/WebSocketQueueServerMessageEventType.js +2 -0
- package/lib/esm/services/webSocketQueue/types/serverMessages/index.d.ts +2 -0
- package/lib/esm/services/webSocketQueue/types/serverMessages/index.js +2 -0
- package/lib/esm/stories/askGetHttpApiEventStorySession.js +2 -2
- package/lib/esm/utils/headerUtils.js +10 -3
- package/lib/esm/utils/httpEventUtils.js +2 -2
- package/lib/esm/utils/index.d.ts +2 -1
- package/lib/esm/utils/index.js +2 -1
- package/lib/esm/utils/jwtUtils.d.ts +2 -1
- package/lib/esm/utils/jwtUtils.js +2 -1
- package/lib/esm/utils/networkRequestUtils.d.ts +2 -0
- package/lib/esm/utils/networkRequestUtils.js +128 -0
- package/lib/esm/utils/preformNetworkRequest.d.ts +2 -0
- package/lib/esm/utils/preformNetworkRequest.js +16 -0
- package/lib/esm/utils/qpqConfigAccessorsUtils.d.ts +16 -0
- package/lib/esm/utils/qpqConfigAccessorsUtils.js +30 -0
- package/package.json +3 -3
- package/lib/commonjs/actions/extract/ExtractActionType.d.ts +0 -3
- package/lib/commonjs/actions/extract/ExtractActionType.js +0 -7
- package/lib/commonjs/actions/extract/ExtractExpenseActionRequester.d.ts +0 -10
- package/lib/commonjs/actions/extract/ExtractExpenseActionRequester.js +0 -23
- package/lib/commonjs/actions/extract/ExtractExpenseActionTypes.d.ts +0 -40
- package/lib/commonjs/actions/extract/index.d.ts +0 -3
- package/lib/commonjs/config/settings/defineExposeAdminAdvancedSettings/defineExposeAdminAdvancedSettings.d.ts +0 -2
- package/lib/commonjs/config/settings/defineExposeAdminAdvancedSettings/defineExposeAdminAdvancedSettings.js +0 -33
- package/lib/commonjs/config/settings/defineExposeAdminAdvancedSettings/index.d.ts +0 -1
- package/lib/commonjs/config/settings/logs.js +0 -131
- package/lib/commonjs/services/log/entry/webSocket/onWebsocketEvent.d.ts +0 -5
- package/lib/commonjs/services/log/entry/webSocket/onWebsocketEvent.js +0 -15
- package/lib/commonjs/utils/uuidUtils.d.ts +0 -1
- package/lib/commonjs/utils/uuidUtils.js +0 -9
- package/lib/esm/actions/extract/ExtractActionType.d.ts +0 -3
- package/lib/esm/actions/extract/ExtractActionType.js +0 -4
- package/lib/esm/actions/extract/ExtractExpenseActionRequester.d.ts +0 -10
- package/lib/esm/actions/extract/ExtractExpenseActionRequester.js +0 -19
- package/lib/esm/actions/extract/ExtractExpenseActionTypes.d.ts +0 -40
- package/lib/esm/actions/extract/index.d.ts +0 -3
- package/lib/esm/actions/extract/index.js +0 -3
- package/lib/esm/config/settings/defineExposeAdminAdvancedSettings/defineExposeAdminAdvancedSettings.d.ts +0 -2
- package/lib/esm/config/settings/defineExposeAdminAdvancedSettings/defineExposeAdminAdvancedSettings.js +0 -29
- package/lib/esm/config/settings/defineExposeAdminAdvancedSettings/index.d.ts +0 -1
- package/lib/esm/config/settings/defineExposeAdminAdvancedSettings/index.js +0 -1
- package/lib/esm/config/settings/logs.js +0 -127
- package/lib/esm/services/log/entry/webSocket/onWebsocketEvent.d.ts +0 -5
- package/lib/esm/services/log/entry/webSocket/onWebsocketEvent.js +0 -10
- package/lib/esm/utils/uuidUtils.d.ts +0 -1
- package/lib/esm/utils/uuidUtils.js +0 -5
- /package/lib/commonjs/config/settings/{defineExposeAdminAdvancedSettings → defineAdminSettings}/entry/queue/webSocket.d.ts +0 -0
- /package/lib/commonjs/config/settings/{defineExposeAdminAdvancedSettings → defineAdminSettings}/entry/queue/webSocket.js +0 -0
- /package/lib/commonjs/{actions/extract/ExtractExpenseActionTypes.js → services/auth/types/types.js} +0 -0
- /package/lib/esm/config/settings/{defineExposeAdminAdvancedSettings → defineAdminSettings}/entry/queue/webSocket.d.ts +0 -0
- /package/lib/esm/config/settings/{defineExposeAdminAdvancedSettings → defineAdminSettings}/entry/queue/webSocket.js +0 -0
- /package/lib/esm/{actions/extract/ExtractExpenseActionTypes.js → services/auth/types/types.js} +0 -0
|
@@ -13,9 +13,8 @@ exports.getHttpApiEventAutoRespondActionProcessor = void 0;
|
|
|
13
13
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
14
|
const askValidateRouteAuth_1 = require("../../stories/askValidateRouteAuth");
|
|
15
15
|
const headerUtils_1 = require("../../utils/headerUtils");
|
|
16
|
-
const uuidUtils_1 = require("../../utils/uuidUtils");
|
|
17
16
|
const getProcessAutoRespond = (qpqConfig) => {
|
|
18
|
-
const validateAuth = (0, quidproquo_core_1.getProcessCustomImplementation)(qpqConfig, askValidateRouteAuth_1.askValidateRouteAuth, 'API Auth Validation', null, () => new Date().toISOString(),
|
|
17
|
+
const validateAuth = (0, quidproquo_core_1.getProcessCustomImplementation)(qpqConfig, askValidateRouteAuth_1.askValidateRouteAuth, 'API Auth Validation', null, () => new Date().toISOString(), quidproquo_core_1.generateUuid);
|
|
19
18
|
return (_a, session_1, actionProcessorList_1, logger_1, updateSession_1, dynamicModuleLoader_1) => __awaiter(void 0, [_a, session_1, actionProcessorList_1, logger_1, updateSession_1, dynamicModuleLoader_1], void 0, function* ({ qpqEventRecord, matchResult }, session, actionProcessorList, logger, updateSession, dynamicModuleLoader) {
|
|
20
19
|
var _b;
|
|
21
20
|
// Just auto respond for options requests
|
|
@@ -12,9 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getHttpApiEventGetStorySessionActionProcessor = void 0;
|
|
13
13
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
14
|
const askGetHttpApiEventStorySession_1 = require("../../stories/askGetHttpApiEventStorySession");
|
|
15
|
-
const uuidUtils_1 = require("../../utils/uuidUtils");
|
|
16
15
|
const getProcessGetStorySession = (qpqConfig) => {
|
|
17
|
-
const getSession = (0, quidproquo_core_1.getProcessCustomImplementation)(qpqConfig, askGetHttpApiEventStorySession_1.askGetHttpApiEventStorySession, 'API Get Story Session', null, () => new Date().toISOString(),
|
|
16
|
+
const getSession = (0, quidproquo_core_1.getProcessCustomImplementation)(qpqConfig, askGetHttpApiEventStorySession_1.askGetHttpApiEventStorySession, 'API Get Story Session', null, () => new Date().toISOString(), quidproquo_core_1.generateUuid);
|
|
18
17
|
return (_a, session_1, actionProcessorList_1, logger_1, updateSession_1, dynamicModuleLoader_1) => __awaiter(void 0, [_a, session_1, actionProcessorList_1, logger_1, updateSession_1, dynamicModuleLoader_1], void 0, function* ({ matchStoryResult, qpqEventRecord }, session, actionProcessorList, logger, updateSession, dynamicModuleLoader) {
|
|
19
18
|
var _b;
|
|
20
19
|
const payload = {
|
|
@@ -13,9 +13,8 @@ exports.getRouteAuthValidationDecodeActionProcessor = void 0;
|
|
|
13
13
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
14
|
const routeAuthValidation_1 = require("../../actions/routeAuthValidation");
|
|
15
15
|
const askRouteAuthValidationDecodeDefault_1 = require("../../stories/askRouteAuthValidationDecodeDefault");
|
|
16
|
-
const uuidUtils_1 = require("../../utils/uuidUtils");
|
|
17
16
|
const getProcessRouteAuthValidationDecode = (qpqConfig) => {
|
|
18
|
-
const decodeAuth = (0, quidproquo_core_1.getProcessCustomImplementation)(qpqConfig, askRouteAuthValidationDecodeDefault_1.askRouteAuthValidationDecodeDefault, 'Route Auth Validation Decode', null, () => new Date().toISOString(),
|
|
17
|
+
const decodeAuth = (0, quidproquo_core_1.getProcessCustomImplementation)(qpqConfig, askRouteAuthValidationDecodeDefault_1.askRouteAuthValidationDecodeDefault, 'Route Auth Validation Decode', null, () => new Date().toISOString(), quidproquo_core_1.generateUuid);
|
|
19
18
|
return (payload, session, actionProcessorList, logger, updateSession, dynamicModuleLoader, streamRegistry) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
19
|
const [result, error] = yield decodeAuth(payload, session, actionProcessorList, logger, updateSession, dynamicModuleLoader, streamRegistry);
|
|
21
20
|
if (error) {
|
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./admin"), exports);
|
|
18
18
|
__exportStar(require("./apiKeyValidation"), exports);
|
|
19
19
|
__exportStar(require("./dns"), exports);
|
|
20
|
-
__exportStar(require("./extract"), exports);
|
|
21
20
|
__exportStar(require("./genericDataResource"), exports);
|
|
22
21
|
__exportStar(require("./openApiSpec"), exports);
|
|
23
22
|
__exportStar(require("./routeAuthValidation"), exports);
|
|
@@ -12,7 +12,8 @@ export declare enum QPQWebServerConfigSettingType {
|
|
|
12
12
|
WebSocket = "@quidproquo-webserver/config/WebSocket",
|
|
13
13
|
Cache = "@quidproquo-webserver/config/Cache",
|
|
14
14
|
Certificate = "@quidproquo-webserver/config/Certificate",
|
|
15
|
-
DomainProxy = "@quidproquo-webserver/config/DomainProxy"
|
|
15
|
+
DomainProxy = "@quidproquo-webserver/config/DomainProxy",
|
|
16
|
+
StorageDriveCorsSettings = "@quidproquo-webserver/config/StorageDriveCorsSettings"
|
|
16
17
|
}
|
|
17
18
|
export interface CacheSettings {
|
|
18
19
|
minTTLInSeconds: number;
|
|
@@ -17,4 +17,5 @@ var QPQWebServerConfigSettingType;
|
|
|
17
17
|
QPQWebServerConfigSettingType["Cache"] = "@quidproquo-webserver/config/Cache";
|
|
18
18
|
QPQWebServerConfigSettingType["Certificate"] = "@quidproquo-webserver/config/Certificate";
|
|
19
19
|
QPQWebServerConfigSettingType["DomainProxy"] = "@quidproquo-webserver/config/DomainProxy";
|
|
20
|
+
QPQWebServerConfigSettingType["StorageDriveCorsSettings"] = "@quidproquo-webserver/config/StorageDriveCorsSettings";
|
|
20
21
|
})(QPQWebServerConfigSettingType || (exports.QPQWebServerConfigSettingType = QPQWebServerConfigSettingType = {}));
|
package/lib/commonjs/config/settings/{logs.d.ts → defineAdminSettings/defineAdminSettings.d.ts}
RENAMED
|
@@ -3,6 +3,6 @@ export interface QPQConfigAdvancedLogSettings extends QPQConfigAdvancedSettings
|
|
|
3
3
|
logRetentionDays?: number;
|
|
4
4
|
coldStorageAfterDays?: number;
|
|
5
5
|
claudeAiApiKeySecretName?: string;
|
|
6
|
+
services?: string[];
|
|
6
7
|
}
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const defineLogs: (rootDomain: string, services: string[], advancedSettings?: QPQConfigAdvancedLogSettings) => QPQConfig;
|
|
8
|
+
export declare const defineAdminSettings: (logServiceName: string, rootDomain: string, advancedSettings?: QPQConfigAdvancedLogSettings) => QPQConfig;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineAdminSettings = void 0;
|
|
4
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
|
+
const getServiceEntryQpqFunctionRuntime_1 = require("../../../services/getServiceEntryQpqFunctionRuntime");
|
|
6
|
+
const defineAdminServiceAuthRoute_1 = require("../../../services/log/config/defineAdminServiceAuthRoute");
|
|
7
|
+
const defineAdminServiceLogLogRoute_1 = require("../../../services/log/config/defineAdminServiceLogLogRoute");
|
|
8
|
+
const defineAdminServiceLogRoute_1 = require("../../../services/log/config/defineAdminServiceLogRoute");
|
|
9
|
+
const WebSocketQueueQpqAdminClientMessageEventType_1 = require("../../../services/log/logic/webSocket/clientMessages/WebSocketQueueQpqAdminClientMessageEventType");
|
|
10
|
+
const adminUserDirectory_1 = require("../adminUserDirectory");
|
|
11
|
+
const webSocketQueue_1 = require("../webSocketQueue");
|
|
12
|
+
// Retention defaults to undefined (no expiry) unless `logRetentionDays` is set.
|
|
13
|
+
// If `coldStorageAfterDays` is set, retention is padded by 180 days so logs
|
|
14
|
+
// outlive the cold-storage transition window.
|
|
15
|
+
const calculateLogRetentionDays = (advancedSettings) => {
|
|
16
|
+
var _a;
|
|
17
|
+
if (!(advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.logRetentionDays))
|
|
18
|
+
return undefined;
|
|
19
|
+
const coldStorageExtension = ((_a = advancedSettings.coldStorageAfterDays) !== null && _a !== void 0 ? _a : 0) > 0 ? advancedSettings.coldStorageAfterDays + 180 : 0;
|
|
20
|
+
return Math.max(advancedSettings.logRetentionDays, coldStorageExtension);
|
|
21
|
+
};
|
|
22
|
+
const defineAdminSettings = (logServiceName, rootDomain, advancedSettings) => {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
const routeAuthSettings = {
|
|
25
|
+
routeAuthSettings: {
|
|
26
|
+
userDirectoryName: adminUserDirectory_1.adminUserDirectoryResourceName,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const logRetentionDays = calculateLogRetentionDays(advancedSettings);
|
|
30
|
+
return [
|
|
31
|
+
// Owner-stamped resources — materialise as owned on the admin deploy,
|
|
32
|
+
// and as foreign refs elsewhere. Owner resolution runs at IAM-scoping time.
|
|
33
|
+
(0, quidproquo_core_1.defineEventBus)('qpq-admin-wsq', {
|
|
34
|
+
owner: { module: logServiceName },
|
|
35
|
+
}),
|
|
36
|
+
(0, quidproquo_core_1.defineQueue)('qpqadmin-wscfg', {
|
|
37
|
+
[WebSocketQueueQpqAdminClientMessageEventType_1.WebsocketAdminClientMessageEventType.ConfigSyncRequest]: {
|
|
38
|
+
basePath: __dirname,
|
|
39
|
+
functionName: 'onConfigSyncRequest',
|
|
40
|
+
relativePath: 'entry/queue/webSocket',
|
|
41
|
+
},
|
|
42
|
+
}, {
|
|
43
|
+
eventBusSubscriptions: ['qpq-admin-wsq'],
|
|
44
|
+
}),
|
|
45
|
+
(0, webSocketQueue_1.defineWebSocketQueue)('qpq-admin-wsq', 'qpqadmin', rootDomain, {
|
|
46
|
+
userDirectoryName: adminUserDirectory_1.adminUserDirectoryResourceName,
|
|
47
|
+
owner: { module: logServiceName },
|
|
48
|
+
}),
|
|
49
|
+
(0, quidproquo_core_1.defineStorageDrive)(quidproquo_core_1.QPQ_LOGS_STORAGE_DRIVE_NAME, {
|
|
50
|
+
owner: { module: logServiceName },
|
|
51
|
+
onEvent: {
|
|
52
|
+
create: (0, getServiceEntryQpqFunctionRuntime_1.getServiceEntryQpqFunctionRuntime)('log', 'storageDrive', 'onCreate::onCreate'),
|
|
53
|
+
},
|
|
54
|
+
deprecated: advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.deprecated,
|
|
55
|
+
lifecycleRules: [
|
|
56
|
+
{
|
|
57
|
+
transitions: ((_a = advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.coldStorageAfterDays) !== null && _a !== void 0 ? _a : 0) > 0
|
|
58
|
+
? [
|
|
59
|
+
{
|
|
60
|
+
storageDriveTier: quidproquo_core_1.StorageDriveTier.DEEP_COLD_STORAGE,
|
|
61
|
+
transitionAfterDays: advancedSettings.coldStorageAfterDays,
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
: undefined,
|
|
65
|
+
deleteAfterDays: logRetentionDays,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
}),
|
|
69
|
+
// Admin-only resources — only flatten out when the deploying service is the log service.
|
|
70
|
+
(0, quidproquo_core_1.defineServiceSettings)({
|
|
71
|
+
[logServiceName]: [
|
|
72
|
+
(0, quidproquo_core_1.defineStorageDrive)(quidproquo_core_1.QPQ_LOG_REPORTS_STORAGE_DRIVE_NAME, {
|
|
73
|
+
deprecated: advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.deprecated,
|
|
74
|
+
lifecycleRules: [{ deleteAfterDays: 30 }],
|
|
75
|
+
}),
|
|
76
|
+
(0, quidproquo_core_1.defineKeyValueStore)(quidproquo_core_1.QPQ_LOGS_STORAGE_DRIVE_NAME, 'correlation', [], {
|
|
77
|
+
indexes: [
|
|
78
|
+
{ partitionKey: 'runtimeType', sortKey: 'startedAt' },
|
|
79
|
+
{ partitionKey: 'fromCorrelation', sortKey: 'startedAt' },
|
|
80
|
+
],
|
|
81
|
+
ttlAttribute: 'ttl',
|
|
82
|
+
deprecated: advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.deprecated,
|
|
83
|
+
}),
|
|
84
|
+
(0, quidproquo_core_1.defineKeyValueStore)('qpq-log-messages', 'correlationId', ['timestamp']),
|
|
85
|
+
(0, quidproquo_core_1.defineKeyValueStore)(`${quidproquo_core_1.QPQ_LOGS_STORAGE_DRIVE_NAME}-list`, { key: 'type', type: 'number' }, ['timestamp'], {
|
|
86
|
+
deprecated: advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.deprecated,
|
|
87
|
+
}),
|
|
88
|
+
(0, defineAdminServiceAuthRoute_1.defineAdminServiceAuthRoute)('POST', '/login', 'login'),
|
|
89
|
+
(0, defineAdminServiceAuthRoute_1.defineAdminServiceAuthRoute)('POST', '/refreshToken', 'refreshToken'),
|
|
90
|
+
(0, defineAdminServiceAuthRoute_1.defineAdminServiceAuthRoute)('POST', '/challenge', 'respondToAuthChallenge'),
|
|
91
|
+
(0, defineAdminServiceLogLogRoute_1.defineAdminServiceLogLogRoute)('POST', '/loglog/list', 'getLogLogs', routeAuthSettings),
|
|
92
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('GET', '/admin/services', 'getServiceNames'),
|
|
93
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('POST', '/log/list', 'getLogs', routeAuthSettings),
|
|
94
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('GET', '/log/{correlationId}', 'getLog', routeAuthSettings),
|
|
95
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('GET', '/log/{correlationId}/toggle', 'toggleLogCheck', routeAuthSettings),
|
|
96
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('GET', '/log/children/{fromCorrelation}', 'getChildren', routeAuthSettings),
|
|
97
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('GET', '/log/{correlationId}/hierarchies', 'getHierarchies', routeAuthSettings),
|
|
98
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('GET', '/log/downloadurl/{correlationId}', 'downloadUrl', routeAuthSettings),
|
|
99
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('POST', '/log/chat/message', 'sendChatMessage', routeAuthSettings),
|
|
100
|
+
(0, defineAdminServiceLogRoute_1.defineAdminServiceLogRoute)('POST', '/log/chat', 'getChatMessages', routeAuthSettings),
|
|
101
|
+
(0, quidproquo_core_1.defineQueue)('qpq-admin-websockets', {
|
|
102
|
+
[WebSocketQueueQpqAdminClientMessageEventType_1.WebsocketAdminClientMessageEventType.MarkLogChecked]: (0, getServiceEntryQpqFunctionRuntime_1.getServiceEntryQpqFunctionRuntime)('log', 'queueEvent', 'webSocket::onMarkLogChecked'),
|
|
103
|
+
[WebSocketQueueQpqAdminClientMessageEventType_1.WebsocketAdminClientMessageEventType.RefreshLogMetadata]: (0, getServiceEntryQpqFunctionRuntime_1.getServiceEntryQpqFunctionRuntime)('log', 'queueEvent', 'webSocket::onRefreshLogMetadata'),
|
|
104
|
+
}, {
|
|
105
|
+
eventBusSubscriptions: ['qpq-admin-wsq'],
|
|
106
|
+
}),
|
|
107
|
+
(0, quidproquo_core_1.defineEventBus)('admin-notifier'),
|
|
108
|
+
(0, quidproquo_core_1.defineNotifyError)('admin-notifier', {
|
|
109
|
+
onAlarm: {
|
|
110
|
+
publishToEventBus: ['admin-notifier'],
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
(0, quidproquo_core_1.defineQueue)('admin-alarms', {
|
|
114
|
+
[quidproquo_core_1.NotifyErrorQueueEvents.Error]: (0, getServiceEntryQpqFunctionRuntime_1.getServiceEntryQpqFunctionRuntime)('log', 'queueEvent', 'alarm::onError'),
|
|
115
|
+
[quidproquo_core_1.NotifyErrorQueueEvents.Timeout]: (0, getServiceEntryQpqFunctionRuntime_1.getServiceEntryQpqFunctionRuntime)('log', 'queueEvent', 'alarm::onTimeout'),
|
|
116
|
+
[quidproquo_core_1.NotifyErrorQueueEvents.Throttle]: (0, getServiceEntryQpqFunctionRuntime_1.getServiceEntryQpqFunctionRuntime)('log', 'queueEvent', 'alarm::onThrottle'),
|
|
117
|
+
}, {
|
|
118
|
+
eventBusSubscriptions: ['admin-notifier'],
|
|
119
|
+
}),
|
|
120
|
+
(0, quidproquo_core_1.defineGlobal)('qpq-serviceNames', (_b = advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.services) !== null && _b !== void 0 ? _b : []),
|
|
121
|
+
(0, quidproquo_core_1.defineGlobal)('qpq-log-retention-days', logRetentionDays),
|
|
122
|
+
(0, quidproquo_core_1.defineGlobal)('claudeAi-api-key', (_c = advancedSettings === null || advancedSettings === void 0 ? void 0 : advancedSettings.claudeAiApiKeySecretName) !== null && _c !== void 0 ? _c : ''),
|
|
123
|
+
],
|
|
124
|
+
}),
|
|
125
|
+
];
|
|
126
|
+
};
|
|
127
|
+
exports.defineAdminSettings = defineAdminSettings;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './defineAdminSettings';
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./defineAdminSettings"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EmailTemplates, QPQConfig, UserDirectoryMfaSettings } from 'quidproquo-core';
|
|
2
|
+
export interface AuthSystemOptions {
|
|
3
|
+
phoneRequired?: boolean;
|
|
4
|
+
selfSignUpEnabled?: boolean;
|
|
5
|
+
emailTemplates?: EmailTemplates;
|
|
6
|
+
mfa?: UserDirectoryMfaSettings;
|
|
7
|
+
basePath?: string;
|
|
8
|
+
allowedOrigins?: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare const defineAuthSystem: (service: string, directoryName: string, options?: AuthSystemOptions) => QPQConfig;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineAuthSystem = void 0;
|
|
4
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
|
+
const config_1 = require("../../../services/auth/config");
|
|
6
|
+
const defineAuthServiceRoute_1 = require("../../../services/auth/config/defineAuthServiceRoute");
|
|
7
|
+
// Bundles a complete username/password login flow: a user directory plus the
|
|
8
|
+
// endpoints needed to log in, refresh tokens, respond to challenges, recover a
|
|
9
|
+
// forgotten password, and change a password. The handler stories ship inside
|
|
10
|
+
// quidproquo-webserver (services/auth) and resolve `directoryName` at runtime
|
|
11
|
+
// from the global emitted below.
|
|
12
|
+
const defineAuthSystem = (service, directoryName, options) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const basePath = (_a = options === null || options === void 0 ? void 0 : options.basePath) !== null && _a !== void 0 ? _a : '';
|
|
15
|
+
const routeOptions = {
|
|
16
|
+
allowedOrigins: options === null || options === void 0 ? void 0 : options.allowedOrigins,
|
|
17
|
+
};
|
|
18
|
+
return [
|
|
19
|
+
// The user directory is declared at the top level (ungated) so other
|
|
20
|
+
// services in the application can reference it to validate access tokens.
|
|
21
|
+
(0, quidproquo_core_1.defineUserDirectory)(directoryName, {
|
|
22
|
+
phoneRequired: options === null || options === void 0 ? void 0 : options.phoneRequired,
|
|
23
|
+
selfSignUpEnabled: options === null || options === void 0 ? void 0 : options.selfSignUpEnabled,
|
|
24
|
+
emailTemplates: options === null || options === void 0 ? void 0 : options.emailTemplates,
|
|
25
|
+
mfa: options === null || options === void 0 ? void 0 : options.mfa,
|
|
26
|
+
owner: { module: service },
|
|
27
|
+
}),
|
|
28
|
+
// The login endpoints and their handlers only deploy with the owning service.
|
|
29
|
+
(0, quidproquo_core_1.defineServiceSettings)({
|
|
30
|
+
[service]: [
|
|
31
|
+
(0, quidproquo_core_1.defineGlobal)(config_1.AUTH_USER_DIRECTORY_GLOBAL_KEY, directoryName),
|
|
32
|
+
(0, defineAuthServiceRoute_1.defineAuthServiceRoute)('POST', `${basePath}/login`, 'login', routeOptions),
|
|
33
|
+
(0, defineAuthServiceRoute_1.defineAuthServiceRoute)('POST', `${basePath}/refreshToken`, 'refreshToken', routeOptions),
|
|
34
|
+
(0, defineAuthServiceRoute_1.defineAuthServiceRoute)('POST', `${basePath}/challenge`, 'respondToAuthChallenge', routeOptions),
|
|
35
|
+
(0, defineAuthServiceRoute_1.defineAuthServiceRoute)('POST', `${basePath}/associateSoftwareToken`, 'associateSoftwareToken', routeOptions),
|
|
36
|
+
(0, defineAuthServiceRoute_1.defineAuthServiceRoute)('POST', `${basePath}/forgotPassword`, 'forgotPassword', routeOptions),
|
|
37
|
+
(0, defineAuthServiceRoute_1.defineAuthServiceRoute)('POST', `${basePath}/forgotPassword/confirm`, 'confirmForgotPassword', routeOptions),
|
|
38
|
+
// Authenticated: the caller must present a valid access token.
|
|
39
|
+
(0, defineAuthServiceRoute_1.defineAuthServiceRoute)('POST', `${basePath}/changePassword`, 'changePassword', Object.assign(Object.assign({}, routeOptions), { routeAuthSettings: {
|
|
40
|
+
userDirectoryName: directoryName,
|
|
41
|
+
} })),
|
|
42
|
+
],
|
|
43
|
+
}),
|
|
44
|
+
];
|
|
45
|
+
};
|
|
46
|
+
exports.defineAuthSystem = defineAuthSystem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './defineAuthSystem';
|
|
@@ -14,6 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./ExtractExpenseActionRequester"), exports);
|
|
19
|
-
__exportStar(require("./ExtractExpenseActionTypes"), exports);
|
|
17
|
+
__exportStar(require("./defineAuthSystem"), exports);
|
|
@@ -4,10 +4,10 @@ export * from './apiKey';
|
|
|
4
4
|
export * from './cache';
|
|
5
5
|
export * from './certificate';
|
|
6
6
|
export * from './defaultRouteOptions';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './defineAdminSettings';
|
|
8
|
+
export * from './defineAuthSystem';
|
|
8
9
|
export * from './dns';
|
|
9
10
|
export * from './domainProxy';
|
|
10
|
-
export * from './logs';
|
|
11
11
|
export * from './migration';
|
|
12
12
|
export * from './openApi';
|
|
13
13
|
export * from './route';
|
|
@@ -15,6 +15,7 @@ export * from './seed';
|
|
|
15
15
|
export * from './seo';
|
|
16
16
|
export * from './serviceFunction';
|
|
17
17
|
export * from './stateDispatchOverWebsockets';
|
|
18
|
+
export * from './storageDriveCorsSettings';
|
|
18
19
|
export * from './subdomainRedirect';
|
|
19
20
|
export * from './webEntry';
|
|
20
21
|
export * from './websocket';
|
|
@@ -20,10 +20,10 @@ __exportStar(require("./apiKey"), exports);
|
|
|
20
20
|
__exportStar(require("./cache"), exports);
|
|
21
21
|
__exportStar(require("./certificate"), exports);
|
|
22
22
|
__exportStar(require("./defaultRouteOptions"), exports);
|
|
23
|
-
__exportStar(require("./
|
|
23
|
+
__exportStar(require("./defineAdminSettings"), exports);
|
|
24
|
+
__exportStar(require("./defineAuthSystem"), exports);
|
|
24
25
|
__exportStar(require("./dns"), exports);
|
|
25
26
|
__exportStar(require("./domainProxy"), exports);
|
|
26
|
-
__exportStar(require("./logs"), exports);
|
|
27
27
|
__exportStar(require("./migration"), exports);
|
|
28
28
|
__exportStar(require("./openApi"), exports);
|
|
29
29
|
__exportStar(require("./route"), exports);
|
|
@@ -31,6 +31,7 @@ __exportStar(require("./seed"), exports);
|
|
|
31
31
|
__exportStar(require("./seo"), exports);
|
|
32
32
|
__exportStar(require("./serviceFunction"), exports);
|
|
33
33
|
__exportStar(require("./stateDispatchOverWebsockets"), exports);
|
|
34
|
+
__exportStar(require("./storageDriveCorsSettings"), exports);
|
|
34
35
|
__exportStar(require("./subdomainRedirect"), exports);
|
|
35
36
|
__exportStar(require("./webEntry"), exports);
|
|
36
37
|
__exportStar(require("./websocket"), exports);
|
|
@@ -11,7 +11,7 @@ function removeLeadingSlashs(text) {
|
|
|
11
11
|
return text;
|
|
12
12
|
}
|
|
13
13
|
function getQpqMigrationQueueTypeFromQpqFunctionRuntime(qpqFunctionRuntime) {
|
|
14
|
-
if ((0, quidproquo_core_1.
|
|
14
|
+
if ((0, quidproquo_core_1.isQpqFunctionRuntimeAdvanced)(qpqFunctionRuntime)) {
|
|
15
15
|
return `${qpqFunctionRuntime.basePath}/${removeLeadingSlashs(qpqFunctionRuntime.relativePath)}`;
|
|
16
16
|
}
|
|
17
17
|
const [srcPath] = qpqFunctionRuntime.split('::');
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QPQConfigAdvancedSettings, QPQConfigSetting } from 'quidproquo-core';
|
|
2
|
+
export interface QPQConfigAdvancedStorageDriveCorsSettings extends QPQConfigAdvancedSettings {
|
|
3
|
+
}
|
|
4
|
+
export interface StorageDriveCorsSettingsQPQWebServerConfigSetting extends QPQConfigSetting {
|
|
5
|
+
storageDriveName: string;
|
|
6
|
+
/**
|
|
7
|
+
* Browser origins allowed to read/write this drive's objects via cross-origin
|
|
8
|
+
* `fetch`/`XHR` (e.g. presigned uploads/downloads). Pass `['*']` to allow any
|
|
9
|
+
* origin, or an explicit list for cross-domain frontends. When no CORS setting
|
|
10
|
+
* is declared for a drive, its CORS defaults to this service's own domain.
|
|
11
|
+
*/
|
|
12
|
+
allowedOrigins: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Web-layer CORS policy for a (core) storage drive, keyed by the drive's name.
|
|
16
|
+
* CORS only matters when a browser talks to the bucket, so it lives here in the
|
|
17
|
+
* webserver config rather than on the core `defineStorageDrive`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const defineStorageDriveCorsSettings: (storageDriveName: string, allowedOrigins: string[], options?: QPQConfigAdvancedStorageDriveCorsSettings) => StorageDriveCorsSettingsQPQWebServerConfigSetting;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineStorageDriveCorsSettings = void 0;
|
|
4
|
+
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
+
/**
|
|
6
|
+
* Web-layer CORS policy for a (core) storage drive, keyed by the drive's name.
|
|
7
|
+
* CORS only matters when a browser talks to the bucket, so it lives here in the
|
|
8
|
+
* webserver config rather than on the core `defineStorageDrive`.
|
|
9
|
+
*/
|
|
10
|
+
const defineStorageDriveCorsSettings = (storageDriveName, allowedOrigins, options) => ({
|
|
11
|
+
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.StorageDriveCorsSettings,
|
|
12
|
+
uniqueKey: storageDriveName,
|
|
13
|
+
storageDriveName,
|
|
14
|
+
allowedOrigins,
|
|
15
|
+
});
|
|
16
|
+
exports.defineStorageDriveCorsSettings = defineStorageDriveCorsSettings;
|
|
@@ -19,6 +19,13 @@ export interface QPQConfigAdvancedWebEntrySettings extends QPQConfigAdvancedSett
|
|
|
19
19
|
compressFiles?: boolean;
|
|
20
20
|
cloudflareApiKeySecretName?: string;
|
|
21
21
|
securityHeaders?: ResponseSecurityHeaders;
|
|
22
|
+
/**
|
|
23
|
+
* Browser origins allowed to cross-origin `fetch` this web entry's (public,
|
|
24
|
+
* static) assets. Leave undefined to scope to this service's own domain
|
|
25
|
+
* (`https://<domain>` + `https://*.<domain>`); pass `['*']` to allow any
|
|
26
|
+
* origin (e.g. serving assets as a public CDN / cross-origin fonts).
|
|
27
|
+
*/
|
|
28
|
+
corsAllowedOrigins?: string[];
|
|
22
29
|
}
|
|
23
30
|
export interface WebEntryQPQWebServerConfigSetting extends QPQConfigSetting {
|
|
24
31
|
name: string;
|
|
@@ -31,5 +38,6 @@ export interface WebEntryQPQWebServerConfigSetting extends QPQConfigSetting {
|
|
|
31
38
|
compressFiles: boolean;
|
|
32
39
|
cloudflareApiKeySecretName?: string;
|
|
33
40
|
securityHeaders?: ResponseSecurityHeaders;
|
|
41
|
+
corsAllowedOrigins?: string[];
|
|
34
42
|
}
|
|
35
43
|
export declare const defineWebEntry: (name: string, options: QPQConfigAdvancedWebEntrySettings) => WebEntryQPQWebServerConfigSetting;
|
|
@@ -19,6 +19,7 @@ const defineWebEntry = (name, options) => {
|
|
|
19
19
|
securityHeaders: options === null || options === void 0 ? void 0 : options.securityHeaders,
|
|
20
20
|
cloudflareApiKeySecretName: options === null || options === void 0 ? void 0 : options.cloudflareApiKeySecretName,
|
|
21
21
|
cacheSettingsName: options === null || options === void 0 ? void 0 : options.cacheSettingsName,
|
|
22
|
+
corsAllowedOrigins: options === null || options === void 0 ? void 0 : options.corsAllowedOrigins,
|
|
22
23
|
});
|
|
23
24
|
};
|
|
24
25
|
exports.defineWebEntry = defineWebEntry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AUTH_USER_DIRECTORY_GLOBAL_KEY = "qpq-auth-user-directory";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUTH_USER_DIRECTORY_GLOBAL_KEY = void 0;
|
|
4
|
+
// The auth system stores its user directory name as a global so the bundled
|
|
5
|
+
// handler stories can resolve it at runtime (mirrors the `qpq-serviceNames`
|
|
6
|
+
// pattern). One auth directory per service deployment.
|
|
7
|
+
exports.AUTH_USER_DIRECTORY_GLOBAL_KEY = 'qpq-auth-user-directory';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HTTPMethod } from 'quidproquo-core';
|
|
2
|
+
import { ApiKeyReference } from '../../../config/settings/apiKey';
|
|
3
|
+
import { GenericRouteOptions } from '../../../config/settings/route';
|
|
4
|
+
export declare const defineAuthServiceRoute: (method: HTTPMethod, urlPath: string, methodName: string, options?: GenericRouteOptions<ApiKeyReference | string>) => import("../../../config/settings/route").RouteQPQWebServerConfigSetting;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineAuthServiceRoute = void 0;
|
|
4
|
+
const route_1 = require("../../../config/settings/route");
|
|
5
|
+
const getServiceEntryQpqFunctionRuntime_1 = require("../../getServiceEntryQpqFunctionRuntime");
|
|
6
|
+
const defineAuthServiceRoute = (method, urlPath, methodName, options = {}) => {
|
|
7
|
+
const qpqRuntime = (0, getServiceEntryQpqFunctionRuntime_1.getServiceEntryQpqFunctionRuntime)('auth', 'controller', `authController::${methodName}`);
|
|
8
|
+
return (0, route_1.defineRoute)(method, urlPath, qpqRuntime, options);
|
|
9
|
+
};
|
|
10
|
+
exports.defineAuthServiceRoute = defineAuthServiceRoute;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants"), exports);
|
|
18
|
+
__exportStar(require("./defineAuthServiceRoute"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AskResponse } from 'quidproquo-core';
|
|
2
|
+
import { HTTPEvent, HTTPEventResponse } from '../../../../types';
|
|
3
|
+
export declare function login(event: HTTPEvent): AskResponse<HTTPEventResponse>;
|
|
4
|
+
export declare function refreshToken(event: HTTPEvent): AskResponse<HTTPEventResponse>;
|
|
5
|
+
export declare function respondToAuthChallenge(event: HTTPEvent): AskResponse<HTTPEventResponse>;
|
|
6
|
+
export declare function associateSoftwareToken(event: HTTPEvent): AskResponse<HTTPEventResponse>;
|
|
7
|
+
export declare function forgotPassword(event: HTTPEvent): AskResponse<HTTPEventResponse>;
|
|
8
|
+
export declare function confirmForgotPassword(event: HTTPEvent): AskResponse<HTTPEventResponse>;
|
|
9
|
+
export declare function changePassword(event: HTTPEvent): AskResponse<HTTPEventResponse>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.login = login;
|
|
4
|
+
exports.refreshToken = refreshToken;
|
|
5
|
+
exports.respondToAuthChallenge = respondToAuthChallenge;
|
|
6
|
+
exports.associateSoftwareToken = associateSoftwareToken;
|
|
7
|
+
exports.forgotPassword = forgotPassword;
|
|
8
|
+
exports.confirmForgotPassword = confirmForgotPassword;
|
|
9
|
+
exports.changePassword = changePassword;
|
|
10
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
11
|
+
// TODO: Fix this import (name it up the chain)
|
|
12
|
+
const index_1 = require("../../../../index");
|
|
13
|
+
const logic_1 = require("../../logic");
|
|
14
|
+
const types_1 = require("../../types");
|
|
15
|
+
// Maps the wire payload (discriminated by `challenge`) onto the core auth
|
|
16
|
+
// challenge shape. The type guards narrow `payload`, so no manual casts are
|
|
17
|
+
// needed. Add a branch here as new challenge types are supported.
|
|
18
|
+
const challengePayloadToAuthChallenge = (payload) => {
|
|
19
|
+
if ((0, types_1.isNewPasswordChallengePayload)(payload)) {
|
|
20
|
+
return {
|
|
21
|
+
challenge: quidproquo_core_1.AuthenticateUserChallenge.NEW_PASSWORD_REQUIRED,
|
|
22
|
+
username: payload.email,
|
|
23
|
+
session: payload.session,
|
|
24
|
+
newPassword: payload.newPassword,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if ((0, types_1.isMfaChallengePayload)(payload)) {
|
|
28
|
+
return {
|
|
29
|
+
challenge: quidproquo_core_1.AuthenticateUserChallenge.SOFTWARE_TOKEN_MFA,
|
|
30
|
+
username: payload.email,
|
|
31
|
+
session: payload.session,
|
|
32
|
+
mfaCode: payload.mfaCode,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if ((0, types_1.isMfaSetupChallengePayload)(payload)) {
|
|
36
|
+
return {
|
|
37
|
+
challenge: quidproquo_core_1.AuthenticateUserChallenge.MFA_SETUP,
|
|
38
|
+
username: payload.email,
|
|
39
|
+
session: payload.session,
|
|
40
|
+
mfaCode: payload.mfaCode,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
throw new Error(`Unsupported auth challenge: ${payload.challenge}`);
|
|
44
|
+
};
|
|
45
|
+
function* login(event) {
|
|
46
|
+
const { username, password } = yield* index_1.qpqWebServerUtils.askFromJsonEventRequest(event);
|
|
47
|
+
const authResponse = yield* logic_1.authLogic.askLogin(username, password);
|
|
48
|
+
return index_1.qpqWebServerUtils.toJsonEventResponse(authResponse);
|
|
49
|
+
}
|
|
50
|
+
function* refreshToken(event) {
|
|
51
|
+
const { refreshToken } = yield* index_1.qpqWebServerUtils.askFromJsonEventRequest(event);
|
|
52
|
+
const refreshResponse = yield* logic_1.authLogic.askRefreshToken(refreshToken);
|
|
53
|
+
return index_1.qpqWebServerUtils.toJsonEventResponse(refreshResponse);
|
|
54
|
+
}
|
|
55
|
+
function* respondToAuthChallenge(event) {
|
|
56
|
+
const payload = yield* index_1.qpqWebServerUtils.askFromJsonEventRequest(event);
|
|
57
|
+
const response = yield* logic_1.authLogic.askRespondToAuthChallenge(challengePayloadToAuthChallenge(payload));
|
|
58
|
+
return index_1.qpqWebServerUtils.toJsonEventResponse(response);
|
|
59
|
+
}
|
|
60
|
+
function* associateSoftwareToken(event) {
|
|
61
|
+
const { session } = yield* index_1.qpqWebServerUtils.askFromJsonEventRequest(event);
|
|
62
|
+
const response = yield* logic_1.authLogic.askAssociateSoftwareToken(session);
|
|
63
|
+
return index_1.qpqWebServerUtils.toJsonEventResponse(response);
|
|
64
|
+
}
|
|
65
|
+
function* forgotPassword(event) {
|
|
66
|
+
const { username } = yield* index_1.qpqWebServerUtils.askFromJsonEventRequest(event);
|
|
67
|
+
const deliveryDetails = yield* logic_1.authLogic.askForgotPassword(username);
|
|
68
|
+
return index_1.qpqWebServerUtils.toJsonEventResponse(deliveryDetails);
|
|
69
|
+
}
|
|
70
|
+
function* confirmForgotPassword(event) {
|
|
71
|
+
const { username, code, password } = yield* index_1.qpqWebServerUtils.askFromJsonEventRequest(event);
|
|
72
|
+
const response = yield* logic_1.authLogic.askConfirmForgotPassword(username, code, password);
|
|
73
|
+
return index_1.qpqWebServerUtils.toJsonEventResponse(response);
|
|
74
|
+
}
|
|
75
|
+
function* changePassword(event) {
|
|
76
|
+
const { oldPassword, newPassword } = yield* index_1.qpqWebServerUtils.askFromJsonEventRequest(event);
|
|
77
|
+
// The route is authenticated, so the access token is present on the request.
|
|
78
|
+
const accessToken = index_1.qpqWebServerUtils.getAccessTokenFromHeaders(event.headers) || '';
|
|
79
|
+
yield* logic_1.authLogic.askChangePassword(oldPassword, newPassword, accessToken);
|
|
80
|
+
return index_1.qpqWebServerUtils.toJsonEventResponse({ success: true });
|
|
81
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./config"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.askAssociateSoftwareToken = askAssociateSoftwareToken;
|
|
4
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
|
+
const askGetAuthUserDirectoryName_1 = require("./askGetAuthUserDirectoryName");
|
|
6
|
+
function* askAssociateSoftwareToken(session) {
|
|
7
|
+
const userDirectoryName = yield* (0, askGetAuthUserDirectoryName_1.askGetAuthUserDirectoryName)();
|
|
8
|
+
return yield* (0, quidproquo_core_1.askUserDirectoryAssociateSoftwareToken)(userDirectoryName, session);
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.askChangePassword = askChangePassword;
|
|
4
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
|
+
// The underlying action authenticates the caller via their access token, so no
|
|
6
|
+
// user directory name is required here.
|
|
7
|
+
function* askChangePassword(oldPassword, newPassword, accessToken) {
|
|
8
|
+
yield* (0, quidproquo_core_1.askUserDirectoryChangePassword)(oldPassword, newPassword, accessToken);
|
|
9
|
+
}
|