@bitblit/ratchet-epsilon-common 4.0.419-alpha → 4.0.421-alpha
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/background/background-dynamo-log-table-handler.d.ts +11 -0
- package/lib/background/background-dynamo-log-table-handler.js +38 -0
- package/lib/background/background-dynamo-log-table-handler.js.map +1 -0
- package/lib/background/background-entry.d.ts +4 -0
- package/lib/background/background-entry.js +2 -0
- package/lib/background/background-entry.js.map +1 -0
- package/lib/background/background-execution-event-type.d.ts +8 -0
- package/lib/background/background-execution-event-type.js +8 -0
- package/lib/background/background-execution-event-type.js.map +1 -0
- package/lib/background/background-execution-event.d.ts +8 -0
- package/lib/background/background-execution-event.js +2 -0
- package/lib/background/background-execution-event.js.map +1 -0
- package/lib/background/background-execution-listener.d.ts +5 -0
- package/lib/background/background-execution-listener.js +2 -0
- package/lib/background/background-execution-listener.js.map +1 -0
- package/lib/background/background-handler.d.ts +29 -0
- package/lib/background/background-handler.js +280 -0
- package/lib/background/background-handler.js.map +1 -0
- package/lib/background/background-http-adapter-handler.d.ts +22 -0
- package/lib/background/background-http-adapter-handler.js +129 -0
- package/lib/background/background-http-adapter-handler.js.map +1 -0
- package/lib/background/background-meta-response-internal.d.ts +5 -0
- package/lib/background/background-meta-response-internal.js +2 -0
- package/lib/background/background-meta-response-internal.js.map +1 -0
- package/lib/background/background-process-handling.d.ts +5 -0
- package/lib/background/background-process-handling.js +5 -0
- package/lib/background/background-process-handling.js.map +1 -0
- package/lib/background/background-process-log-table-entry.d.ts +11 -0
- package/lib/background/background-process-log-table-entry.js +2 -0
- package/lib/background/background-process-log-table-entry.js.map +1 -0
- package/lib/background/background-queue-response-internal.d.ts +8 -0
- package/lib/background/background-queue-response-internal.js +2 -0
- package/lib/background/background-queue-response-internal.js.map +1 -0
- package/lib/background/background-validator.d.ts +17 -0
- package/lib/background/background-validator.js +87 -0
- package/lib/background/background-validator.js.map +1 -0
- package/lib/background/epsilon-background-process-error.d.ts +30 -0
- package/lib/background/epsilon-background-process-error.js +94 -0
- package/lib/background/epsilon-background-process-error.js.map +1 -0
- package/lib/background/index.d.ts +20 -0
- package/lib/background/index.js +21 -0
- package/lib/background/index.js.map +1 -0
- package/lib/background/internal-background-entry.d.ts +8 -0
- package/lib/background/internal-background-entry.js +2 -0
- package/lib/background/internal-background-entry.js.map +1 -0
- package/lib/background/manager/abstract-background-manager.d.ts +19 -0
- package/lib/background/manager/abstract-background-manager.js +90 -0
- package/lib/background/manager/abstract-background-manager.js.map +1 -0
- package/lib/background/manager/aws-large-payload-s3-sqs-sns-background-manager.d.ts +19 -0
- package/lib/background/manager/aws-large-payload-s3-sqs-sns-background-manager.js +58 -0
- package/lib/background/manager/aws-large-payload-s3-sqs-sns-background-manager.js.map +1 -0
- package/lib/background/manager/aws-sqs-sns-background-manager.d.ts +23 -0
- package/lib/background/manager/aws-sqs-sns-background-manager.js +154 -0
- package/lib/background/manager/aws-sqs-sns-background-manager.js.map +1 -0
- package/lib/background/manager/background-manager-like.d.ts +18 -0
- package/lib/background/manager/background-manager-like.js +2 -0
- package/lib/background/manager/background-manager-like.js.map +1 -0
- package/lib/background/manager/single-thread-local-background-manager.d.ts +15 -0
- package/lib/background/manager/single-thread-local-background-manager.js +46 -0
- package/lib/background/manager/single-thread-local-background-manager.js.map +1 -0
- package/lib/background/s3-background-transaction-logger.d.ts +17 -0
- package/lib/background/s3-background-transaction-logger.js +53 -0
- package/lib/background/s3-background-transaction-logger.js.map +1 -0
- package/lib/build/index.d.ts +1 -0
- package/lib/build/index.js +2 -0
- package/lib/build/index.js.map +1 -0
- package/lib/build/ratchet-epsilon-common-info.d.ts +5 -0
- package/lib/build/ratchet-epsilon-common-info.js +15 -0
- package/lib/build/ratchet-epsilon-common-info.js.map +1 -0
- package/lib/built-in/background/echo-processor.d.ts +7 -0
- package/lib/built-in/background/echo-processor.js +16 -0
- package/lib/built-in/background/echo-processor.js.map +1 -0
- package/lib/built-in/background/log-and-enqueue-echo-processor.d.ts +6 -0
- package/lib/built-in/background/log-and-enqueue-echo-processor.js +13 -0
- package/lib/built-in/background/log-and-enqueue-echo-processor.js.map +1 -0
- package/lib/built-in/background/log-message-background-error-processor.d.ts +5 -0
- package/lib/built-in/background/log-message-background-error-processor.js +7 -0
- package/lib/built-in/background/log-message-background-error-processor.js.map +1 -0
- package/lib/built-in/background/no-op-processor.d.ts +6 -0
- package/lib/built-in/background/no-op-processor.js +10 -0
- package/lib/built-in/background/no-op-processor.js.map +1 -0
- package/lib/built-in/background/retry-processor.d.ts +16 -0
- package/lib/built-in/background/retry-processor.js +41 -0
- package/lib/built-in/background/retry-processor.js.map +1 -0
- package/lib/built-in/background/sample-delay-processor.d.ts +6 -0
- package/lib/built-in/background/sample-delay-processor.js +14 -0
- package/lib/built-in/background/sample-delay-processor.js.map +1 -0
- package/lib/built-in/background/sample-input-validated-processor-data.d.ts +4 -0
- package/lib/built-in/background/sample-input-validated-processor-data.js +2 -0
- package/lib/built-in/background/sample-input-validated-processor-data.js.map +1 -0
- package/lib/built-in/background/sample-input-validated-processor.d.ts +8 -0
- package/lib/built-in/background/sample-input-validated-processor.js +13 -0
- package/lib/built-in/background/sample-input-validated-processor.js.map +1 -0
- package/lib/built-in/built-in-trace-id-generators.d.ts +5 -0
- package/lib/built-in/built-in-trace-id-generators.js +20 -0
- package/lib/built-in/built-in-trace-id-generators.js.map +1 -0
- package/lib/built-in/daemon/daemon-authorizer-function.d.ts +3 -0
- package/lib/built-in/daemon/daemon-authorizer-function.js +2 -0
- package/lib/built-in/daemon/daemon-authorizer-function.js.map +1 -0
- package/lib/built-in/daemon/daemon-config.d.ts +8 -0
- package/lib/built-in/daemon/daemon-config.js +2 -0
- package/lib/built-in/daemon/daemon-config.js.map +1 -0
- package/lib/built-in/daemon/daemon-group-selection-function.d.ts +2 -0
- package/lib/built-in/daemon/daemon-group-selection-function.js +2 -0
- package/lib/built-in/daemon/daemon-group-selection-function.js.map +1 -0
- package/lib/built-in/daemon/daemon-handler.d.ts +16 -0
- package/lib/built-in/daemon/daemon-handler.js +60 -0
- package/lib/built-in/daemon/daemon-handler.js.map +1 -0
- package/lib/built-in/daemon/daemon-process-state-list.d.ts +5 -0
- package/lib/built-in/daemon/daemon-process-state-list.js +2 -0
- package/lib/built-in/daemon/daemon-process-state-list.js.map +1 -0
- package/lib/built-in/http/apollo/apollo-util.d.ts +10 -0
- package/lib/built-in/http/apollo/apollo-util.js +37 -0
- package/lib/built-in/http/apollo/apollo-util.js.map +1 -0
- package/lib/built-in/http/apollo/default-epsilon-apollo-context.d.ts +10 -0
- package/lib/built-in/http/apollo/default-epsilon-apollo-context.js +2 -0
- package/lib/built-in/http/apollo/default-epsilon-apollo-context.js.map +1 -0
- package/lib/built-in/http/apollo/epsilon-apollo-cors-method.d.ts +6 -0
- package/lib/built-in/http/apollo/epsilon-apollo-cors-method.js +6 -0
- package/lib/built-in/http/apollo/epsilon-apollo-cors-method.js.map +1 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.d.ts +5 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.js +2 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.js.map +1 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-options.d.ts +10 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-options.js +2 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-options.js.map +1 -0
- package/lib/built-in/http/apollo-filter.d.ts +10 -0
- package/lib/built-in/http/apollo-filter.js +111 -0
- package/lib/built-in/http/apollo-filter.js.map +1 -0
- package/lib/built-in/http/built-in-auth-filters.d.ts +9 -0
- package/lib/built-in/http/built-in-auth-filters.js +108 -0
- package/lib/built-in/http/built-in-auth-filters.js.map +1 -0
- package/lib/built-in/http/built-in-authorizers.d.ts +8 -0
- package/lib/built-in/http/built-in-authorizers.js +40 -0
- package/lib/built-in/http/built-in-authorizers.js.map +1 -0
- package/lib/built-in/http/built-in-filters.d.ts +26 -0
- package/lib/built-in/http/built-in-filters.js +212 -0
- package/lib/built-in/http/built-in-filters.js.map +1 -0
- package/lib/built-in/http/built-in-handlers.d.ts +9 -0
- package/lib/built-in/http/built-in-handlers.js +70 -0
- package/lib/built-in/http/built-in-handlers.js.map +1 -0
- package/lib/built-in/http/log-level-manipulation-filter.d.ts +6 -0
- package/lib/built-in/http/log-level-manipulation-filter.js +17 -0
- package/lib/built-in/http/log-level-manipulation-filter.js.map +1 -0
- package/lib/built-in/http/run-handler-as-filter.d.ts +14 -0
- package/lib/built-in/http/run-handler-as-filter.js +79 -0
- package/lib/built-in/http/run-handler-as-filter.js.map +1 -0
- package/lib/built-in/index.d.ts +26 -0
- package/lib/built-in/index.js +27 -0
- package/lib/built-in/index.js.map +1 -0
- package/lib/cli/index.d.ts +2 -0
- package/lib/cli/index.js +3 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/ratchet-cli-handler.d.ts +6 -0
- package/lib/cli/ratchet-cli-handler.js +21 -0
- package/lib/cli/ratchet-cli-handler.js.map +1 -0
- package/lib/cli/run-background-process-from-command-line.d.ts +3 -0
- package/lib/cli/run-background-process-from-command-line.js +23 -0
- package/lib/cli/run-background-process-from-command-line.js.map +1 -0
- package/lib/config/background/background-aws-config.d.ts +7 -0
- package/lib/config/background/background-aws-config.js +2 -0
- package/lib/config/background/background-aws-config.js.map +1 -0
- package/lib/config/background/background-config.d.ts +14 -0
- package/lib/config/background/background-config.js +2 -0
- package/lib/config/background/background-config.js.map +1 -0
- package/lib/config/background/background-error-processor.d.ts +4 -0
- package/lib/config/background/background-error-processor.js +2 -0
- package/lib/config/background/background-error-processor.js.map +1 -0
- package/lib/config/background/background-processor.d.ts +6 -0
- package/lib/config/background/background-processor.js +2 -0
- package/lib/config/background/background-processor.js.map +1 -0
- package/lib/config/background/background-transaction-log.d.ts +8 -0
- package/lib/config/background/background-transaction-log.js +2 -0
- package/lib/config/background/background-transaction-log.js.map +1 -0
- package/lib/config/background/background-transaction-logger.d.ts +5 -0
- package/lib/config/background/background-transaction-logger.js +2 -0
- package/lib/config/background/background-transaction-logger.js.map +1 -0
- package/lib/config/cron/abstract-cron-entry.d.ts +12 -0
- package/lib/config/cron/abstract-cron-entry.js +2 -0
- package/lib/config/cron/abstract-cron-entry.js.map +1 -0
- package/lib/config/cron/cron-background-entry.d.ts +6 -0
- package/lib/config/cron/cron-background-entry.js +2 -0
- package/lib/config/cron/cron-background-entry.js.map +1 -0
- package/lib/config/cron/cron-config.d.ts +6 -0
- package/lib/config/cron/cron-config.js +2 -0
- package/lib/config/cron/cron-config.js.map +1 -0
- package/lib/config/dynamo-db-config.d.ts +5 -0
- package/lib/config/dynamo-db-config.js +2 -0
- package/lib/config/dynamo-db-config.js.map +1 -0
- package/lib/config/epsilon-config.d.ts +24 -0
- package/lib/config/epsilon-config.js +2 -0
- package/lib/config/epsilon-config.js.map +1 -0
- package/lib/config/epsilon-lambda-event-handler.d.ts +7 -0
- package/lib/config/epsilon-lambda-event-handler.js +2 -0
- package/lib/config/epsilon-lambda-event-handler.js.map +1 -0
- package/lib/config/epsilon-logger-config.d.ts +13 -0
- package/lib/config/epsilon-logger-config.js +2 -0
- package/lib/config/epsilon-logger-config.js.map +1 -0
- package/lib/config/generic-aws-event-handler-function.d.ts +1 -0
- package/lib/config/generic-aws-event-handler-function.js +2 -0
- package/lib/config/generic-aws-event-handler-function.js.map +1 -0
- package/lib/config/http/authorizer-function.d.ts +4 -0
- package/lib/config/http/authorizer-function.js +2 -0
- package/lib/config/http/authorizer-function.js.map +1 -0
- package/lib/config/http/epsilon-authorization-context.d.ts +5 -0
- package/lib/config/http/epsilon-authorization-context.js +2 -0
- package/lib/config/http/epsilon-authorization-context.js.map +1 -0
- package/lib/config/http/extended-api-gateway-event.d.ts +7 -0
- package/lib/config/http/extended-api-gateway-event.js +2 -0
- package/lib/config/http/extended-api-gateway-event.js.map +1 -0
- package/lib/config/http/filter-chain-context.d.ts +14 -0
- package/lib/config/http/filter-chain-context.js +2 -0
- package/lib/config/http/filter-chain-context.js.map +1 -0
- package/lib/config/http/filter-function.d.ts +2 -0
- package/lib/config/http/filter-function.js +2 -0
- package/lib/config/http/filter-function.js.map +1 -0
- package/lib/config/http/handler-function.d.ts +3 -0
- package/lib/config/http/handler-function.js +2 -0
- package/lib/config/http/handler-function.js.map +1 -0
- package/lib/config/http/http-config.d.ts +15 -0
- package/lib/config/http/http-config.js +2 -0
- package/lib/config/http/http-config.js.map +1 -0
- package/lib/config/http/http-processing-config.d.ts +11 -0
- package/lib/config/http/http-processing-config.js +2 -0
- package/lib/config/http/http-processing-config.js.map +1 -0
- package/lib/config/http/mapped-http-processing-config.d.ts +7 -0
- package/lib/config/http/mapped-http-processing-config.js +2 -0
- package/lib/config/http/mapped-http-processing-config.js.map +1 -0
- package/lib/config/http/null-returned-object-handling.d.ts +6 -0
- package/lib/config/http/null-returned-object-handling.js +6 -0
- package/lib/config/http/null-returned-object-handling.js.map +1 -0
- package/lib/config/index.d.ts +35 -0
- package/lib/config/index.js +36 -0
- package/lib/config/index.js.map +1 -0
- package/lib/config/inter-api/inter-api-aws-config.d.ts +5 -0
- package/lib/config/inter-api/inter-api-aws-config.js +2 -0
- package/lib/config/inter-api/inter-api-aws-config.js.map +1 -0
- package/lib/config/inter-api/inter-api-config.d.ts +6 -0
- package/lib/config/inter-api/inter-api-config.js +2 -0
- package/lib/config/inter-api/inter-api-config.js.map +1 -0
- package/lib/config/inter-api/inter-api-process-mapping.d.ts +6 -0
- package/lib/config/inter-api/inter-api-process-mapping.js +2 -0
- package/lib/config/inter-api/inter-api-process-mapping.js.map +1 -0
- package/lib/config/logging-trace-id-generator.d.ts +2 -0
- package/lib/config/logging-trace-id-generator.js +2 -0
- package/lib/config/logging-trace-id-generator.js.map +1 -0
- package/lib/config/no-handlers-found-error.d.ts +3 -0
- package/lib/config/no-handlers-found-error.js +7 -0
- package/lib/config/no-handlers-found-error.js.map +1 -0
- package/lib/config/open-api/open-api-document-components.d.ts +4 -0
- package/lib/config/open-api/open-api-document-components.js +2 -0
- package/lib/config/open-api/open-api-document-components.js.map +1 -0
- package/lib/config/open-api/open-api-document-path.d.ts +2 -0
- package/lib/config/open-api/open-api-document-path.js +2 -0
- package/lib/config/open-api/open-api-document-path.js.map +1 -0
- package/lib/config/open-api/open-api-document.d.ts +6 -0
- package/lib/config/open-api/open-api-document.js +2 -0
- package/lib/config/open-api/open-api-document.js.map +1 -0
- package/lib/config/s3-config.d.ts +6 -0
- package/lib/config/s3-config.js +2 -0
- package/lib/config/s3-config.js.map +1 -0
- package/lib/config/sns-config.d.ts +5 -0
- package/lib/config/sns-config.js +2 -0
- package/lib/config/sns-config.js.map +1 -0
- package/lib/config/sqs-config.d.ts +5 -0
- package/lib/config/sqs-config.js +2 -0
- package/lib/config/sqs-config.js.map +1 -0
- package/lib/epsilon-build-properties.d.ts +9 -0
- package/lib/epsilon-build-properties.js +25 -0
- package/lib/epsilon-build-properties.js.map +1 -0
- package/lib/epsilon-constants.d.ts +16 -0
- package/lib/epsilon-constants.js +47 -0
- package/lib/epsilon-constants.js.map +1 -0
- package/lib/epsilon-global-handler.d.ts +20 -0
- package/lib/epsilon-global-handler.js +177 -0
- package/lib/epsilon-global-handler.js.map +1 -0
- package/lib/epsilon-instance.d.ts +14 -0
- package/lib/epsilon-instance.js +2 -0
- package/lib/epsilon-instance.js.map +1 -0
- package/lib/epsilon-logging-extension-processor.d.ts +6 -0
- package/lib/epsilon-logging-extension-processor.js +16 -0
- package/lib/epsilon-logging-extension-processor.js.map +1 -0
- package/lib/http/auth/api-gateway-adapter-authentication-handler.d.ts +8 -0
- package/lib/http/auth/api-gateway-adapter-authentication-handler.js +73 -0
- package/lib/http/auth/api-gateway-adapter-authentication-handler.js.map +1 -0
- package/lib/http/auth/auth0-web-token-manipulator.d.ts +13 -0
- package/lib/http/auth/auth0-web-token-manipulator.js +62 -0
- package/lib/http/auth/auth0-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/basic-auth-token.d.ts +4 -0
- package/lib/http/auth/basic-auth-token.js +2 -0
- package/lib/http/auth/basic-auth-token.js.map +1 -0
- package/lib/http/auth/google-web-token-manipulator.d.ts +14 -0
- package/lib/http/auth/google-web-token-manipulator.js +71 -0
- package/lib/http/auth/google-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.d.ts +11 -0
- package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.js +27 -0
- package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/local-web-token-manipulator.d.ts +19 -0
- package/lib/http/auth/local-web-token-manipulator.js +83 -0
- package/lib/http/auth/local-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/web-token-manipulator.d.ts +4 -0
- package/lib/http/auth/web-token-manipulator.js +2 -0
- package/lib/http/auth/web-token-manipulator.js.map +1 -0
- package/lib/http/error/bad-gateway.d.ts +5 -0
- package/lib/http/error/bad-gateway.js +10 -0
- package/lib/http/error/bad-gateway.js.map +1 -0
- package/lib/http/error/bad-request-error.d.ts +5 -0
- package/lib/http/error/bad-request-error.js +10 -0
- package/lib/http/error/bad-request-error.js.map +1 -0
- package/lib/http/error/conflict-error.d.ts +5 -0
- package/lib/http/error/conflict-error.js +10 -0
- package/lib/http/error/conflict-error.js.map +1 -0
- package/lib/http/error/forbidden-error.d.ts +5 -0
- package/lib/http/error/forbidden-error.js +10 -0
- package/lib/http/error/forbidden-error.js.map +1 -0
- package/lib/http/error/gateway-timeout.d.ts +5 -0
- package/lib/http/error/gateway-timeout.js +10 -0
- package/lib/http/error/gateway-timeout.js.map +1 -0
- package/lib/http/error/method-not-allowed-error.d.ts +5 -0
- package/lib/http/error/method-not-allowed-error.js +10 -0
- package/lib/http/error/method-not-allowed-error.js.map +1 -0
- package/lib/http/error/misconfigured-error.d.ts +5 -0
- package/lib/http/error/misconfigured-error.js +10 -0
- package/lib/http/error/misconfigured-error.js.map +1 -0
- package/lib/http/error/not-found-error.d.ts +5 -0
- package/lib/http/error/not-found-error.js +10 -0
- package/lib/http/error/not-found-error.js.map +1 -0
- package/lib/http/error/not-implemented.d.ts +5 -0
- package/lib/http/error/not-implemented.js +10 -0
- package/lib/http/error/not-implemented.js.map +1 -0
- package/lib/http/error/request-timeout-error.d.ts +5 -0
- package/lib/http/error/request-timeout-error.js +10 -0
- package/lib/http/error/request-timeout-error.js.map +1 -0
- package/lib/http/error/service-unavailable.d.ts +5 -0
- package/lib/http/error/service-unavailable.js +10 -0
- package/lib/http/error/service-unavailable.js.map +1 -0
- package/lib/http/error/too-many-requests-error.d.ts +5 -0
- package/lib/http/error/too-many-requests-error.js +10 -0
- package/lib/http/error/too-many-requests-error.js.map +1 -0
- package/lib/http/error/unauthorized-error.d.ts +5 -0
- package/lib/http/error/unauthorized-error.js +10 -0
- package/lib/http/error/unauthorized-error.js.map +1 -0
- package/lib/http/event-util.d.ts +27 -0
- package/lib/http/event-util.js +209 -0
- package/lib/http/event-util.js.map +1 -0
- package/lib/http/index.d.ts +29 -0
- package/lib/http/index.js +30 -0
- package/lib/http/index.js.map +1 -0
- package/lib/http/response-util.d.ts +10 -0
- package/lib/http/response-util.js +142 -0
- package/lib/http/response-util.js.map +1 -0
- package/lib/http/route/epsilon-router.d.ts +8 -0
- package/lib/http/route/epsilon-router.js +2 -0
- package/lib/http/route/epsilon-router.js.map +1 -0
- package/lib/http/route/extended-auth-response-context.d.ts +6 -0
- package/lib/http/route/extended-auth-response-context.js +2 -0
- package/lib/http/route/extended-auth-response-context.js.map +1 -0
- package/lib/http/route/route-mapping.d.ts +12 -0
- package/lib/http/route/route-mapping.js +2 -0
- package/lib/http/route/route-mapping.js.map +1 -0
- package/lib/http/route/route-validator-config.d.ts +5 -0
- package/lib/http/route/route-validator-config.js +2 -0
- package/lib/http/route/route-validator-config.js.map +1 -0
- package/lib/http/route/router-util.d.ts +23 -0
- package/lib/http/route/router-util.js +234 -0
- package/lib/http/route/router-util.js.map +1 -0
- package/lib/http/web-handler.d.ts +23 -0
- package/lib/http/web-handler.js +118 -0
- package/lib/http/web-handler.js.map +1 -0
- package/lib/http/web-v2-handler.d.ts +10 -0
- package/lib/http/web-v2-handler.js +23 -0
- package/lib/http/web-v2-handler.js.map +1 -0
- package/lib/inter-api/index.d.ts +2 -0
- package/lib/inter-api/index.js +3 -0
- package/lib/inter-api/index.js.map +1 -0
- package/lib/inter-api/inter-api-entry.d.ts +7 -0
- package/lib/inter-api/inter-api-entry.js +2 -0
- package/lib/inter-api/inter-api-entry.js.map +1 -0
- package/lib/inter-api/inter-api-util.d.ts +10 -0
- package/lib/inter-api/inter-api-util.js +60 -0
- package/lib/inter-api/inter-api-util.js.map +1 -0
- package/lib/inter-api-manager.d.ts +14 -0
- package/lib/inter-api-manager.js +66 -0
- package/lib/inter-api-manager.js.map +1 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.d.ts +14 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.js +74 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.d.ts +11 -0
- package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js +36 -0
- package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js +32 -0
- package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/generic-sqs-epsilon-lambda-event-handler.d.ts +11 -0
- package/lib/lambda-event-handler/generic-sqs-epsilon-lambda-event-handler.js +36 -0
- package/lib/lambda-event-handler/generic-sqs-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/index.d.ts +6 -0
- package/lib/lambda-event-handler/index.js +7 -0
- package/lib/lambda-event-handler/index.js.map +1 -0
- package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js +24 -0
- package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.js +42 -0
- package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/local-container-server.d.ts +11 -0
- package/lib/local-container-server.js +85 -0
- package/lib/local-container-server.js.map +1 -0
- package/lib/local-server-cert.d.ts +5 -0
- package/lib/local-server-cert.js +68 -0
- package/lib/local-server-cert.js.map +1 -0
- package/lib/local-server.d.ts +19 -0
- package/lib/local-server.js +203 -0
- package/lib/local-server.js.map +1 -0
- package/lib/open-api-util/index.d.ts +3 -0
- package/lib/open-api-util/index.js +4 -0
- package/lib/open-api-util/index.js.map +1 -0
- package/lib/open-api-util/open-api-doc-modifications.d.ts +8 -0
- package/lib/open-api-util/open-api-doc-modifications.js +2 -0
- package/lib/open-api-util/open-api-doc-modifications.js.map +1 -0
- package/lib/open-api-util/open-api-doc-modifier.d.ts +7 -0
- package/lib/open-api-util/open-api-doc-modifier.js +80 -0
- package/lib/open-api-util/open-api-doc-modifier.js.map +1 -0
- package/lib/open-api-util/yaml-combiner.d.ts +3 -0
- package/lib/open-api-util/yaml-combiner.js +28 -0
- package/lib/open-api-util/yaml-combiner.js.map +1 -0
- package/lib/sample/index.d.ts +3 -0
- package/lib/sample/index.js +4 -0
- package/lib/sample/index.js.map +1 -0
- package/lib/sample/sample-server-components.d.ts +10 -0
- package/lib/sample/sample-server-components.js +181 -0
- package/lib/sample/sample-server-components.js.map +1 -0
- package/lib/sample/sample-server-static-files.d.ts +5 -0
- package/lib/sample/sample-server-static-files.js +609 -0
- package/lib/sample/sample-server-static-files.js.map +1 -0
- package/lib/sample/test-error-server.d.ts +10 -0
- package/lib/sample/test-error-server.js +45 -0
- package/lib/sample/test-error-server.js.map +1 -0
- package/lib/util/aws-util.d.ts +8 -0
- package/lib/util/aws-util.js +66 -0
- package/lib/util/aws-util.js.map +1 -0
- package/lib/util/context-util.d.ts +34 -0
- package/lib/util/context-util.js +104 -0
- package/lib/util/context-util.js.map +1 -0
- package/lib/util/cron-util.d.ts +11 -0
- package/lib/util/cron-util.js +69 -0
- package/lib/util/cron-util.js.map +1 -0
- package/lib/util/epsilon-config-parser.d.ts +14 -0
- package/lib/util/epsilon-config-parser.js +66 -0
- package/lib/util/epsilon-config-parser.js.map +1 -0
- package/lib/util/index.d.ts +4 -0
- package/lib/util/index.js +5 -0
- package/lib/util/index.js.map +1 -0
- package/package.json +25 -27
- package/lib/index.mjs +0 -2
- package/lib/types.d.ts +0 -1202
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-auth-token.js","sourceRoot":"","sources":["../../../src/http/auth/basic-auth-token.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WebTokenManipulator } from './web-token-manipulator.js';
|
|
2
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/jwt/jwt-token-base';
|
|
3
|
+
export declare class GoogleWebTokenManipulator implements WebTokenManipulator<JwtTokenBase> {
|
|
4
|
+
private clientId;
|
|
5
|
+
private static readonly GOOGLE_DISCOVERY_DOCUMENT;
|
|
6
|
+
private cacheGoogleDiscoveryDocument;
|
|
7
|
+
private jwksClient;
|
|
8
|
+
constructor(clientId: string);
|
|
9
|
+
extractTokenFromAuthorizationHeader<T extends JwtTokenBase>(authHeader: string): Promise<JwtTokenBase>;
|
|
10
|
+
parseAndValidateGoogleToken<T extends JwtTokenBase>(googleToken: string, allowExpired?: boolean): Promise<JwtTokenBase>;
|
|
11
|
+
private fetchSigningKey;
|
|
12
|
+
private fetchJwksClient;
|
|
13
|
+
private fetchGoogleDiscoveryDocument;
|
|
14
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/logger/logger';
|
|
2
|
+
import jwt from 'jsonwebtoken';
|
|
3
|
+
import jwks from 'jwks-rsa';
|
|
4
|
+
import fetch from 'cross-fetch';
|
|
5
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lang/string-ratchet';
|
|
6
|
+
export class GoogleWebTokenManipulator {
|
|
7
|
+
clientId;
|
|
8
|
+
static GOOGLE_DISCOVERY_DOCUMENT = 'https://accounts.google.com/.well-known/openid-configuration';
|
|
9
|
+
cacheGoogleDiscoveryDocument;
|
|
10
|
+
jwksClient;
|
|
11
|
+
constructor(clientId) {
|
|
12
|
+
this.clientId = clientId;
|
|
13
|
+
}
|
|
14
|
+
async extractTokenFromAuthorizationHeader(authHeader) {
|
|
15
|
+
let tokenString = StringRatchet.trimToEmpty(authHeader);
|
|
16
|
+
if (tokenString.toLowerCase().startsWith('bearer ')) {
|
|
17
|
+
tokenString = tokenString.substring(7);
|
|
18
|
+
}
|
|
19
|
+
const validated = tokenString ? await this.parseAndValidateGoogleToken(tokenString, false) : null;
|
|
20
|
+
return validated;
|
|
21
|
+
}
|
|
22
|
+
async parseAndValidateGoogleToken(googleToken, allowExpired = false) {
|
|
23
|
+
Logger.debug('Auth : %s', StringRatchet.obscure(googleToken, 4));
|
|
24
|
+
const fullToken = jwt.decode(googleToken, { complete: true });
|
|
25
|
+
const kid = fullToken.header.kid;
|
|
26
|
+
const nowEpochSeconds = Math.floor(new Date().getTime() / 1000);
|
|
27
|
+
const pubKey = await this.fetchSigningKey(kid);
|
|
28
|
+
const validated = jwt.verify(googleToken, pubKey, {
|
|
29
|
+
audience: this.clientId,
|
|
30
|
+
issuer: ['https://accounts.google.com', 'accounts.google.com'],
|
|
31
|
+
ignoreExpiration: allowExpired,
|
|
32
|
+
clockTimestamp: nowEpochSeconds,
|
|
33
|
+
});
|
|
34
|
+
return validated;
|
|
35
|
+
}
|
|
36
|
+
async fetchSigningKey(kid) {
|
|
37
|
+
const jClient = await this.fetchJwksClient();
|
|
38
|
+
return new Promise((res, rej) => {
|
|
39
|
+
jClient.getSigningKey(kid, (err, key) => {
|
|
40
|
+
if (err) {
|
|
41
|
+
rej(err);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
res(key.publicKey || key.rsaPublicKey);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async fetchJwksClient() {
|
|
50
|
+
if (!this.jwksClient) {
|
|
51
|
+
const discDoc = await this.fetchGoogleDiscoveryDocument();
|
|
52
|
+
const client = jwks({
|
|
53
|
+
cache: true,
|
|
54
|
+
cacheMaxEntries: 5,
|
|
55
|
+
cacheMaxAge: 1000 * 60 * 60 * 10,
|
|
56
|
+
jwksUri: discDoc.jwks_uri,
|
|
57
|
+
});
|
|
58
|
+
this.jwksClient = client;
|
|
59
|
+
}
|
|
60
|
+
return this.jwksClient;
|
|
61
|
+
}
|
|
62
|
+
async fetchGoogleDiscoveryDocument() {
|
|
63
|
+
if (!this.cacheGoogleDiscoveryDocument) {
|
|
64
|
+
const resp = await fetch(GoogleWebTokenManipulator.GOOGLE_DISCOVERY_DOCUMENT);
|
|
65
|
+
const doc = await resp.json();
|
|
66
|
+
this.cacheGoogleDiscoveryDocument = doc;
|
|
67
|
+
}
|
|
68
|
+
return this.cacheGoogleDiscoveryDocument;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=google-web-token-manipulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-web-token-manipulator.js","sourceRoot":"","sources":["../../../src/http/auth/google-web-token-manipulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,IAAI,MAAM,UAAU,CAAC;AAE5B,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,M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yB,CAAC,yBAAyB,CAAC,CAAC;YACxF,MAAM,GAAG,GAAQ,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YACnC,IAAI,CAAC,4BAA4B,GAAG,GAAG,CAAC;QAC1C,CAAC;QACD,OAAO,IAAI,CAAC,4BAA4B,CAAC;IAC3C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WebTokenManipulator } from './web-token-manipulator.js';
|
|
2
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/jwt/jwt-token-base';
|
|
3
|
+
import { JwtRatchetLike } from '@bitblit/ratchet-common/jwt/jwt-ratchet-like';
|
|
4
|
+
export declare class JwtRatchetLocalWebTokenManipulator<T extends JwtTokenBase> implements WebTokenManipulator<T> {
|
|
5
|
+
private _jwtRatchet;
|
|
6
|
+
private _issuer;
|
|
7
|
+
constructor(_jwtRatchet: JwtRatchetLike, _issuer: string);
|
|
8
|
+
get jwtRatchet(): JwtRatchetLike;
|
|
9
|
+
get issuer(): string;
|
|
10
|
+
extractTokenFromAuthorizationHeader<T>(header: string): Promise<T>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RequireRatchet } from '@bitblit/ratchet-common/lang/require-ratchet';
|
|
2
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lang/string-ratchet';
|
|
3
|
+
export class JwtRatchetLocalWebTokenManipulator {
|
|
4
|
+
_jwtRatchet;
|
|
5
|
+
_issuer;
|
|
6
|
+
constructor(_jwtRatchet, _issuer) {
|
|
7
|
+
this._jwtRatchet = _jwtRatchet;
|
|
8
|
+
this._issuer = _issuer;
|
|
9
|
+
RequireRatchet.notNullOrUndefined(_jwtRatchet, '_jwtRatchet');
|
|
10
|
+
RequireRatchet.notNullOrUndefined(StringRatchet.trimToNull(_issuer), '_issuer');
|
|
11
|
+
}
|
|
12
|
+
get jwtRatchet() {
|
|
13
|
+
return this._jwtRatchet;
|
|
14
|
+
}
|
|
15
|
+
get issuer() {
|
|
16
|
+
return this._issuer;
|
|
17
|
+
}
|
|
18
|
+
async extractTokenFromAuthorizationHeader(header) {
|
|
19
|
+
let tokenString = StringRatchet.trimToEmpty(header);
|
|
20
|
+
if (tokenString.toLowerCase().startsWith('bearer ')) {
|
|
21
|
+
tokenString = tokenString.substring(7);
|
|
22
|
+
}
|
|
23
|
+
const validated = tokenString ? await this.jwtRatchet.decodeToken(tokenString, 1) : null;
|
|
24
|
+
return validated;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=jwt-ratchet-local-web-token-manipulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-ratchet-local-web-token-manipulator.js","sourceRoot":"","sources":["../../../src/http/auth/jwt-ratchet-local-web-token-manipulator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAQ5E,MAAM,OAAO,kCAAkC;IAEnC;IACA;IAFV,YACU,WAA2B,EAC3B,OAAe;QADf,gBAAW,GAAX,WAAW,CAAgB;QAC3B,YAAO,GAAP,OAAO,CAAQ;QAEvB,cAAc,CAAC,kBAAkB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAC9D,cAAc,CAAC,kBAAkB,CAAC,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;IAClF,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,mCAAmC,CAAI,MAAc;QAChE,IAAI,WAAW,GAAW,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC5D,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACpD,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,SAAS,GAAM,WAAW,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,IAAqC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7H,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WebTokenManipulator } from './web-token-manipulator.js';
|
|
2
|
+
import { LoggerLevelName } from '@bitblit/ratchet-common/logger/logger-level-name';
|
|
3
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/jwt/jwt-token-base';
|
|
4
|
+
import { JwtRatchet } from '@bitblit/ratchet-common/jwt/jwt-ratchet';
|
|
5
|
+
export declare class LocalWebTokenManipulator<T extends JwtTokenBase> implements WebTokenManipulator<T> {
|
|
6
|
+
private encryptionKeys;
|
|
7
|
+
private issuer;
|
|
8
|
+
private _ratchet;
|
|
9
|
+
constructor(encryptionKeys: string[], issuer: string);
|
|
10
|
+
withExtraDecryptionKeys(keys: string[]): LocalWebTokenManipulator<T>;
|
|
11
|
+
withParseFailureLogLevel(logLevel: LoggerLevelName): LocalWebTokenManipulator<T>;
|
|
12
|
+
withOldKeyUseLogLevel(logLevel: LoggerLevelName): LocalWebTokenManipulator<T>;
|
|
13
|
+
get jwtRatchet(): JwtRatchet;
|
|
14
|
+
get selectRandomEncryptionKey(): Promise<string>;
|
|
15
|
+
createRefreshedJWTString(tokenString: string, expirationSeconds: number, allowExpired?: boolean): Promise<string>;
|
|
16
|
+
parseAndValidateJWTStringAsync<T extends JwtTokenBase>(tokenString: string): Promise<T>;
|
|
17
|
+
createJWTStringAsync<T>(principal: string, userObject: T, roles?: string[], expirationSeconds?: number, proxyUser?: T): Promise<string>;
|
|
18
|
+
extractTokenFromAuthorizationHeader<T extends JwtTokenBase>(header: string): Promise<T>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { UnauthorizedError } from '../error/unauthorized-error.js';
|
|
2
|
+
import { RequireRatchet } from '@bitblit/ratchet-common/lang/require-ratchet';
|
|
3
|
+
import { Logger } from '@bitblit/ratchet-common/logger/logger';
|
|
4
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lang/string-ratchet';
|
|
5
|
+
import { JwtRatchet } from '@bitblit/ratchet-common/jwt/jwt-ratchet';
|
|
6
|
+
export class LocalWebTokenManipulator {
|
|
7
|
+
encryptionKeys;
|
|
8
|
+
issuer;
|
|
9
|
+
_ratchet;
|
|
10
|
+
constructor(encryptionKeys, issuer) {
|
|
11
|
+
this.encryptionKeys = encryptionKeys;
|
|
12
|
+
this.issuer = issuer;
|
|
13
|
+
RequireRatchet.notNullOrUndefined(encryptionKeys, 'encryptionKeys');
|
|
14
|
+
RequireRatchet.noNullOrUndefinedValuesInArray(encryptionKeys, encryptionKeys.length);
|
|
15
|
+
const cfg = {
|
|
16
|
+
encryptionKeyPromise: Promise.resolve(encryptionKeys),
|
|
17
|
+
};
|
|
18
|
+
this._ratchet = new JwtRatchet(cfg);
|
|
19
|
+
}
|
|
20
|
+
withExtraDecryptionKeys(keys) {
|
|
21
|
+
RequireRatchet.notNullOrUndefined(keys, 'keys');
|
|
22
|
+
RequireRatchet.noNullOrUndefinedValuesInArray(keys, keys.length);
|
|
23
|
+
const cfg = this._ratchet.copyConfig;
|
|
24
|
+
cfg.decryptKeysPromise = Promise.resolve(keys);
|
|
25
|
+
this._ratchet = new JwtRatchet(cfg);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
withParseFailureLogLevel(logLevel) {
|
|
29
|
+
const cfg = this._ratchet.copyConfig;
|
|
30
|
+
cfg.parseFailureLogLevel = logLevel;
|
|
31
|
+
this._ratchet = new JwtRatchet(cfg);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
withOldKeyUseLogLevel(logLevel) {
|
|
35
|
+
const cfg = this._ratchet.copyConfig;
|
|
36
|
+
cfg.decryptOnlyKeyUseLogLevel = logLevel;
|
|
37
|
+
this._ratchet = new JwtRatchet(cfg);
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
get jwtRatchet() {
|
|
41
|
+
return this._ratchet;
|
|
42
|
+
}
|
|
43
|
+
get selectRandomEncryptionKey() {
|
|
44
|
+
return this._ratchet.selectRandomEncryptionKey();
|
|
45
|
+
}
|
|
46
|
+
createRefreshedJWTString(tokenString, expirationSeconds, allowExpired) {
|
|
47
|
+
return this._ratchet.refreshJWTString(tokenString, allowExpired || false, expirationSeconds);
|
|
48
|
+
}
|
|
49
|
+
async parseAndValidateJWTStringAsync(tokenString) {
|
|
50
|
+
const payload = await this._ratchet.decodeToken(tokenString, 2);
|
|
51
|
+
if (JwtRatchet.hasExpiredFlag(payload)) {
|
|
52
|
+
throw new UnauthorizedError('Failing JWT token read/validate - token expired on ' + payload.exp);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return payload;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async createJWTStringAsync(principal, userObject, roles = ['USER'], expirationSeconds = 3600, proxyUser = null) {
|
|
59
|
+
Logger.info('Creating JWT token for %s that expires in %s', principal, expirationSeconds);
|
|
60
|
+
const now = new Date().getTime();
|
|
61
|
+
const expires = now + expirationSeconds * 1000;
|
|
62
|
+
const tokenData = {
|
|
63
|
+
exp: expires,
|
|
64
|
+
iss: this.issuer,
|
|
65
|
+
sub: principal,
|
|
66
|
+
iat: now,
|
|
67
|
+
user: userObject,
|
|
68
|
+
proxy: proxyUser,
|
|
69
|
+
roles: roles,
|
|
70
|
+
};
|
|
71
|
+
const token = await this._ratchet.createTokenString(tokenData, expirationSeconds);
|
|
72
|
+
return token;
|
|
73
|
+
}
|
|
74
|
+
async extractTokenFromAuthorizationHeader(header) {
|
|
75
|
+
let tokenString = StringRatchet.trimToEmpty(header);
|
|
76
|
+
if (tokenString.toLowerCase().startsWith('bearer ')) {
|
|
77
|
+
tokenString = tokenString.substring(7);
|
|
78
|
+
}
|
|
79
|
+
const validated = tokenString ? await this.parseAndValidateJWTStringAsync(tokenString) : null;
|
|
80
|
+
return validated;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=local-web-token-manipulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-web-token-manipulator.js","sourceRoot":"","sources":["../../../src/http/auth/local-web-token-manipulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAK5E,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAMrE,MAAM,OAAO,wBAAwB;IAIzB;IACA;IAJF,QAAQ,CAAa;IAE7B,YACU,cAAwB,EACxB,MAAc;QADd,mBAAc,GAAd,cAAc,CAAU;QACxB,WAAM,GAAN,MAAM,CAAQ;QAEtB,cAAc,CAAC,kBAAkB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;QACpE,cAAc,CAAC,8BAA8B,CAAC,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;QACrF,MAAM,GAAG,GAAqB;YAC5B,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC;SACtD,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAEM,uBAAuB,CAAC,IAAc;QAC3C,cAAc,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAChD,cAAc,CAAC,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAEjE,MAAM,GAAG,GAAqB,IAA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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-token-manipulator.js","sourceRoot":"","sources":["../../../src/http/auth/web-token-manipulator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class BadGateway extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 502;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, BadGateway.prototype);
|
|
7
|
+
this.withHttpStatusCode(BadGateway.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=bad-gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bad-gateway.js","sourceRoot":"","sources":["../../../src/http/error/bad-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,UAAqB,SAAQ,mBAAsB;IACvD,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class BadRequestError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 400;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
7
|
+
this.withHttpStatusCode(BadRequestError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=bad-request-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bad-request-error.js","sourceRoot":"","sources":["../../../src/http/error/bad-request-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,eAA0B,SAAQ,mBAAsB;IAC5D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class ConflictError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 409;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
7
|
+
this.withHttpStatusCode(ConflictError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=conflict-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-error.js","sourceRoot":"","sources":["../../../src/http/error/conflict-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,aAAwB,SAAQ,mBAAsB;IAC1D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;QAErD,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class ForbiddenError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 403;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, ForbiddenError.prototype);
|
|
7
|
+
this.withHttpStatusCode(ForbiddenError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=forbidden-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-error.js","sourceRoot":"","sources":["../../../src/http/error/forbidden-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,cAAyB,SAAQ,mBAAsB;IAC3D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QAEtD,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class GatewayTimeout extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 504;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, GatewayTimeout.prototype);
|
|
7
|
+
this.withHttpStatusCode(GatewayTimeout.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=gateway-timeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-timeout.js","sourceRoot":"","sources":["../../../src/http/error/gateway-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,cAAyB,SAAQ,mBAAsB;IAC3D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QAEtD,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class MethodNotAllowedError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 405;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, MethodNotAllowedError.prototype);
|
|
7
|
+
this.withHttpStatusCode(MethodNotAllowedError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=method-not-allowed-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-not-allowed-error.js","sourceRoot":"","sources":["../../../src/http/error/method-not-allowed-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,qBAAgC,SAAQ,mBAAsB;IAClE,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;QAE7D,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class MisconfiguredError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 500;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, MisconfiguredError.prototype);
|
|
7
|
+
this.withHttpStatusCode(MisconfiguredError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=misconfigured-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misconfigured-error.js","sourceRoot":"","sources":["../../../src/http/error/misconfigured-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,kBAA6B,SAAQ,mBAAsB;IAC/D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAE1D,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class NotFoundError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 404;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
7
|
+
this.withHttpStatusCode(NotFoundError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=not-found-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found-error.js","sourceRoot":"","sources":["../../../src/http/error/not-found-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,aAAwB,SAAQ,mBAAsB;IAC1D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;QAErD,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class NotImplemented extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 501;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, NotImplemented.prototype);
|
|
7
|
+
this.withHttpStatusCode(NotImplemented.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=not-implemented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-implemented.js","sourceRoot":"","sources":["../../../src/http/error/not-implemented.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,cAAyB,SAAQ,mBAAsB;IAC3D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QAEtD,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class RequestTimeoutError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 500;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, RequestTimeoutError.prototype);
|
|
7
|
+
this.withHttpStatusCode(RequestTimeoutError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=request-timeout-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-timeout-error.js","sourceRoot":"","sources":["../../../src/http/error/request-timeout-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,mBAA8B,SAAQ,mBAAsB;IAChE,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAE3D,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class ServiceUnavailable extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 503;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, ServiceUnavailable.prototype);
|
|
7
|
+
this.withHttpStatusCode(ServiceUnavailable.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=service-unavailable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-unavailable.js","sourceRoot":"","sources":["../../../src/http/error/service-unavailable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,kBAA6B,SAAQ,mBAAsB;IAC/D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAE1D,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class TooManyRequestsError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 429;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, TooManyRequestsError.prototype);
|
|
7
|
+
this.withHttpStatusCode(TooManyRequestsError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=too-many-requests-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"too-many-requests-error.js","sourceRoot":"","sources":["../../../src/http/error/too-many-requests-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,oBAA+B,SAAQ,mBAAsB;IACjE,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAE5D,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
2
|
+
export class UnauthorizedError extends RestfulApiHttpError {
|
|
3
|
+
static HTTP_CODE = 401;
|
|
4
|
+
constructor(...errors) {
|
|
5
|
+
super(...errors);
|
|
6
|
+
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
7
|
+
this.withHttpStatusCode(UnauthorizedError.HTTP_CODE);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=unauthorized-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unauthorized-error.js","sourceRoot":"","sources":["../../../src/http/error/unauthorized-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAE7F,MAAM,OAAO,iBAA4B,SAAQ,mBAAsB;IAC9D,MAAM,CAAU,SAAS,GAAW,GAAG,CAAC;IAE/C,YAAY,GAAG,MAAgB;QAC7B,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAEzD,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { APIGatewayEvent, APIGatewayEventRequestContext, AuthResponseContext } from 'aws-lambda';
|
|
2
|
+
import { EpsilonLoggerConfig } from '../config/epsilon-logger-config.js';
|
|
3
|
+
import { BasicAuthToken } from './auth/basic-auth-token.js';
|
|
4
|
+
import { LoggerLevelName } from '@bitblit/ratchet-common/logger/logger-level-name';
|
|
5
|
+
export declare class EventUtil {
|
|
6
|
+
private constructor();
|
|
7
|
+
static extractStage(event: APIGatewayEvent): string;
|
|
8
|
+
static extractHostHeader(event: APIGatewayEvent): string;
|
|
9
|
+
static extractProtocol(event: APIGatewayEvent): string;
|
|
10
|
+
static extractApiGatewayStage(event: APIGatewayEvent): string;
|
|
11
|
+
static extractRequestContext(event: APIGatewayEvent): APIGatewayEventRequestContext;
|
|
12
|
+
static extractAuthorizer(event: APIGatewayEvent): AuthResponseContext;
|
|
13
|
+
static ipAddressChain(event: APIGatewayEvent): string[];
|
|
14
|
+
static ipAddress(event: APIGatewayEvent): string;
|
|
15
|
+
static extractFullPath(event: APIGatewayEvent, overrideProtocol?: string): string;
|
|
16
|
+
static extractFullPrefix(event: APIGatewayEvent, overrideProtocol?: string): string;
|
|
17
|
+
static jsonBodyToObject(evt: APIGatewayEvent): any;
|
|
18
|
+
static calcLogLevelViaEventOrEnvParam(curLevel: LoggerLevelName, event: APIGatewayEvent, rConfig: EpsilonLoggerConfig): LoggerLevelName;
|
|
19
|
+
static fixStillEncodedQueryParams(event: APIGatewayEvent): void;
|
|
20
|
+
static applyTokenToEventForTesting(event: APIGatewayEvent, jwtToken: string): void;
|
|
21
|
+
static extractBasicAuthenticationToken(event: APIGatewayEvent, throwErrorOnMissingBad?: boolean): BasicAuthToken;
|
|
22
|
+
static eventIsAGraphQLIntrospection(event: APIGatewayEvent): boolean;
|
|
23
|
+
static extractAuthorizationHeaderCaseInsensitive(evt: APIGatewayEvent): string;
|
|
24
|
+
static extractBearerTokenFromEvent(evt: APIGatewayEvent): string;
|
|
25
|
+
static hostIsLocal(host: string): boolean;
|
|
26
|
+
static hostIsLocalOrNotRoutableIP4(host: string): boolean;
|
|
27
|
+
}
|