perimeterx-js-core 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/action/utils.js +9 -2
- package/lib/cjs/activities/HttpActivityClient.js +1 -1
- package/lib/cjs/activities/utils.js +17 -14
- package/lib/cjs/blocker/BlockerBase.js +2 -2
- package/lib/cjs/config/ConfigurationBase.js +117 -100
- package/lib/cjs/config/defaults/DefaultConfigurationParams.js +5 -4
- package/lib/cjs/config/params/index.js +4 -7
- package/lib/cjs/config/remote_config/DefaultRemoteConfigUpdater.js +7 -2
- package/lib/cjs/config/remote_config/RemoteConfigUtils.js +1 -1
- package/lib/cjs/config/remote_config/service_client/HttpRemoteConfigServiceClient.js +3 -3
- package/lib/cjs/context/DefaultContext.js +9 -4
- package/lib/cjs/context/SerializedContext.js +1 -1
- package/lib/cjs/cors/DefaultCors.js +6 -2
- package/lib/cjs/enforcer/EnforcerBase.js +0 -1
- package/lib/cjs/enforcer/utils.js +5 -4
- package/lib/cjs/graphql/DefaultGraphQLParser.js +22 -17
- package/lib/cjs/http/utils/FormDataImpl.js +1 -1
- package/lib/cjs/impl/base64/BufferBase64Utils.js +2 -1
- package/lib/cjs/impl/hash/CryptoJSHashUtils.js +1 -1
- package/lib/cjs/impl/http/phin/PhinHttpClient.js +3 -3
- package/lib/cjs/impl/http/phin/PhinIncomingResponse.js +22 -6
- package/lib/cjs/impl/url/CustomImplUrlUtils.js +2 -2
- package/lib/cjs/impl/url/UrlImpl.js +4 -1
- package/lib/cjs/impl/url/UrlSearchParamsImpl.js +6 -5
- package/lib/cjs/phase/flow/EndEnforcerFlow.js +7 -1
- package/lib/cjs/phase/flow/EnforceFlow.js +1 -1
- package/lib/cjs/phase/flow/FilterFlow.js +18 -6
- package/lib/cjs/phase/impl/ClearLogsPhase.js +53 -0
- package/lib/cjs/phase/impl/CompositePhase.js +1 -1
- package/lib/cjs/phase/impl/CreateBlockResponsePhase.js +9 -7
- package/lib/cjs/phase/impl/EnrichContextFromRequestPhase.js +20 -22
- package/lib/cjs/phase/impl/EnrichContextFromResponsePhase.js +18 -21
- package/lib/cjs/phase/impl/FirstPartyPhase.js +9 -9
- package/lib/cjs/phase/impl/ModifyOutgoingResponsePhase.js +2 -2
- package/lib/cjs/phase/impl/RiskApiPhase.js +18 -19
- package/lib/cjs/phase/impl/SendLogsPhase.js +7 -11
- package/lib/cjs/phase/impl/index.js +1 -0
- package/lib/cjs/products/account_defender/AccountDefender.js +18 -10
- package/lib/cjs/products/bot_defender/BotDefender.js +10 -11
- package/lib/cjs/products/bot_defender/block/DefaultBotDefenderBlocker.js +1 -1
- package/lib/cjs/products/bot_defender/block/captcha/JsonCaptchaBlocker.js +3 -2
- package/lib/cjs/products/bot_defender/first_party/IDefaultBotDefenderFirstPartyConfiguration.js +1 -0
- package/lib/cjs/products/credential_intelligence/CredentialIntelligence.js +13 -11
- package/lib/cjs/products/credential_intelligence/endpoint/CredentialEndpoint.js +3 -3
- package/lib/cjs/products/credential_intelligence/endpoint/CredentialEndpointManager.js +12 -14
- package/lib/cjs/products/credential_intelligence/endpoint/extractor/BodyCredentialExtractor.js +5 -4
- package/lib/cjs/products/credential_intelligence/endpoint/extractor/CredentialExtractorFactory.js +15 -3
- package/lib/cjs/products/credential_intelligence/endpoint/extractor/HeaderCredentialExtractor.js +3 -2
- package/lib/cjs/products/credential_intelligence/endpoint/extractor/QueryParamCredentialExtractor.js +4 -3
- package/lib/cjs/products/credential_intelligence/endpoint/hash_protocol/MultistepHashProtocol.js +10 -10
- package/lib/cjs/products/credential_intelligence/endpoint/hash_protocol/SingleStepHashProtocol.js +14 -14
- package/lib/cjs/products/credential_intelligence/endpoint/login_successful/BodyLoginSuccessfulParser.js +3 -4
- package/lib/cjs/products/credential_intelligence/endpoint/login_successful/CustomLoginSuccessfulParser.js +7 -6
- package/lib/cjs/products/credential_intelligence/endpoint/login_successful/HeaderLoginSuccessfulParser.js +7 -1
- package/lib/cjs/products/credential_intelligence/endpoint/login_successful/LoginSuccessfulParserFactory.js +6 -2
- package/lib/cjs/products/credential_intelligence/endpoint/login_successful/StatusLoginSuccessfulParser.js +3 -0
- package/lib/cjs/products/hype_sale_challenge/HypeSaleChallenge.js +11 -10
- package/lib/cjs/pxde/DefaultDataEnrichment.js +7 -4
- package/lib/cjs/pxhd/PXHDUtils.js +2 -1
- package/lib/cjs/risk_api/client/PostRiskApiClientBase.js +19 -15
- package/lib/cjs/risk_api/risk_response/v2/DefaultRiskResponseV2.js +4 -3
- package/lib/cjs/risk_token/index.js +2 -3
- package/lib/cjs/risk_token/parser/TokenParserBase.js +13 -10
- package/lib/cjs/risk_token/token/TokenBase.js +27 -0
- package/lib/cjs/risk_token/token/serialize/SerializedToken.js +5 -2
- package/lib/cjs/risk_token/token/v2/DefaultTokenV2.js +23 -43
- package/lib/cjs/risk_token/token/v3/DefaultTokenV3.js +23 -38
- package/lib/cjs/utils/constants.js +1 -1
- package/lib/cjs/utils/cookie_parser/StringSplitCookieParser.js +6 -2
- package/lib/cjs/utils/error/EnforcerConfigurationError.js +35 -0
- package/lib/cjs/utils/error/EnforcerErrorName.js +1 -0
- package/lib/cjs/utils/error/index.js +18 -7
- package/lib/cjs/utils/timestamp_hmac_header_validator/DefaultTimestampHmacHeaderValidator.js +5 -3
- package/lib/cjs/utils/utils.js +20 -14
- package/lib/esm/action/utils.js +8 -2
- package/lib/esm/activities/HttpActivityClient.js +1 -1
- package/lib/esm/activities/utils.js +15 -12
- package/lib/esm/blocker/BlockerBase.js +2 -2
- package/lib/esm/config/ConfigurationBase.js +117 -101
- package/lib/esm/config/defaults/DefaultConfigurationParams.js +3 -3
- package/lib/esm/config/params/index.js +4 -7
- package/lib/esm/config/remote_config/DefaultRemoteConfigUpdater.js +6 -2
- package/lib/esm/config/remote_config/RemoteConfigUtils.js +2 -2
- package/lib/esm/config/remote_config/service_client/HttpRemoteConfigServiceClient.js +3 -3
- package/lib/esm/context/DefaultContext.js +9 -5
- package/lib/esm/context/SerializedContext.js +1 -1
- package/lib/esm/cors/DefaultCors.js +6 -2
- package/lib/esm/enforcer/EnforcerBase.js +0 -1
- package/lib/esm/enforcer/utils.js +5 -5
- package/lib/esm/graphql/DefaultGraphQLParser.js +8 -8
- package/lib/esm/http/utils/FormDataImpl.js +1 -1
- package/lib/esm/impl/hash/CryptoJSHashUtils.js +2 -2
- package/lib/esm/impl/http/phin/PhinHttpClient.js +3 -3
- package/lib/esm/impl/http/phin/PhinIncomingResponse.js +14 -3
- package/lib/esm/impl/url/CustomImplUrlUtils.js +2 -2
- package/lib/esm/impl/url/UrlImpl.js +4 -1
- package/lib/esm/impl/url/UrlSearchParamsImpl.js +6 -4
- package/lib/esm/phase/flow/EndEnforcerFlow.js +7 -1
- package/lib/esm/phase/flow/EnforceFlow.js +1 -1
- package/lib/esm/phase/flow/FilterFlow.js +19 -7
- package/lib/esm/phase/flow/PostEnforceFlow.js +1 -1
- package/lib/esm/phase/impl/ClearLogsPhase.js +6 -0
- package/lib/esm/phase/impl/CompositePhase.js +1 -1
- package/lib/esm/phase/impl/CreateBlockResponsePhase.js +4 -2
- package/lib/esm/phase/impl/EnrichContextFromResponsePhase.js +6 -4
- package/lib/esm/phase/impl/ModifyOutgoingResponsePhase.js +1 -1
- package/lib/esm/phase/impl/RiskApiPhase.js +5 -4
- package/lib/esm/phase/impl/SendLogsPhase.js +2 -5
- package/lib/esm/phase/impl/index.js +1 -0
- package/lib/esm/products/account_defender/AccountDefender.js +17 -9
- package/lib/esm/products/bot_defender/BotDefender.js +7 -7
- package/lib/esm/products/bot_defender/block/DefaultBotDefenderBlocker.js +1 -1
- package/lib/esm/products/bot_defender/block/captcha/JsonCaptchaBlocker.js +2 -2
- package/lib/esm/products/bot_defender/first_party/IDefaultBotDefenderFirstPartyConfiguration.js +1 -0
- package/lib/esm/products/credential_intelligence/CredentialIntelligence.js +8 -6
- package/lib/esm/products/credential_intelligence/endpoint/CredentialEndpoint.js +3 -3
- package/lib/esm/products/credential_intelligence/endpoint/CredentialEndpointManager.js +9 -5
- package/lib/esm/products/credential_intelligence/endpoint/extractor/BodyCredentialExtractor.js +4 -4
- package/lib/esm/products/credential_intelligence/endpoint/extractor/CredentialExtractorFactory.js +15 -3
- package/lib/esm/products/credential_intelligence/endpoint/extractor/HeaderCredentialExtractor.js +2 -2
- package/lib/esm/products/credential_intelligence/endpoint/extractor/QueryParamCredentialExtractor.js +2 -2
- package/lib/esm/products/credential_intelligence/endpoint/hash_protocol/MultistepHashProtocol.js +2 -2
- package/lib/esm/products/credential_intelligence/endpoint/hash_protocol/SingleStepHashProtocol.js +5 -2
- package/lib/esm/products/credential_intelligence/endpoint/login_successful/BodyLoginSuccessfulParser.js +1 -1
- package/lib/esm/products/credential_intelligence/endpoint/login_successful/CustomLoginSuccessfulParser.js +1 -1
- package/lib/esm/products/credential_intelligence/endpoint/login_successful/HeaderLoginSuccessfulParser.js +7 -1
- package/lib/esm/products/credential_intelligence/endpoint/login_successful/LoginSuccessfulParserFactory.js +7 -3
- package/lib/esm/products/credential_intelligence/endpoint/login_successful/StatusLoginSuccessfulParser.js +3 -0
- package/lib/esm/products/hype_sale_challenge/HypeSaleChallenge.js +10 -10
- package/lib/esm/pxde/DefaultDataEnrichment.js +5 -2
- package/lib/esm/pxhd/PXHDUtils.js +1 -1
- package/lib/esm/risk_api/client/PostRiskApiClientBase.js +7 -5
- package/lib/esm/risk_api/risk_response/v2/DefaultRiskResponseV2.js +3 -2
- package/lib/esm/risk_token/index.js +1 -1
- package/lib/esm/risk_token/parser/TokenParserBase.js +4 -2
- package/lib/esm/risk_token/token/TokenBase.js +12 -0
- package/lib/esm/risk_token/token/serialize/SerializedToken.js +5 -2
- package/lib/esm/risk_token/token/v2/DefaultTokenV2.js +12 -17
- package/lib/esm/risk_token/token/v3/DefaultTokenV3.js +21 -20
- package/lib/esm/utils/constants.js +1 -1
- package/lib/esm/utils/cookie_parser/StringSplitCookieParser.js +6 -2
- package/lib/esm/utils/error/EnforcerConfigurationError.js +12 -0
- package/lib/esm/utils/error/EnforcerErrorName.js +1 -0
- package/lib/esm/utils/error/index.js +4 -3
- package/lib/esm/utils/timestamp_hmac_header_validator/DefaultTimestampHmacHeaderValidator.js +4 -2
- package/lib/esm/utils/utils.js +15 -15
- package/lib/types/action/Decision.d.ts +2 -2
- package/lib/types/activities/HttpActivityClient.d.ts +3 -3
- package/lib/types/activities/HttpBatchedActivityClient.d.ts +2 -2
- package/lib/types/activities/model/AsyncActivityDetails.d.ts +1 -1
- package/lib/types/activities/utils.d.ts +13 -6775
- package/lib/types/additional_activity_handler/AdditionalActivityHandler.d.ts +2 -2
- package/lib/types/additional_activity_handler/AdditionalActivityHandlerUtils.d.ts +1 -1
- package/lib/types/blocker/BlockerBase.d.ts +1 -1
- package/lib/types/blocker/MobileBlocker.d.ts +3 -3
- package/lib/types/blocker/model/BlockData.d.ts +1 -1
- package/lib/types/blocker/utils.d.ts +1 -672
- package/lib/types/config/ConfigurationBase.d.ts +34 -33
- package/lib/types/config/ConfigurationBuilderBase.d.ts +6 -6
- package/lib/types/config/IConfiguration.d.ts +22 -22
- package/lib/types/config/defaults/DefaultConfigurationParams.d.ts +2 -2
- package/lib/types/config/params/ActiveConfigurationParams.d.ts +2 -0
- package/lib/types/config/params/AllConfigurationParams.d.ts +4 -0
- package/lib/types/config/params/{CommonConfigurationParams.d.ts → CoreConfigurationParams.d.ts} +45 -18
- package/lib/types/config/params/RemoteConfigurationParams.d.ts +2 -3
- package/lib/types/config/params/StaticConfigurationParams.d.ts +3 -3
- package/lib/types/config/params/index.d.ts +4 -7
- package/lib/types/config/remote_config/DefaultRemoteConfigUpdater.d.ts +14 -15
- package/lib/types/config/remote_config/RemoteConfigUtils.d.ts +2 -2
- package/lib/types/config/remote_config/model/RemoteConfigData.d.ts +2 -2
- package/lib/types/config/remote_config/service_client/HttpRemoteConfigServiceClient.d.ts +6 -6
- package/lib/types/config/remote_config/service_client/IRemoteConfigServiceClient.d.ts +2 -2
- package/lib/types/config/remote_config/storage_client/IRemoteConfigStorageClient.d.ts +3 -3
- package/lib/types/context/ContextJson.d.ts +3 -3
- package/lib/types/context/DefaultContext.d.ts +11 -11
- package/lib/types/context/SerializedContext.d.ts +8 -8
- package/lib/types/context/interfaces/IContext.d.ts +6 -6
- package/lib/types/context/interfaces/MobileData.d.ts +1 -1
- package/lib/types/context/interfaces/TokenData.d.ts +1 -1
- package/lib/types/cors/DefaultCors.d.ts +3 -3
- package/lib/types/cors/ICors.d.ts +3 -3
- package/lib/types/custom_parameters/CustomParametersFunction.d.ts +2 -2
- package/lib/types/custom_parameters/CustomParametersUtils.d.ts +2 -2
- package/lib/types/enforcer/EnforcerBase.d.ts +7 -8
- package/lib/types/enforcer/EnforcerOptions.d.ts +6 -6
- package/lib/types/enforcer/utils.d.ts +2 -2
- package/lib/types/graphql/DefaultGraphQLParser.d.ts +13 -12
- package/lib/types/graphql/ExtractGraphQLKeywordsFunction.d.ts +1 -1
- package/lib/types/graphql/IGraphQLParser.d.ts +1 -1
- package/lib/types/http/interfaces/IFormData.d.ts +1 -1
- package/lib/types/http/utils/FormDataImpl.d.ts +2 -2
- package/lib/types/http/utils/MultipartFormDataUtils.d.ts +2 -2
- package/lib/types/impl/cipher/CryptoCipherUtils.d.ts +0 -1
- package/lib/types/impl/hash/CryptoHashUtils.d.ts +0 -1
- package/lib/types/impl/hmac/CryptoHmacUtils.d.ts +0 -1
- package/lib/types/impl/http/phin/PhinIncomingResponse.d.ts +0 -1
- package/lib/types/impl/url/CustomImplUrlUtils.d.ts +2 -2
- package/lib/types/impl/url/UrlImpl.d.ts +3 -3
- package/lib/types/impl/url/UrlSearchParamsImpl.d.ts +1 -1
- package/lib/types/logger/DefaultLogger.d.ts +1 -1
- package/lib/types/logger/HttpLogServiceClient.d.ts +3 -3
- package/lib/types/logger/ILogger.d.ts +2 -2
- package/lib/types/logger/LoggerBase.d.ts +4 -4
- package/lib/types/monitored_request/MonitoredRequestUtils.d.ts +3 -2016
- package/lib/types/phase/flow/EndEnforcerFlow.d.ts +2 -2
- package/lib/types/phase/flow/EnforceFlow.d.ts +2 -2
- package/lib/types/phase/flow/FilterFlow.d.ts +7 -2
- package/lib/types/phase/flow/PostEnforceFlow.d.ts +2 -2
- package/lib/types/phase/impl/AdditionalActivityHandlerPhase.d.ts +3 -3
- package/lib/types/phase/impl/ClearLogsPhase.d.ts +6 -0
- package/lib/types/phase/impl/CreateBlockResponsePhase.d.ts +4 -4
- package/lib/types/phase/impl/EnrichContextFromRequestPhase.d.ts +3 -3
- package/lib/types/phase/impl/EnrichContextFromResponsePhase.d.ts +3 -3
- package/lib/types/phase/impl/FirstPartyPhase.d.ts +3 -3
- package/lib/types/phase/impl/ModifyOutgoingResponsePhase.d.ts +3 -3
- package/lib/types/phase/impl/PreflightPhase.d.ts +2 -2
- package/lib/types/phase/impl/RiskApiPhase.d.ts +1 -2
- package/lib/types/phase/impl/SendLogsPhase.d.ts +2 -3
- package/lib/types/phase/impl/UpdateRemoteConfigPhase.d.ts +3 -3
- package/lib/types/phase/impl/index.d.ts +1 -0
- package/lib/types/products/account_defender/AccountDefender.d.ts +7 -7
- package/lib/types/products/bot_defender/BotDefender.d.ts +12 -11
- package/lib/types/products/bot_defender/block/DefaultBotDefenderBlocker.d.ts +4 -4
- package/lib/types/products/bot_defender/block/captcha/CaptchaBlocker.d.ts +12 -12
- package/lib/types/products/bot_defender/block/captcha/HtmlCaptchaBlocker.d.ts +5 -5
- package/lib/types/products/bot_defender/block/captcha/JsonCaptchaBlocker.d.ts +5 -5
- package/lib/types/products/bot_defender/block/captcha/MobileCaptchaBlocker.d.ts +4 -4
- package/lib/types/products/bot_defender/filter/DefaultBotDefenderFilter.d.ts +2 -2
- package/lib/types/products/bot_defender/first_party/DefaultBotDefenderFirstParty.d.ts +3 -3
- package/lib/types/products/bot_defender/first_party/utils.d.ts +7 -7
- package/lib/types/products/credential_intelligence/CredentialIntelligence.d.ts +9 -9
- package/lib/types/products/credential_intelligence/endpoint/CredentialEndpoint.d.ts +4 -4
- package/lib/types/products/credential_intelligence/endpoint/CredentialEndpointConfiguration.d.ts +4 -4
- package/lib/types/products/credential_intelligence/endpoint/CredentialEndpointManager.d.ts +2 -4
- package/lib/types/products/credential_intelligence/endpoint/ICredentialEndpoint.d.ts +3 -2
- package/lib/types/products/credential_intelligence/endpoint/extractor/BodyCredentialExtractor.d.ts +2 -2
- package/lib/types/products/credential_intelligence/endpoint/login_successful/CustomLoginSuccessfulParser.d.ts +3 -3
- package/lib/types/products/credential_intelligence/endpoint/login_successful/ILoginSuccessfulParser.d.ts +1 -1
- package/lib/types/products/credential_intelligence/endpoint/login_successful/LoginSuccessfulParserFactory.d.ts +1 -1
- package/lib/types/products/credential_intelligence/endpoint/login_successful/StatusLoginSuccessfulParser.d.ts +1 -1
- package/lib/types/products/credential_intelligence/model/CredentialIntelligenceData.d.ts +1 -1
- package/lib/types/products/hype_sale_challenge/HypeSaleChallenge.d.ts +8 -8
- package/lib/types/products/hype_sale_challenge/block/JsonHypeSaleChallengeBlocker.d.ts +3 -3
- package/lib/types/products/hype_sale_challenge/block/MobileHypeSaleChallengeBlocker.d.ts +2 -2
- package/lib/types/products/interfaces/IProduct.d.ts +3 -3
- package/lib/types/products/interfaces/ProductType.d.ts +2 -1
- package/lib/types/pxde/DefaultDataEnrichment.d.ts +2 -2
- package/lib/types/pxde/model/PxdeData.d.ts +1 -1
- package/lib/types/pxhd/PXHDUtils.d.ts +2 -1344
- package/lib/types/risk_api/client/PostRiskApiClientBase.d.ts +4 -3
- package/lib/types/risk_api/client/PostRiskApiClientV2.d.ts +2 -2
- package/lib/types/risk_api/client/PostRiskApiClientV3.d.ts +2 -2
- package/lib/types/risk_api/risk_response/IRiskResponse.d.ts +4 -4
- package/lib/types/risk_api/risk_response/RiskResponseBase.d.ts +13 -13
- package/lib/types/risk_api/risk_response/serialize/RiskResponseJson.d.ts +4 -4
- package/lib/types/risk_api/risk_response/serialize/SerializedRiskResponse.d.ts +10 -10
- package/lib/types/risk_api/risk_response/v2/DefaultRiskResponseV2.d.ts +1 -1
- package/lib/types/risk_api/risk_response/v3/DefaultRiskResponseV3.d.ts +1 -1
- package/lib/types/risk_token/index.d.ts +1 -1
- package/lib/types/risk_token/parser/DefaultTokenV2Parser.d.ts +3 -3
- package/lib/types/risk_token/parser/DefaultTokenV3Parser.d.ts +3 -3
- package/lib/types/risk_token/parser/TokenParserBase.d.ts +5 -5
- package/lib/types/risk_token/token/IToken.d.ts +7 -7
- package/lib/types/risk_token/token/TokenBase.d.ts +12 -12
- package/lib/types/risk_token/token/serialize/SerializedToken.d.ts +10 -10
- package/lib/types/risk_token/token/serialize/TokenJson.d.ts +5 -5
- package/lib/types/risk_token/token/v2/DefaultTokenV2.d.ts +7 -11
- package/lib/types/risk_token/token/v3/DefaultTokenV3.d.ts +9 -13
- package/lib/types/sensitive_request/SensitiveRequestUtils.d.ts +3 -1345
- package/lib/types/telemetry/DefaultTelemetry.d.ts +4 -4
- package/lib/types/telemetry/model/TelemetryActivity.d.ts +9 -9
- package/lib/types/utils/WaitsUntil.d.ts +1 -1
- package/lib/types/utils/constants.d.ts +1 -1
- package/lib/types/utils/error/EnforcerConfigurationError.d.ts +4 -0
- package/lib/types/utils/error/EnforcerErrorName.d.ts +2 -1
- package/lib/types/utils/error/index.d.ts +4 -3
- package/lib/types/utils/timestamp_hmac_header_validator/DefaultTimestampHmacHeaderValidator.d.ts +3 -3
- package/lib/types/utils/url/IUrlSearchParams.d.ts +1 -1
- package/lib/types/utils/utils.d.ts +12 -9
- package/package.json +1 -1
- package/lib/cjs/config/params/RemoteConfigurationParamsOnly.js +0 -2
- package/lib/cjs/config/params/StaticConfigurationParamsOnly.js +0 -2
- package/lib/cjs/config/params/TokenV3ConfigurationParamsOnly.js +0 -2
- package/lib/esm/config/params/RemoteConfigurationParamsOnly.js +0 -1
- package/lib/esm/config/params/StaticConfigurationParamsOnly.js +0 -1
- package/lib/esm/config/params/TokenV3ConfigurationParamsOnly.js +0 -1
- package/lib/types/config/params/BatchedActivitiesConfigParams.d.ts +0 -4
- package/lib/types/config/params/ConfigurationParams.d.ts +0 -4
- package/lib/types/config/params/RemoteConfigurationParamsOnly.d.ts +0 -10
- package/lib/types/config/params/StaticConfigurationParamsOnly.d.ts +0 -7
- package/lib/types/config/params/TokenV3ConfigurationParamsOnly.d.ts +0 -7
- /package/lib/cjs/config/params/{BatchedActivitiesConfigParams.js → ActiveConfigurationParams.js} +0 -0
- /package/lib/cjs/config/params/{CommonConfigurationParams.js → AllConfigurationParams.js} +0 -0
- /package/lib/cjs/config/params/{ConfigurationParams.js → CoreConfigurationParams.js} +0 -0
- /package/lib/esm/config/params/{BatchedActivitiesConfigParams.js → ActiveConfigurationParams.js} +0 -0
- /package/lib/esm/config/params/{CommonConfigurationParams.js → AllConfigurationParams.js} +0 -0
- /package/lib/esm/config/params/{ConfigurationParams.js → CoreConfigurationParams.js} +0 -0
package/lib/cjs/action/utils.js
CHANGED
|
@@ -45,9 +45,16 @@ var createDecision = function (tally) {
|
|
|
45
45
|
return { action: action, reasons: tally[action] };
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
return { action: Action_1.Action.PASS_REQUEST };
|
|
48
|
+
return { action: Action_1.Action.PASS_REQUEST, reasons: {} };
|
|
49
49
|
};
|
|
50
50
|
var getReasonForHighestPriorityProduct = function (reasons) {
|
|
51
|
-
|
|
51
|
+
for (var _i = 0, PRODUCT_PRIORITY_ORDER_1 = products_1.PRODUCT_PRIORITY_ORDER; _i < PRODUCT_PRIORITY_ORDER_1.length; _i++) {
|
|
52
|
+
var productName = PRODUCT_PRIORITY_ORDER_1[_i];
|
|
53
|
+
var reason = reasons[productName];
|
|
54
|
+
if (reason) {
|
|
55
|
+
return reason;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return 'unknown_reason';
|
|
52
59
|
};
|
|
53
60
|
exports.getReasonForHighestPriorityProduct = getReasonForHighestPriorityProduct;
|
|
@@ -88,7 +88,7 @@ var HttpActivityClient = /** @class */ (function () {
|
|
|
88
88
|
};
|
|
89
89
|
HttpActivityClient.prototype.shouldCreateAdditionalS2SActivity = function (context) {
|
|
90
90
|
return (this.shouldCreatePageRequestedActivity(context) &&
|
|
91
|
-
context.productData.ci &&
|
|
91
|
+
!!context.productData.ci &&
|
|
92
92
|
this.config.ciAutomaticAdditionalS2SEnabled);
|
|
93
93
|
};
|
|
94
94
|
HttpActivityClient.prototype.createBlockActivity = function (context) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toHeaderEntryArray = exports.createAdditionalS2SActivityDetails = exports.createBlockActivityDetails = exports.createPageRequestedActivityDetails = exports.addResponseDataToAsyncActivityCommonDetails = exports.addRiskApiDataToAsyncActivityCommonDetails = exports.addTokenDataToDetails = exports.addRequestDataToDetails = exports.addServerDataToDetails = exports.addTlsDataToDetails = exports.addProductDataToDetails = exports.addCustomParametersToDetails = exports.addConfigDataToDetails = exports.
|
|
3
|
+
exports.toHeaderEntryArray = exports.createAdditionalS2SActivityDetails = exports.createBlockActivityDetails = exports.createPageRequestedActivityDetails = exports.addResponseDataToAsyncActivityCommonDetails = exports.addRiskApiDataToAsyncActivityCommonDetails = exports.addTokenDataToDetails = exports.addRequestDataToDetails = exports.addServerDataToDetails = exports.addTlsDataToDetails = exports.addProductDataToDetails = exports.addCustomParametersToDetails = exports.addConfigDataToDetails = exports.addRootContextDataToDetails = exports.createCommonActivityDetails = exports.createAsyncActivityCommonDetails = exports.createActivityDetails = exports.createAsyncActivity = void 0;
|
|
4
|
+
exports.redactCookieSecret = redactCookieSecret;
|
|
4
5
|
var utils_1 = require("../utils");
|
|
5
6
|
var products_1 = require("../products");
|
|
6
7
|
var action_1 = require("../action");
|
|
@@ -51,7 +52,7 @@ var createAsyncActivityCommonDetails = function (context) {
|
|
|
51
52
|
};
|
|
52
53
|
exports.createAsyncActivityCommonDetails = createAsyncActivityCommonDetails;
|
|
53
54
|
var createCommonActivityDetails = function (config, context) {
|
|
54
|
-
var _a;
|
|
55
|
+
var _a, _b;
|
|
55
56
|
var details = {
|
|
56
57
|
module_version: config.moduleVersion,
|
|
57
58
|
// Note: risk_mode currently reflects only Bot Defender mode
|
|
@@ -64,7 +65,7 @@ var createCommonActivityDetails = function (config, context) {
|
|
|
64
65
|
(0, exports.addProductDataToDetails)(details, context.productData);
|
|
65
66
|
(0, exports.addServerDataToDetails)(details, context.serverData);
|
|
66
67
|
(0, exports.addTlsDataToDetails)(details, context.tlsData);
|
|
67
|
-
(0, exports.addCustomParametersToDetails)(details, context.customParameters);
|
|
68
|
+
(0, exports.addCustomParametersToDetails)(details, (_b = context.customParameters) !== null && _b !== void 0 ? _b : null);
|
|
68
69
|
return details;
|
|
69
70
|
};
|
|
70
71
|
exports.createCommonActivityDetails = createCommonActivityDetails;
|
|
@@ -84,7 +85,6 @@ exports.addRootContextDataToDetails = addRootContextDataToDetails;
|
|
|
84
85
|
function redactCookieSecret(secret) {
|
|
85
86
|
return '***'.concat(secret.substring(secret.length - 3, secret.length));
|
|
86
87
|
}
|
|
87
|
-
exports.redactCookieSecret = redactCookieSecret;
|
|
88
88
|
var addConfigDataToDetails = function (details, config) {
|
|
89
89
|
if (config.remoteConfigVersion) {
|
|
90
90
|
details.remote_config_version = config.remoteConfigVersion;
|
|
@@ -193,8 +193,9 @@ var addResponseDataToAsyncActivityCommonDetails = function (details, context) {
|
|
|
193
193
|
};
|
|
194
194
|
exports.addResponseDataToAsyncActivityCommonDetails = addResponseDataToAsyncActivityCommonDetails;
|
|
195
195
|
var createPageRequestedActivityDetails = function (context) {
|
|
196
|
-
var details = {
|
|
197
|
-
|
|
196
|
+
var details = {
|
|
197
|
+
pass_reason: (0, action_1.getReasonForHighestPriorityProduct)(context.reasons),
|
|
198
|
+
};
|
|
198
199
|
(0, utils_1.transferExistingProperties)(context.riskApiData, details, {
|
|
199
200
|
errorReason: 's2s_error_reason',
|
|
200
201
|
errorHttpStatus: 's2s_error_http_status',
|
|
@@ -204,19 +205,21 @@ var createPageRequestedActivityDetails = function (context) {
|
|
|
204
205
|
};
|
|
205
206
|
exports.createPageRequestedActivityDetails = createPageRequestedActivityDetails;
|
|
206
207
|
var createBlockActivityDetails = function (context) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
return details;
|
|
208
|
+
return {
|
|
209
|
+
block_reason: (0, action_1.getReasonForHighestPriorityProduct)(context.reasons),
|
|
210
|
+
simulated_block: context.action === action_1.Action.SIMULATED_BLOCK,
|
|
211
|
+
block_action: context.blockAction,
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
block_score: context.score,
|
|
214
|
+
};
|
|
215
215
|
};
|
|
216
216
|
exports.createBlockActivityDetails = createBlockActivityDetails;
|
|
217
217
|
var createAdditionalS2SActivityDetails = function (_a, _b) {
|
|
218
218
|
var ciSendRawUsernameOnAdditionalS2SActivity = _a.ciSendRawUsernameOnAdditionalS2SActivity;
|
|
219
219
|
var productData = _b.productData;
|
|
220
|
+
if (!productData.ci) {
|
|
221
|
+
throw new utils_1.EnforcerError("productData.ci is undefined");
|
|
222
|
+
}
|
|
220
223
|
var _c = productData.ci, rawUsername = _c.rawUsername, isCompromised = _c.isCompromised, isLoginSuccessful = _c.isLoginSuccessful;
|
|
221
224
|
var details = { login_successful: isLoginSuccessful };
|
|
222
225
|
if (isCompromised &&
|
|
@@ -10,7 +10,7 @@ var BlockerBase = /** @class */ (function () {
|
|
|
10
10
|
}
|
|
11
11
|
BlockerBase.prototype.createBlockResponse = function (context) {
|
|
12
12
|
var status = this.statusCode;
|
|
13
|
-
var headers = this.createHeaders(
|
|
13
|
+
var headers = this.createHeaders();
|
|
14
14
|
var body = this.createBlockBody(context);
|
|
15
15
|
return new http_1.MinimalResponseImpl({
|
|
16
16
|
status: status,
|
|
@@ -18,7 +18,7 @@ var BlockerBase = /** @class */ (function () {
|
|
|
18
18
|
body: body,
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
BlockerBase.prototype.createHeaders = function (
|
|
21
|
+
BlockerBase.prototype.createHeaders = function () {
|
|
22
22
|
var _a;
|
|
23
23
|
return _a = {},
|
|
24
24
|
_a[http_1.CONTENT_TYPE_HEADER_NAME] = [this.contentType],
|