@okta/okta-auth-js 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -0
- package/cjs/authn/AuthnTransactionImpl.js +6 -8
- package/cjs/authn/AuthnTransactionImpl.js.map +1 -1
- package/cjs/authn/api.js +3 -18
- package/cjs/authn/api.js.map +1 -1
- package/cjs/authn/factory.js +1 -7
- package/cjs/authn/factory.js.map +1 -1
- package/cjs/authn/index.js +0 -5
- package/cjs/authn/index.js.map +1 -1
- package/cjs/authn/mixin.js +14 -22
- package/cjs/authn/mixin.js.map +1 -1
- package/cjs/authn/util/flattenEmbedded.js +5 -12
- package/cjs/authn/util/flattenEmbedded.js.map +1 -1
- package/cjs/authn/util/link2fn.js +0 -22
- package/cjs/authn/util/link2fn.js.map +1 -1
- package/cjs/authn/util/links2fns.js +0 -12
- package/cjs/authn/util/links2fns.js.map +1 -1
- package/cjs/authn/util/poll.js +9 -27
- package/cjs/authn/util/poll.js.map +1 -1
- package/cjs/authn/util/stateToken.js +3 -4
- package/cjs/authn/util/stateToken.js.map +1 -1
- package/cjs/base/factory.js +6 -14
- package/cjs/base/factory.js.map +1 -1
- package/cjs/base/index.js +0 -5
- package/cjs/base/index.js.map +1 -1
- package/cjs/base/options.js +1 -2
- package/cjs/base/options.js.map +1 -1
- package/cjs/browser/browserStorage.js +15 -43
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/browser/fingerprint.js +3 -15
- package/cjs/browser/fingerprint.js.map +1 -1
- package/cjs/clock.js +5 -7
- package/cjs/clock.js.map +1 -1
- package/cjs/constants.js +4 -3
- package/cjs/constants.js.map +1 -1
- package/cjs/core/AuthStateManager.js +24 -48
- package/cjs/core/AuthStateManager.js.map +1 -1
- package/cjs/core/ServiceManager/browser.js +13 -33
- package/cjs/core/ServiceManager/browser.js.map +1 -1
- package/cjs/core/ServiceManager/index.js +0 -1
- package/cjs/core/ServiceManager/index.js.map +1 -1
- package/cjs/core/ServiceManager/node.js +3 -9
- package/cjs/core/ServiceManager/node.js.map +1 -1
- package/cjs/core/factory.js +0 -7
- package/cjs/core/factory.js.map +1 -1
- package/cjs/core/index.js +0 -13
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/mixin.js +16 -20
- package/cjs/core/mixin.js.map +1 -1
- package/cjs/core/options.js +1 -3
- package/cjs/core/options.js.map +1 -1
- package/cjs/core/storage.js +0 -2
- package/cjs/core/storage.js.map +1 -1
- package/cjs/core/types/index.js +0 -5
- package/cjs/core/types/index.js.map +1 -1
- package/cjs/crypto/base64.js +9 -22
- package/cjs/crypto/base64.js.map +1 -1
- package/cjs/crypto/browser.js +0 -4
- package/cjs/crypto/browser.js.map +1 -1
- package/cjs/crypto/index.js +0 -9
- package/cjs/crypto/index.js.map +1 -1
- package/cjs/crypto/node.js +0 -13
- package/cjs/crypto/node.js.map +1 -1
- package/cjs/crypto/oidcHash.js +1 -4
- package/cjs/crypto/oidcHash.js.map +1 -1
- package/cjs/crypto/verifyToken.js +6 -7
- package/cjs/crypto/verifyToken.js.map +1 -1
- package/cjs/crypto/webcrypto.js +0 -1
- package/cjs/crypto/webcrypto.js.map +1 -1
- package/cjs/errors/AuthApiError.js +1 -7
- package/cjs/errors/AuthApiError.js.map +1 -1
- package/cjs/errors/AuthPollStopError.js +1 -5
- package/cjs/errors/AuthPollStopError.js.map +1 -1
- package/cjs/errors/AuthSdkError.js +1 -6
- package/cjs/errors/AuthSdkError.js.map +1 -1
- package/cjs/errors/CustomError.js +1 -4
- package/cjs/errors/CustomError.js.map +1 -1
- package/cjs/errors/OAuthError.js +4 -7
- package/cjs/errors/OAuthError.js.map +1 -1
- package/cjs/errors/index.js +1 -9
- package/cjs/errors/index.js.map +1 -1
- package/cjs/exports/authn.js +0 -9
- package/cjs/exports/authn.js.map +1 -1
- package/cjs/exports/cdn/authn.js +0 -2
- package/cjs/exports/cdn/authn.js.map +1 -1
- package/cjs/exports/cdn/core.js +0 -2
- package/cjs/exports/cdn/core.js.map +1 -1
- package/cjs/exports/cdn/default.js +0 -2
- package/cjs/exports/cdn/default.js.map +1 -1
- package/cjs/exports/cdn/idx.js +0 -2
- package/cjs/exports/cdn/idx.js.map +1 -1
- package/cjs/exports/cdn/myaccount.js +0 -2
- package/cjs/exports/cdn/myaccount.js.map +1 -1
- package/cjs/exports/common.js +0 -22
- package/cjs/exports/common.js.map +1 -1
- package/cjs/exports/core.js +0 -9
- package/cjs/exports/core.js.map +1 -1
- package/cjs/exports/default.js +2 -12
- package/cjs/exports/default.js.map +1 -1
- package/cjs/exports/idx.js +3 -7
- package/cjs/exports/idx.js.map +1 -1
- package/cjs/exports/myaccount.js +0 -9
- package/cjs/exports/myaccount.js.map +1 -1
- package/cjs/features.js +1 -18
- package/cjs/features.js.map +1 -1
- package/cjs/fetch/fetchRequest.js +6 -20
- package/cjs/fetch/fetchRequest.js.map +1 -1
- package/cjs/http/OktaUserAgent.js +3 -11
- package/cjs/http/OktaUserAgent.js.map +1 -1
- package/cjs/http/headers.js +1 -1
- package/cjs/http/headers.js.map +1 -1
- package/cjs/http/index.js +0 -11
- package/cjs/http/index.js.map +1 -1
- package/cjs/http/mixin.js +2 -10
- package/cjs/http/mixin.js.map +1 -1
- package/cjs/http/options.js +1 -5
- package/cjs/http/options.js.map +1 -1
- package/cjs/http/request.js +75 -57
- package/cjs/http/request.js.map +1 -1
- package/cjs/idx/IdxTransactionManager.js +2 -22
- package/cjs/idx/IdxTransactionManager.js.map +1 -1
- package/cjs/idx/authenticate.js +3 -5
- package/cjs/idx/authenticate.js.map +1 -1
- package/cjs/idx/authenticator/Authenticator.js +2 -4
- package/cjs/idx/authenticator/Authenticator.js.map +1 -1
- package/cjs/idx/authenticator/OktaPassword.js +2 -10
- package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
- package/cjs/idx/authenticator/OktaVerifyTotp.js +0 -6
- package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +0 -10
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +1 -10
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +2 -10
- package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnEnrollment.js +0 -8
- package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/WebauthnVerification.js +0 -8
- package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -1
- package/cjs/idx/authenticator/getAuthenticator.js +0 -15
- package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
- package/cjs/idx/authenticator/index.js +0 -15
- package/cjs/idx/authenticator/index.js.map +1 -1
- package/cjs/idx/authenticator/util.js +8 -18
- package/cjs/idx/authenticator/util.js.map +1 -1
- package/cjs/idx/cancel.js +3 -4
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/emailVerify.js +5 -13
- package/cjs/idx/emailVerify.js.map +1 -1
- package/cjs/idx/factory/OktaAuthIdx.js +0 -3
- package/cjs/idx/factory/OktaAuthIdx.js.map +1 -1
- package/cjs/idx/factory/api.js +1 -17
- package/cjs/idx/factory/api.js.map +1 -1
- package/cjs/idx/factory/index.js +0 -3
- package/cjs/idx/factory/index.js.map +1 -1
- package/cjs/idx/flow/AccountUnlockFlow.js +1 -2
- package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -1
- package/cjs/idx/flow/AuthenticationFlow.js +1 -2
- package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
- package/cjs/idx/flow/FlowSpecification.js +2 -13
- package/cjs/idx/flow/FlowSpecification.js.map +1 -1
- package/cjs/idx/flow/PasswordRecoveryFlow.js +1 -2
- package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
- package/cjs/idx/flow/RegistrationFlow.js +1 -2
- package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
- package/cjs/idx/flow/index.js +0 -11
- package/cjs/idx/flow/index.js.map +1 -1
- package/cjs/idx/handleInteractionCodeRedirect.js +7 -12
- package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
- package/cjs/idx/idxState/index.js +1 -11
- package/cjs/idx/idxState/index.js.map +1 -1
- package/cjs/idx/idxState/v1/actionParser.js +1 -12
- package/cjs/idx/idxState/v1/actionParser.js.map +1 -1
- package/cjs/idx/idxState/v1/generateIdxAction.js +10 -15
- package/cjs/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/cjs/idx/idxState/v1/idxResponseParser.js +7 -23
- package/cjs/idx/idxState/v1/idxResponseParser.js.map +1 -1
- package/cjs/idx/idxState/v1/makeIdxState.js +2 -10
- package/cjs/idx/idxState/v1/makeIdxState.js.map +1 -1
- package/cjs/idx/idxState/v1/parsers.js +0 -2
- package/cjs/idx/idxState/v1/parsers.js.map +1 -1
- package/cjs/idx/idxState/v1/remediationParser.js +2 -4
- package/cjs/idx/idxState/v1/remediationParser.js.map +1 -1
- package/cjs/idx/index.js +0 -26
- package/cjs/idx/index.js.map +1 -1
- package/cjs/idx/interact.js +18 -18
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/introspect.js +5 -14
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/mixin.js +0 -9
- package/cjs/idx/mixin.js.map +1 -1
- package/cjs/idx/options.js +2 -3
- package/cjs/idx/options.js.map +1 -1
- package/cjs/idx/poll.js +1 -10
- package/cjs/idx/poll.js.map +1 -1
- package/cjs/idx/proceed.js +3 -9
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/recoverPassword.js +3 -4
- package/cjs/idx/recoverPassword.js.map +1 -1
- package/cjs/idx/register.js +5 -11
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +24 -45
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +7 -16
- package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js +7 -15
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -22
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +38 -67
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +13 -30
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +5 -13
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengeAuthenticator.js +1 -5
- package/cjs/idx/remediators/ChallengeAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/ChallengePoll.js +1 -6
- package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollAuthenticator.js +1 -5
- package/cjs/idx/remediators/EnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/EnrollPoll.js +5 -12
- package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
- package/cjs/idx/remediators/EnrollProfile.js +8 -30
- package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js +5 -13
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js +13 -19
- package/cjs/idx/remediators/GenericRemediator/GenericRemediator.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/index.js +0 -1
- package/cjs/idx/remediators/GenericRemediator/index.js.map +1 -1
- package/cjs/idx/remediators/GenericRemediator/util.js +19 -31
- package/cjs/idx/remediators/GenericRemediator/util.js.map +1 -1
- package/cjs/idx/remediators/Identify.js +3 -12
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js +3 -10
- package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/RedirectIdp.js +1 -7
- package/cjs/idx/remediators/RedirectIdp.js.map +1 -1
- package/cjs/idx/remediators/ResetAuthenticator.js +1 -5
- package/cjs/idx/remediators/ResetAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +3 -11
- package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorEnroll.js +1 -5
- package/cjs/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -1
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +6 -15
- package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollProfile.js +1 -6
- package/cjs/idx/remediators/SelectEnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollmentChannel.js +5 -16
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/cjs/idx/remediators/Skip.js +1 -6
- package/cjs/idx/remediators/Skip.js.map +1 -1
- package/cjs/idx/remediators/index.js +0 -39
- package/cjs/idx/remediators/index.js.map +1 -1
- package/cjs/idx/remediators/util.js +1 -7
- package/cjs/idx/remediators/util.js.map +1 -1
- package/cjs/idx/run.js +39 -54
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/startTransaction.js +1 -2
- package/cjs/idx/startTransaction.js.map +1 -1
- package/cjs/idx/storage.js +3 -22
- package/cjs/idx/storage.js.map +1 -1
- package/cjs/idx/transactionMeta.js +24 -42
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/api.js +1 -9
- package/cjs/idx/types/api.js.map +1 -1
- package/cjs/idx/types/idx-js.js +3 -3
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +0 -7
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/types/meta.js.map +1 -1
- package/cjs/idx/types/options.js.map +1 -1
- package/cjs/idx/unlockAccount.js +7 -11
- package/cjs/idx/unlockAccount.js.map +1 -1
- package/cjs/idx/util.js +24 -76
- package/cjs/idx/util.js.map +1 -1
- package/cjs/idx/webauthn.js +13 -18
- package/cjs/idx/webauthn.js.map +1 -1
- package/cjs/myaccount/api.js +0 -5
- package/cjs/myaccount/api.js.map +1 -1
- package/cjs/myaccount/emailApi.js +6 -21
- package/cjs/myaccount/emailApi.js.map +1 -1
- package/cjs/myaccount/factory.js +0 -3
- package/cjs/myaccount/factory.js.map +1 -1
- package/cjs/myaccount/index.js +0 -7
- package/cjs/myaccount/index.js.map +1 -1
- package/cjs/myaccount/mixin.js +0 -5
- package/cjs/myaccount/mixin.js.map +1 -1
- package/cjs/myaccount/phoneApi.js +5 -18
- package/cjs/myaccount/phoneApi.js.map +1 -1
- package/cjs/myaccount/profileApi.js +2 -9
- package/cjs/myaccount/profileApi.js.map +1 -1
- package/cjs/myaccount/request.js +12 -78
- package/cjs/myaccount/request.js.map +1 -1
- package/cjs/myaccount/transactions/Base.js +5 -7
- package/cjs/myaccount/transactions/Base.js.map +1 -1
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js +5 -10
- package/cjs/myaccount/transactions/EmailChallengeTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/EmailStatusTransaction.js +2 -7
- package/cjs/myaccount/transactions/EmailStatusTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/EmailTransaction.js +5 -13
- package/cjs/myaccount/transactions/EmailTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/PhoneTransaction.js +5 -12
- package/cjs/myaccount/transactions/PhoneTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/ProfileSchemaTransaction.js +0 -5
- package/cjs/myaccount/transactions/ProfileSchemaTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/ProfileTransaction.js +0 -5
- package/cjs/myaccount/transactions/ProfileTransaction.js.map +1 -1
- package/cjs/myaccount/transactions/index.js +0 -8
- package/cjs/myaccount/transactions/index.js.map +1 -1
- package/cjs/myaccount/types.js +0 -5
- package/cjs/myaccount/types.js.map +1 -1
- package/cjs/oidc/TokenManager.js +39 -100
- package/cjs/oidc/TokenManager.js.map +1 -1
- package/cjs/oidc/TransactionManager.js +19 -26
- package/cjs/oidc/TransactionManager.js.map +1 -1
- package/cjs/oidc/decodeToken.js +1 -5
- package/cjs/oidc/decodeToken.js.map +1 -1
- package/cjs/oidc/endpoints/authorize.js +9 -13
- package/cjs/oidc/endpoints/authorize.js.map +1 -1
- package/cjs/oidc/endpoints/index.js +0 -5
- package/cjs/oidc/endpoints/index.js.map +1 -1
- package/cjs/oidc/endpoints/token.js +5 -17
- package/cjs/oidc/endpoints/token.js.map +1 -1
- package/cjs/oidc/endpoints/well-known.js +7 -14
- package/cjs/oidc/endpoints/well-known.js.map +1 -1
- package/cjs/oidc/exchangeCodeForTokens.js +7 -12
- package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
- package/cjs/oidc/factory/OktaAuthOAuth.js +0 -6
- package/cjs/oidc/factory/OktaAuthOAuth.js.map +1 -1
- package/cjs/oidc/factory/api.js +6 -20
- package/cjs/oidc/factory/api.js.map +1 -1
- package/cjs/oidc/factory/index.js +0 -3
- package/cjs/oidc/factory/index.js.map +1 -1
- package/cjs/oidc/getToken.js +18 -30
- package/cjs/oidc/getToken.js.map +1 -1
- package/cjs/oidc/getUserInfo.js +1 -15
- package/cjs/oidc/getUserInfo.js.map +1 -1
- package/cjs/oidc/getWithPopup.js +4 -8
- package/cjs/oidc/getWithPopup.js.map +1 -1
- package/cjs/oidc/getWithRedirect.js +1 -8
- package/cjs/oidc/getWithRedirect.js.map +1 -1
- package/cjs/oidc/getWithoutPrompt.js +1 -5
- package/cjs/oidc/getWithoutPrompt.js.map +1 -1
- package/cjs/oidc/handleOAuthResponse.js +23 -40
- package/cjs/oidc/handleOAuthResponse.js.map +1 -1
- package/cjs/oidc/index.js +0 -32
- package/cjs/oidc/index.js.map +1 -1
- package/cjs/oidc/mixin/browser.js +6 -18
- package/cjs/oidc/mixin/browser.js.map +1 -1
- package/cjs/oidc/mixin/index.js +37 -89
- package/cjs/oidc/mixin/index.js.map +1 -1
- package/cjs/oidc/mixin/node.js +2 -9
- package/cjs/oidc/mixin/node.js.map +1 -1
- package/cjs/oidc/options/OAuthOptionsConstructor.js +17 -24
- package/cjs/oidc/options/OAuthOptionsConstructor.js.map +1 -1
- package/cjs/oidc/options/browser.js.map +1 -1
- package/cjs/oidc/options/index.js +0 -1
- package/cjs/oidc/options/index.js.map +1 -1
- package/cjs/oidc/options/node.js.map +1 -1
- package/cjs/oidc/parseFromUrl.js +1 -32
- package/cjs/oidc/parseFromUrl.js.map +1 -1
- package/cjs/oidc/renewToken.js +5 -16
- package/cjs/oidc/renewToken.js.map +1 -1
- package/cjs/oidc/renewTokens.js +3 -15
- package/cjs/oidc/renewTokens.js.map +1 -1
- package/cjs/oidc/renewTokensWithRefresh.js +3 -13
- package/cjs/oidc/renewTokensWithRefresh.js.map +1 -1
- package/cjs/oidc/revokeToken.js +3 -14
- package/cjs/oidc/revokeToken.js.map +1 -1
- package/cjs/oidc/storage.js +0 -8
- package/cjs/oidc/storage.js.map +1 -1
- package/cjs/oidc/types/Token.js +1 -5
- package/cjs/oidc/types/Token.js.map +1 -1
- package/cjs/oidc/types/TokenManager.js +1 -1
- package/cjs/oidc/types/TokenManager.js.map +1 -1
- package/cjs/oidc/types/Transaction.js +1 -12
- package/cjs/oidc/types/Transaction.js.map +1 -1
- package/cjs/oidc/types/UserClaims.js.map +1 -1
- package/cjs/oidc/types/api.js.map +1 -1
- package/cjs/oidc/types/index.js +0 -21
- package/cjs/oidc/types/index.js.map +1 -1
- package/cjs/oidc/types/meta.js.map +1 -1
- package/cjs/oidc/types/options.js.map +1 -1
- package/cjs/oidc/types/proto.js.map +1 -1
- package/cjs/oidc/util/browser.js +4 -13
- package/cjs/oidc/util/browser.js.map +1 -1
- package/cjs/oidc/util/defaultTokenParams.js +5 -5
- package/cjs/oidc/util/defaultTokenParams.js.map +1 -1
- package/cjs/oidc/util/errors.js +3 -8
- package/cjs/oidc/util/errors.js.map +1 -1
- package/cjs/oidc/util/index.js +0 -24
- package/cjs/oidc/util/index.js.map +1 -1
- package/cjs/oidc/util/loginRedirect.js +11 -25
- package/cjs/oidc/util/loginRedirect.js.map +1 -1
- package/cjs/oidc/util/oauth.js +3 -12
- package/cjs/oidc/util/oauth.js.map +1 -1
- package/cjs/oidc/util/oauthMeta.js +5 -6
- package/cjs/oidc/util/oauthMeta.js.map +1 -1
- package/cjs/oidc/util/pkce.js +1 -12
- package/cjs/oidc/util/pkce.js.map +1 -1
- package/cjs/oidc/util/prepareTokenParams.js +13 -26
- package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
- package/cjs/oidc/util/refreshToken.js +0 -7
- package/cjs/oidc/util/refreshToken.js.map +1 -1
- package/cjs/oidc/util/sharedStorage.js +0 -8
- package/cjs/oidc/util/sharedStorage.js.map +1 -1
- package/cjs/oidc/util/urlParams.js +9 -12
- package/cjs/oidc/util/urlParams.js.map +1 -1
- package/cjs/oidc/util/validateClaims.js +9 -17
- package/cjs/oidc/util/validateClaims.js.map +1 -1
- package/cjs/oidc/util/validateToken.js +1 -6
- package/cjs/oidc/util/validateToken.js.map +1 -1
- package/cjs/oidc/verifyToken.js +13 -23
- package/cjs/oidc/verifyToken.js.map +1 -1
- package/cjs/server/serverStorage.js +9 -27
- package/cjs/server/serverStorage.js.map +1 -1
- package/cjs/services/AutoRenewService.js +1 -17
- package/cjs/services/AutoRenewService.js.map +1 -1
- package/cjs/services/LeaderElectionService.js +1 -23
- package/cjs/services/LeaderElectionService.js.map +1 -1
- package/cjs/services/SyncStorageService.js +3 -37
- package/cjs/services/SyncStorageService.js.map +1 -1
- package/cjs/services/index.js +0 -5
- package/cjs/services/index.js.map +1 -1
- package/cjs/session/api.js +1 -12
- package/cjs/session/api.js.map +1 -1
- package/cjs/session/factory.js +0 -2
- package/cjs/session/factory.js.map +1 -1
- package/cjs/session/index.js +0 -7
- package/cjs/session/index.js.map +1 -1
- package/cjs/session/mixin.js +2 -6
- package/cjs/session/mixin.js.map +1 -1
- package/cjs/storage/BaseStorageManager.js +13 -25
- package/cjs/storage/BaseStorageManager.js.map +1 -1
- package/cjs/storage/SavedObject.js +7 -19
- package/cjs/storage/SavedObject.js.map +1 -1
- package/cjs/storage/index.js +0 -9
- package/cjs/storage/index.js.map +1 -1
- package/cjs/storage/mixin.js +2 -4
- package/cjs/storage/mixin.js.map +1 -1
- package/cjs/storage/options/StorageOptionsConstructor.js +3 -6
- package/cjs/storage/options/StorageOptionsConstructor.js.map +1 -1
- package/cjs/storage/options/browser.js +7 -15
- package/cjs/storage/options/browser.js.map +1 -1
- package/cjs/storage/options/node.js +3 -6
- package/cjs/storage/options/node.js.map +1 -1
- package/cjs/util/PromiseQueue.js +7 -15
- package/cjs/util/PromiseQueue.js.map +1 -1
- package/cjs/util/console.js +3 -7
- package/cjs/util/console.js.map +1 -1
- package/cjs/util/index.js +0 -11
- package/cjs/util/index.js.map +1 -1
- package/cjs/util/misc.js +3 -8
- package/cjs/util/misc.js.map +1 -1
- package/cjs/util/object.js +9 -23
- package/cjs/util/object.js.map +1 -1
- package/cjs/util/types.js +1 -5
- package/cjs/util/types.js.map +1 -1
- package/cjs/util/url.js +5 -14
- package/cjs/util/url.js.map +1 -1
- package/dist/okta-auth-js.authn.min.analyzer.html +3 -3
- package/dist/okta-auth-js.authn.min.js +1 -1
- package/dist/okta-auth-js.authn.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.authn.min.js.map +1 -1
- package/dist/okta-auth-js.core.min.analyzer.html +3 -3
- package/dist/okta-auth-js.core.min.js +1 -1
- package/dist/okta-auth-js.core.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.core.min.js.map +1 -1
- package/dist/okta-auth-js.idx.min.analyzer.html +3 -3
- package/dist/okta-auth-js.idx.min.js +1 -1
- package/dist/okta-auth-js.idx.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.idx.min.js.map +1 -1
- package/dist/okta-auth-js.min.analyzer.html +3 -3
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.myaccount.min.analyzer.html +3 -3
- package/dist/okta-auth-js.myaccount.min.js +1 -1
- package/dist/okta-auth-js.myaccount.min.js.LICENSE.txt +2 -0
- package/dist/okta-auth-js.myaccount.min.js.map +1 -1
- package/dist/okta-auth-js.polyfill.js +1 -1
- package/dist/okta-auth-js.polyfill.js.map +1 -1
- package/esm/browser/http/OktaUserAgent.js +2 -2
- package/esm/browser/http/request.js +56 -23
- package/esm/browser/http/request.js.map +1 -1
- package/esm/browser/idx/interact.js +2 -2
- package/esm/browser/idx/interact.js.map +1 -1
- package/esm/browser/idx/run.js +3 -2
- package/esm/browser/idx/run.js.map +1 -1
- package/esm/browser/idx/transactionMeta.js +3 -2
- package/esm/browser/idx/transactionMeta.js.map +1 -1
- package/esm/browser/myaccount/request.js +2 -43
- package/esm/browser/myaccount/request.js.map +1 -1
- package/esm/browser/oidc/endpoints/authorize.js +1 -0
- package/esm/browser/oidc/endpoints/authorize.js.map +1 -1
- package/esm/browser/oidc/exchangeCodeForTokens.js +2 -1
- package/esm/browser/oidc/exchangeCodeForTokens.js.map +1 -1
- package/esm/browser/oidc/handleOAuthResponse.js +17 -16
- package/esm/browser/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/browser/oidc/options/OAuthOptionsConstructor.js +2 -0
- package/esm/browser/oidc/options/OAuthOptionsConstructor.js.map +1 -1
- package/esm/browser/oidc/util/defaultTokenParams.js +3 -1
- package/esm/browser/oidc/util/defaultTokenParams.js.map +1 -1
- package/esm/browser/oidc/util/oauthMeta.js +1 -0
- package/esm/browser/oidc/util/oauthMeta.js.map +1 -1
- package/esm/browser/oidc/util/validateClaims.js +9 -4
- package/esm/browser/oidc/util/validateClaims.js.map +1 -1
- package/esm/browser/oidc/verifyToken.js +2 -2
- package/esm/browser/oidc/verifyToken.js.map +1 -1
- package/esm/browser/package.json +1 -1
- package/esm/node/http/OktaUserAgent.js +2 -2
- package/esm/node/http/request.js +56 -23
- package/esm/node/http/request.js.map +1 -1
- package/esm/node/idx/interact.js +2 -2
- package/esm/node/idx/interact.js.map +1 -1
- package/esm/node/idx/run.js +3 -2
- package/esm/node/idx/run.js.map +1 -1
- package/esm/node/idx/transactionMeta.js +3 -2
- package/esm/node/idx/transactionMeta.js.map +1 -1
- package/esm/node/myaccount/request.js +2 -43
- package/esm/node/myaccount/request.js.map +1 -1
- package/esm/node/oidc/endpoints/authorize.js +1 -0
- package/esm/node/oidc/endpoints/authorize.js.map +1 -1
- package/esm/node/oidc/exchangeCodeForTokens.js +2 -1
- package/esm/node/oidc/exchangeCodeForTokens.js.map +1 -1
- package/esm/node/oidc/handleOAuthResponse.js +17 -16
- package/esm/node/oidc/handleOAuthResponse.js.map +1 -1
- package/esm/node/oidc/options/OAuthOptionsConstructor.js +2 -0
- package/esm/node/oidc/options/OAuthOptionsConstructor.js.map +1 -1
- package/esm/node/oidc/util/defaultTokenParams.js +3 -1
- package/esm/node/oidc/util/defaultTokenParams.js.map +1 -1
- package/esm/node/oidc/util/oauthMeta.js +1 -0
- package/esm/node/oidc/util/oauthMeta.js.map +1 -1
- package/esm/node/oidc/util/validateClaims.js +9 -4
- package/esm/node/oidc/util/validateClaims.js.map +1 -1
- package/esm/node/oidc/verifyToken.js +2 -2
- package/esm/node/oidc/verifyToken.js.map +1 -1
- package/esm/node/package.json +1 -1
- package/package.json +12 -13
- package/polyfill/index.js +8 -5
- package/types/lib/core/options.d.ts +2 -0
- package/types/lib/idx/interact.d.ts +1 -0
- package/types/lib/idx/options.d.ts +2 -0
- package/types/lib/idx/types/meta.d.ts +1 -0
- package/types/lib/idx/types/options.d.ts +1 -0
- package/types/lib/oidc/options/OAuthOptionsConstructor.d.ts +2 -0
- package/types/lib/oidc/types/UserClaims.d.ts +1 -0
- package/types/lib/oidc/types/api.d.ts +1 -0
- package/types/lib/oidc/types/meta.d.ts +1 -1
- package/types/lib/oidc/types/options.d.ts +2 -1
- package/types/lib/oidc/types/proto.d.ts +1 -0
- package/umd/authn.js +1 -1
- package/umd/authn.js.LICENSE.txt +2 -0
- package/umd/authn.js.map +1 -1
- package/umd/core.js +1 -1
- package/umd/core.js.LICENSE.txt +2 -0
- package/umd/core.js.map +1 -1
- package/umd/default.js +1 -1
- package/umd/default.js.LICENSE.txt +2 -0
- package/umd/default.js.map +1 -1
- package/umd/idx.js +1 -1
- package/umd/idx.js.LICENSE.txt +2 -0
- package/umd/idx.js.map +1 -1
- package/umd/myaccount.js +1 -1
- package/umd/myaccount.js.LICENSE.txt +2 -0
- package/umd/myaccount.js.map +1 -1
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.createStorageOptionsConstructor = createStorageOptionsConstructor;
|
|
4
|
-
|
|
5
4
|
var _base = require("../../base");
|
|
6
|
-
|
|
7
5
|
var _node = require("./node");
|
|
8
|
-
|
|
9
6
|
var _features = require("../../features");
|
|
10
|
-
|
|
11
7
|
/*!
|
|
12
8
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,6 +15,7 @@ var _features = require("../../features");
|
|
|
19
15
|
*
|
|
20
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
17
|
*/
|
|
18
|
+
|
|
22
19
|
function createStorageOptionsConstructor() {
|
|
23
20
|
const BaseOptionsConstructor = (0, _base.createBaseOptionsConstructor)();
|
|
24
21
|
return class StorageOptionsConstructor extends BaseOptionsConstructor {
|
|
@@ -26,11 +23,11 @@ function createStorageOptionsConstructor() {
|
|
|
26
23
|
super(args);
|
|
27
24
|
this.cookies = (0, _node.getCookieSettings)(args, (0, _features.isHTTPS)());
|
|
28
25
|
this.storageUtil = args.storageUtil || (0, _node.getStorage)();
|
|
29
|
-
this.storageManager = {
|
|
26
|
+
this.storageManager = {
|
|
27
|
+
..._node.STORAGE_MANAGER_OPTIONS,
|
|
30
28
|
...args.storageManager
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
|
-
|
|
34
31
|
};
|
|
35
32
|
}
|
|
36
33
|
//# sourceMappingURL=StorageOptionsConstructor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageOptionsConstructor.js","names":["createStorageOptionsConstructor","BaseOptionsConstructor","createBaseOptionsConstructor","StorageOptionsConstructor","constructor","args","cookies","getCookieSettings","isHTTPS","storageUtil","getStorage","storageManager","STORAGE_MANAGER_OPTIONS"],"sources":["../../../../lib/storage/options/StorageOptionsConstructor.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createBaseOptionsConstructor } from '../../base';\nimport { CookieOptions, OktaAuthStorageOptions, StorageManagerOptions, StorageUtil } from '../types';\nimport { getStorage, STORAGE_MANAGER_OPTIONS, getCookieSettings } from './node';\nimport { isHTTPS } from '../../features';\n\nexport function createStorageOptionsConstructor() {\n\n const BaseOptionsConstructor = createBaseOptionsConstructor();\n return class StorageOptionsConstructor extends BaseOptionsConstructor implements Required<OktaAuthStorageOptions> {\n cookies: CookieOptions;\n storageUtil: StorageUtil;\n storageManager: StorageManagerOptions;\n \n constructor(args: any) {\n super(args);\n this.cookies = getCookieSettings(args, isHTTPS())!;\n this.storageUtil = args.storageUtil || getStorage();\n this.storageManager = { ...STORAGE_MANAGER_OPTIONS, ...args.storageManager };\n }\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StorageOptionsConstructor.js","names":["createStorageOptionsConstructor","BaseOptionsConstructor","createBaseOptionsConstructor","StorageOptionsConstructor","constructor","args","cookies","getCookieSettings","isHTTPS","storageUtil","getStorage","storageManager","STORAGE_MANAGER_OPTIONS"],"sources":["../../../../lib/storage/options/StorageOptionsConstructor.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createBaseOptionsConstructor } from '../../base';\nimport { CookieOptions, OktaAuthStorageOptions, StorageManagerOptions, StorageUtil } from '../types';\nimport { getStorage, STORAGE_MANAGER_OPTIONS, getCookieSettings } from './node';\nimport { isHTTPS } from '../../features';\n\nexport function createStorageOptionsConstructor() {\n\n const BaseOptionsConstructor = createBaseOptionsConstructor();\n return class StorageOptionsConstructor extends BaseOptionsConstructor implements Required<OktaAuthStorageOptions> {\n cookies: CookieOptions;\n storageUtil: StorageUtil;\n storageManager: StorageManagerOptions;\n \n constructor(args: any) {\n super(args);\n this.cookies = getCookieSettings(args, isHTTPS())!;\n this.storageUtil = args.storageUtil || getStorage();\n this.storageManager = { ...STORAGE_MANAGER_OPTIONS, ...args.storageManager };\n }\n };\n}\n"],"mappings":";;;AAYA;AAEA;AACA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,SAASA,+BAA+B,GAAG;EAEhD,MAAMC,sBAAsB,GAAG,IAAAC,kCAA4B,GAAE;EAC7D,OAAO,MAAMC,yBAAyB,SAASF,sBAAsB,CAA6C;IAKhHG,WAAW,CAACC,IAAS,EAAE;MACrB,KAAK,CAACA,IAAI,CAAC;MACX,IAAI,CAACC,OAAO,GAAG,IAAAC,uBAAiB,EAACF,IAAI,EAAE,IAAAG,iBAAO,GAAE,CAAE;MAClD,IAAI,CAACC,WAAW,GAAGJ,IAAI,CAACI,WAAW,IAAI,IAAAC,gBAAU,GAAE;MACnD,IAAI,CAACC,cAAc,GAAG;QAAE,GAAGC,6BAAuB;QAAE,GAAGP,IAAI,CAACM;MAAe,CAAC;IAC9E;EACF,CAAC;AACH"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.STORAGE_MANAGER_OPTIONS = void 0;
|
|
6
5
|
exports.getCookieSettings = getCookieSettings;
|
|
7
6
|
exports.getStorage = getStorage;
|
|
8
|
-
|
|
9
7
|
var _util = require("../../util");
|
|
10
|
-
|
|
11
8
|
var _browserStorage = _interopRequireDefault(require("../../browser/browserStorage"));
|
|
12
|
-
|
|
13
9
|
/*!
|
|
14
10
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
15
11
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -23,14 +19,14 @@ var _browserStorage = _interopRequireDefault(require("../../browser/browserStora
|
|
|
23
19
|
*/
|
|
24
20
|
|
|
25
21
|
/* eslint-disable complexity */
|
|
22
|
+
|
|
26
23
|
function getStorage() {
|
|
27
24
|
const storageUtil = Object.assign({}, _browserStorage.default, {
|
|
28
25
|
inMemoryStore: {} // create unique storage for this instance
|
|
29
|
-
|
|
30
26
|
});
|
|
27
|
+
|
|
31
28
|
return storageUtil;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
const STORAGE_MANAGER_OPTIONS = {
|
|
35
31
|
token: {
|
|
36
32
|
storageTypes: ['localStorage', 'sessionStorage', 'cookie']
|
|
@@ -49,34 +45,30 @@ const STORAGE_MANAGER_OPTIONS = {
|
|
|
49
45
|
}
|
|
50
46
|
};
|
|
51
47
|
exports.STORAGE_MANAGER_OPTIONS = STORAGE_MANAGER_OPTIONS;
|
|
52
|
-
|
|
53
48
|
function getCookieSettings(args = {}, isHTTPS) {
|
|
54
49
|
// Secure cookies will be automatically used on a HTTPS connection
|
|
55
50
|
// Non-secure cookies will be automatically used on a HTTP connection
|
|
56
51
|
// secure option can override the automatic behavior
|
|
57
52
|
var cookieSettings = args.cookies || {};
|
|
58
|
-
|
|
59
53
|
if (typeof cookieSettings.secure === 'undefined') {
|
|
60
54
|
cookieSettings.secure = isHTTPS;
|
|
61
55
|
}
|
|
62
|
-
|
|
63
56
|
if (typeof cookieSettings.sameSite === 'undefined') {
|
|
64
57
|
cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';
|
|
65
|
-
}
|
|
66
|
-
|
|
58
|
+
}
|
|
67
59
|
|
|
60
|
+
// If secure=true, but the connection is not HTTPS, set secure=false.
|
|
68
61
|
if (cookieSettings.secure && !isHTTPS) {
|
|
69
62
|
// eslint-disable-next-line no-console
|
|
70
63
|
(0, _util.warn)('The current page is not being served with the HTTPS protocol.\n' + 'For security reasons, we strongly recommend using HTTPS.\n' + 'If you cannot use HTTPS, set "cookies.secure" option to false.');
|
|
71
64
|
cookieSettings.secure = false;
|
|
72
|
-
}
|
|
73
|
-
// If sameSite=none, but the connection is not HTTPS, set sameSite=lax.
|
|
74
|
-
|
|
65
|
+
}
|
|
75
66
|
|
|
67
|
+
// Chrome >= 80 will block cookies with SameSite=None unless they are also Secure
|
|
68
|
+
// If sameSite=none, but the connection is not HTTPS, set sameSite=lax.
|
|
76
69
|
if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {
|
|
77
70
|
cookieSettings.sameSite = 'lax';
|
|
78
71
|
}
|
|
79
|
-
|
|
80
72
|
return cookieSettings;
|
|
81
73
|
}
|
|
82
74
|
//# sourceMappingURL=browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","names":["getStorage","storageUtil","Object","assign","browserStorage","inMemoryStore","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookieSettings","cookies","secure","sameSite","warn"],"sources":["../../../../lib/storage/options/browser.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/* eslint-disable complexity */\nimport { StorageManagerOptions, StorageUtil, OktaAuthStorageOptions } from '../types';\nimport { warn } from '../../util';\n\nimport { default as browserStorage } from '../../browser/browserStorage';\n\nexport function getStorage(): StorageUtil {\n const storageUtil = Object.assign({}, browserStorage, {\n inMemoryStore: {} // create unique storage for this instance\n });\n return storageUtil;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n cache: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n transaction: {\n storageTypes: [\n 'sessionStorage',\n 'localStorage',\n 'cookie'\n ]\n },\n 'shared-transaction': {\n storageTypes: [\n 'localStorage'\n ]\n },\n 'original-uri': {\n storageTypes: [\n 'localStorage'\n ]\n }\n};\n\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS: boolean) {\n // Secure cookies will be automatically used on a HTTPS connection\n // Non-secure cookies will be automatically used on a HTTP connection\n // secure option can override the automatic behavior\n var cookieSettings = args.cookies || {};\n if (typeof cookieSettings.secure === 'undefined') {\n cookieSettings.secure = isHTTPS;\n }\n if (typeof cookieSettings.sameSite === 'undefined') {\n cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';\n }\n\n // If secure=true, but the connection is not HTTPS, set secure=false.\n if (cookieSettings.secure && !isHTTPS) {\n // eslint-disable-next-line no-console\n warn(\n 'The current page is not being served with the HTTPS protocol.\\n' +\n 'For security reasons, we strongly recommend using HTTPS.\\n' +\n 'If you cannot use HTTPS, set \"cookies.secure\" option to false.'\n );\n cookieSettings.secure = false;\n }\n\n // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure\n // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.\n if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {\n cookieSettings.sameSite = 'lax';\n }\n\n return cookieSettings;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.js","names":["getStorage","storageUtil","Object","assign","browserStorage","inMemoryStore","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookieSettings","cookies","secure","sameSite","warn"],"sources":["../../../../lib/storage/options/browser.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/* eslint-disable complexity */\nimport { StorageManagerOptions, StorageUtil, OktaAuthStorageOptions } from '../types';\nimport { warn } from '../../util';\n\nimport { default as browserStorage } from '../../browser/browserStorage';\n\nexport function getStorage(): StorageUtil {\n const storageUtil = Object.assign({}, browserStorage, {\n inMemoryStore: {} // create unique storage for this instance\n });\n return storageUtil;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n cache: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n transaction: {\n storageTypes: [\n 'sessionStorage',\n 'localStorage',\n 'cookie'\n ]\n },\n 'shared-transaction': {\n storageTypes: [\n 'localStorage'\n ]\n },\n 'original-uri': {\n storageTypes: [\n 'localStorage'\n ]\n }\n};\n\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS: boolean) {\n // Secure cookies will be automatically used on a HTTPS connection\n // Non-secure cookies will be automatically used on a HTTP connection\n // secure option can override the automatic behavior\n var cookieSettings = args.cookies || {};\n if (typeof cookieSettings.secure === 'undefined') {\n cookieSettings.secure = isHTTPS;\n }\n if (typeof cookieSettings.sameSite === 'undefined') {\n cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';\n }\n\n // If secure=true, but the connection is not HTTPS, set secure=false.\n if (cookieSettings.secure && !isHTTPS) {\n // eslint-disable-next-line no-console\n warn(\n 'The current page is not being served with the HTTPS protocol.\\n' +\n 'For security reasons, we strongly recommend using HTTPS.\\n' +\n 'If you cannot use HTTPS, set \"cookies.secure\" option to false.'\n );\n cookieSettings.secure = false;\n }\n\n // Chrome >= 80 will block cookies with SameSite=None unless they are also Secure\n // If sameSite=none, but the connection is not HTTPS, set sameSite=lax.\n if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {\n cookieSettings.sameSite = 'lax';\n }\n\n return cookieSettings;\n}\n"],"mappings":";;;;;;AAcA;AAEA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAMO,SAASA,UAAU,GAAgB;EACxC,MAAMC,WAAW,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEC,uBAAc,EAAE;IACpDC,aAAa,EAAE,CAAC,CAAC,CAAC;EACpB,CAAC,CAAC;;EACF,OAAOJ,WAAW;AACpB;AAEO,MAAMK,uBAA8C,GAAG;EAC5DC,KAAK,EAAE;IACLC,YAAY,EAAE,CACZ,cAAc,EACd,gBAAgB,EAChB,QAAQ;EAEZ,CAAC;EACDC,KAAK,EAAE;IACLD,YAAY,EAAE,CACZ,cAAc,EACd,gBAAgB,EAChB,QAAQ;EAEZ,CAAC;EACDE,WAAW,EAAE;IACXF,YAAY,EAAE,CACZ,gBAAgB,EAChB,cAAc,EACd,QAAQ;EAEZ,CAAC;EACD,oBAAoB,EAAE;IACpBA,YAAY,EAAE,CACZ,cAAc;EAElB,CAAC;EACD,cAAc,EAAE;IACdA,YAAY,EAAE,CACZ,cAAc;EAElB;AACF,CAAC;AAAC;AAEK,SAASG,iBAAiB,CAACC,IAA4B,GAAG,CAAC,CAAC,EAAEC,OAAgB,EAAE;EACrF;EACA;EACA;EACA,IAAIC,cAAc,GAAGF,IAAI,CAACG,OAAO,IAAI,CAAC,CAAC;EACvC,IAAI,OAAOD,cAAc,CAACE,MAAM,KAAK,WAAW,EAAE;IAChDF,cAAc,CAACE,MAAM,GAAGH,OAAO;EACjC;EACA,IAAI,OAAOC,cAAc,CAACG,QAAQ,KAAK,WAAW,EAAE;IAClDH,cAAc,CAACG,QAAQ,GAAGH,cAAc,CAACE,MAAM,GAAG,MAAM,GAAG,KAAK;EAClE;;EAEA;EACA,IAAIF,cAAc,CAACE,MAAM,IAAI,CAACH,OAAO,EAAE;IACrC;IACA,IAAAK,UAAI,EACF,iEAAiE,GACjE,4DAA4D,GAC5D,gEAAgE,CACjE;IACDJ,cAAc,CAACE,MAAM,GAAG,KAAK;EAC/B;;EAEA;EACA;EACA,IAAIF,cAAc,CAACG,QAAQ,KAAK,MAAM,IAAI,CAACH,cAAc,CAACE,MAAM,EAAE;IAChEF,cAAc,CAACG,QAAQ,GAAG,KAAK;EACjC;EAEA,OAAOH,cAAc;AACvB"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
exports.STORAGE_MANAGER_OPTIONS = void 0;
|
|
6
5
|
exports.getCookieSettings = getCookieSettings;
|
|
7
6
|
exports.getStorage = getStorage;
|
|
8
|
-
|
|
9
7
|
var _serverStorage = _interopRequireDefault(require("../../server/serverStorage"));
|
|
10
|
-
|
|
11
8
|
/*!
|
|
12
9
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
10
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,10 +16,10 @@ var _serverStorage = _interopRequireDefault(require("../../server/serverStorage"
|
|
|
19
16
|
*
|
|
20
17
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
18
|
*/
|
|
19
|
+
|
|
22
20
|
function getStorage() {
|
|
23
21
|
return _serverStorage.default;
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
const STORAGE_MANAGER_OPTIONS = {
|
|
27
24
|
token: {
|
|
28
25
|
storageTypes: ['memory']
|
|
@@ -33,10 +30,10 @@ const STORAGE_MANAGER_OPTIONS = {
|
|
|
33
30
|
transaction: {
|
|
34
31
|
storageTypes: ['memory']
|
|
35
32
|
}
|
|
36
|
-
};
|
|
33
|
+
};
|
|
37
34
|
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
38
36
|
exports.STORAGE_MANAGER_OPTIONS = STORAGE_MANAGER_OPTIONS;
|
|
39
|
-
|
|
40
37
|
function getCookieSettings(args = {}, isHTTPS) {
|
|
41
38
|
return args.cookies;
|
|
42
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","names":["getStorage","storage","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookies"],"sources":["../../../../lib/storage/options/node.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { StorageManagerOptions, OktaAuthStorageOptions, StorageUtil } from '../types';\n\nimport { default as storage } from '../../server/serverStorage';\n\nexport function getStorage(): StorageUtil {\n return storage;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'memory'\n ]\n },\n cache: {\n storageTypes: [\n 'memory'\n ]\n },\n transaction: {\n storageTypes: [\n 'memory'\n ]\n }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS?: boolean) {\n return args.cookies;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.js","names":["getStorage","storage","STORAGE_MANAGER_OPTIONS","token","storageTypes","cache","transaction","getCookieSettings","args","isHTTPS","cookies"],"sources":["../../../../lib/storage/options/node.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { StorageManagerOptions, OktaAuthStorageOptions, StorageUtil } from '../types';\n\nimport { default as storage } from '../../server/serverStorage';\n\nexport function getStorage(): StorageUtil {\n return storage;\n}\n\nexport const STORAGE_MANAGER_OPTIONS: StorageManagerOptions = {\n token: {\n storageTypes: [\n 'memory'\n ]\n },\n cache: {\n storageTypes: [\n 'memory'\n ]\n },\n transaction: {\n storageTypes: [\n 'memory'\n ]\n }\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function getCookieSettings(args: OktaAuthStorageOptions = {}, isHTTPS?: boolean) {\n return args.cookies;\n}\n"],"mappings":";;;;;;AAcA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,SAASA,UAAU,GAAgB;EACxC,OAAOC,sBAAO;AAChB;AAEO,MAAMC,uBAA8C,GAAG;EAC5DC,KAAK,EAAE;IACLC,YAAY,EAAE,CACZ,QAAQ;EAEZ,CAAC;EACDC,KAAK,EAAE;IACLD,YAAY,EAAE,CACZ,QAAQ;EAEZ,CAAC;EACDE,WAAW,EAAE;IACXF,YAAY,EAAE,CACZ,QAAQ;EAEZ;AACF,CAAC;;AAED;AAAA;AACO,SAASG,iBAAiB,CAACC,IAA4B,GAAG,CAAC,CAAC,EAAEC,OAAiB,EAAE;EACtF,OAAOD,IAAI,CAACE,OAAO;AACrB"}
|
package/cjs/util/PromiseQueue.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.PromiseQueue = void 0;
|
|
4
|
-
|
|
5
4
|
var _types = require("./types");
|
|
6
|
-
|
|
7
5
|
var _console = require("./console");
|
|
8
|
-
|
|
9
6
|
/*!
|
|
10
7
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
11
8
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -17,9 +14,11 @@ var _console = require("./console");
|
|
|
17
14
|
*
|
|
18
15
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
19
16
|
*/
|
|
17
|
+
|
|
20
18
|
// Implements a queue for synchronous or asynchronous methods
|
|
21
19
|
// Methods will be wrapped in a promise and execute sequentially
|
|
22
20
|
// This can be used to prevent concurrent calls to a single method or a set of methods
|
|
21
|
+
|
|
23
22
|
class PromiseQueue {
|
|
24
23
|
constructor(options = {
|
|
25
24
|
quiet: false
|
|
@@ -27,11 +26,11 @@ class PromiseQueue {
|
|
|
27
26
|
this.queue = [];
|
|
28
27
|
this.running = false;
|
|
29
28
|
this.options = options;
|
|
30
|
-
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Returns a promise
|
|
31
32
|
// If the method is synchronous, it will resolve when the method completes
|
|
32
33
|
// If the method returns a promise, it will resolve (or reject) with the value from the method's promise
|
|
33
|
-
|
|
34
|
-
|
|
35
34
|
push(method, thisObject, ...args) {
|
|
36
35
|
return new Promise((resolve, reject) => {
|
|
37
36
|
if (this.queue.length > 0) {
|
|
@@ -41,7 +40,6 @@ class PromiseQueue {
|
|
|
41
40
|
(0, _console.warn)('Async method is being called but another async method is already running. ' + 'The new method will be delayed until the previous method completes.');
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
|
|
45
43
|
this.queue.push({
|
|
46
44
|
method,
|
|
47
45
|
thisObject,
|
|
@@ -52,21 +50,17 @@ class PromiseQueue {
|
|
|
52
50
|
this.run();
|
|
53
51
|
});
|
|
54
52
|
}
|
|
55
|
-
|
|
56
53
|
run() {
|
|
57
54
|
if (this.running) {
|
|
58
55
|
return;
|
|
59
56
|
}
|
|
60
|
-
|
|
61
57
|
if (this.queue.length === 0) {
|
|
62
58
|
return;
|
|
63
59
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
this.running = true;
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
67
62
|
var queueItem = this.queue.shift();
|
|
68
63
|
var res = queueItem.method.apply(queueItem.thisObject, queueItem.args);
|
|
69
|
-
|
|
70
64
|
if ((0, _types.isPromise)(res)) {
|
|
71
65
|
res.then(queueItem.resolve, queueItem.reject).finally(() => {
|
|
72
66
|
this.running = false;
|
|
@@ -78,8 +72,6 @@ class PromiseQueue {
|
|
|
78
72
|
this.run();
|
|
79
73
|
}
|
|
80
74
|
}
|
|
81
|
-
|
|
82
75
|
}
|
|
83
|
-
|
|
84
76
|
exports.PromiseQueue = PromiseQueue;
|
|
85
77
|
//# sourceMappingURL=PromiseQueue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromiseQueue.js","names":["PromiseQueue","constructor","options","quiet","queue","running","push","method","thisObject","args","Promise","resolve","reject","length","warn","run","queueItem","shift","res","apply","isPromise","then","finally"],"sources":["../../../lib/util/PromiseQueue.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n// Implements a queue for synchronous or asynchronous methods\n// Methods will be wrapped in a promise and execute sequentially\n// This can be used to prevent concurrent calls to a single method or a set of methods\n\nimport { isPromise } from './types';\nimport { warn } from './console';\n\ninterface QueueItem {\n method: () => void;\n thisObject: object;\n args: any[];\n resolve: (value?: unknown) => void;\n reject: (reason?: unknown) => void;\n}\n\ninterface PromiseQueueOptions {\n quiet?: boolean; // if false, concurrrency warnings will not be logged\n}\nexport class PromiseQueue {\n queue: QueueItem[];\n running: boolean;\n options: PromiseQueueOptions;\n\n constructor(options: PromiseQueueOptions = { quiet: false }) {\n this.queue = [];\n this.running = false;\n this.options = options;\n }\n\n // Returns a promise\n // If the method is synchronous, it will resolve when the method completes\n // If the method returns a promise, it will resolve (or reject) with the value from the method's promise\n push(method: (...args: any) => any, thisObject: any, ...args: any[]) {\n return new Promise((resolve, reject) => {\n if (this.queue.length > 0) {\n // There is at least one other pending call.\n // The PromiseQueue will prevent these methods from running concurrently.\n if (this.options.quiet !== false) {\n warn(\n 'Async method is being called but another async method is already running. ' +\n 'The new method will be delayed until the previous method completes.'\n );\n }\n }\n this.queue.push({\n method,\n thisObject,\n args,\n resolve,\n reject\n });\n this.run();\n });\n }\n\n run() {\n if (this.running) {\n return;\n }\n if (this.queue.length === 0) {\n return;\n }\n this.running = true;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var queueItem = this.queue.shift()!;\n var res = queueItem.method.apply(queueItem.thisObject, queueItem.args as never) as unknown;\n if (isPromise(res)) {\n (res as Promise<unknown>).then(queueItem.resolve, queueItem.reject).finally(() => {\n this.running = false;\n this.run();\n });\n } else {\n queueItem.resolve(res);\n this.running = false;\n this.run();\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PromiseQueue.js","names":["PromiseQueue","constructor","options","quiet","queue","running","push","method","thisObject","args","Promise","resolve","reject","length","warn","run","queueItem","shift","res","apply","isPromise","then","finally"],"sources":["../../../lib/util/PromiseQueue.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n// Implements a queue for synchronous or asynchronous methods\n// Methods will be wrapped in a promise and execute sequentially\n// This can be used to prevent concurrent calls to a single method or a set of methods\n\nimport { isPromise } from './types';\nimport { warn } from './console';\n\ninterface QueueItem {\n method: () => void;\n thisObject: object;\n args: any[];\n resolve: (value?: unknown) => void;\n reject: (reason?: unknown) => void;\n}\n\ninterface PromiseQueueOptions {\n quiet?: boolean; // if false, concurrrency warnings will not be logged\n}\nexport class PromiseQueue {\n queue: QueueItem[];\n running: boolean;\n options: PromiseQueueOptions;\n\n constructor(options: PromiseQueueOptions = { quiet: false }) {\n this.queue = [];\n this.running = false;\n this.options = options;\n }\n\n // Returns a promise\n // If the method is synchronous, it will resolve when the method completes\n // If the method returns a promise, it will resolve (or reject) with the value from the method's promise\n push(method: (...args: any) => any, thisObject: any, ...args: any[]) {\n return new Promise((resolve, reject) => {\n if (this.queue.length > 0) {\n // There is at least one other pending call.\n // The PromiseQueue will prevent these methods from running concurrently.\n if (this.options.quiet !== false) {\n warn(\n 'Async method is being called but another async method is already running. ' +\n 'The new method will be delayed until the previous method completes.'\n );\n }\n }\n this.queue.push({\n method,\n thisObject,\n args,\n resolve,\n reject\n });\n this.run();\n });\n }\n\n run() {\n if (this.running) {\n return;\n }\n if (this.queue.length === 0) {\n return;\n }\n this.running = true;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var queueItem = this.queue.shift()!;\n var res = queueItem.method.apply(queueItem.thisObject, queueItem.args as never) as unknown;\n if (isPromise(res)) {\n (res as Promise<unknown>).then(queueItem.resolve, queueItem.reject).finally(() => {\n this.running = false;\n this.run();\n });\n } else {\n queueItem.resolve(res);\n this.running = false;\n this.run();\n }\n }\n}\n"],"mappings":";;;AAgBA;AACA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAgBO,MAAMA,YAAY,CAAC;EAKxBC,WAAW,CAACC,OAA4B,GAAG;IAAEC,KAAK,EAAE;EAAM,CAAC,EAAE;IAC3D,IAAI,CAACC,KAAK,GAAG,EAAE;IACf,IAAI,CAACC,OAAO,GAAG,KAAK;IACpB,IAAI,CAACH,OAAO,GAAGA,OAAO;EACxB;;EAEA;EACA;EACA;EACAI,IAAI,CAACC,MAA6B,EAAEC,UAAe,EAAE,GAAGC,IAAW,EAAE;IACnE,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MACtC,IAAI,IAAI,CAACR,KAAK,CAACS,MAAM,GAAG,CAAC,EAAE;QACzB;QACA;QACA,IAAI,IAAI,CAACX,OAAO,CAACC,KAAK,KAAK,KAAK,EAAE;UAChC,IAAAW,aAAI,EACF,4EAA4E,GAC5E,qEAAqE,CACtE;QACH;MACF;MACA,IAAI,CAACV,KAAK,CAACE,IAAI,CAAC;QACdC,MAAM;QACNC,UAAU;QACVC,IAAI;QACJE,OAAO;QACPC;MACF,CAAC,CAAC;MACF,IAAI,CAACG,GAAG,EAAE;IACZ,CAAC,CAAC;EACJ;EAEAA,GAAG,GAAG;IACJ,IAAI,IAAI,CAACV,OAAO,EAAE;MAChB;IACF;IACA,IAAI,IAAI,CAACD,KAAK,CAACS,MAAM,KAAK,CAAC,EAAE;MAC3B;IACF;IACA,IAAI,CAACR,OAAO,GAAG,IAAI;IACnB;IACA,IAAIW,SAAS,GAAG,IAAI,CAACZ,KAAK,CAACa,KAAK,EAAG;IACnC,IAAIC,GAAG,GAAGF,SAAS,CAACT,MAAM,CAACY,KAAK,CAACH,SAAS,CAACR,UAAU,EAAEQ,SAAS,CAACP,IAAI,CAAqB;IAC1F,IAAI,IAAAW,gBAAS,EAACF,GAAG,CAAC,EAAE;MACjBA,GAAG,CAAsBG,IAAI,CAACL,SAAS,CAACL,OAAO,EAAEK,SAAS,CAACJ,MAAM,CAAC,CAACU,OAAO,CAAC,MAAM;QAChF,IAAI,CAACjB,OAAO,GAAG,KAAK;QACpB,IAAI,CAACU,GAAG,EAAE;MACZ,CAAC,CAAC;IACJ,CAAC,MAAM;MACLC,SAAS,CAACL,OAAO,CAACO,GAAG,CAAC;MACtB,IAAI,CAACb,OAAO,GAAG,KAAK;MACpB,IAAI,CAACU,GAAG,EAAE;IACZ;EACF;AACF;AAAC"}
|
package/cjs/util/console.js
CHANGED
|
@@ -5,7 +5,6 @@ exports.deprecateWrap = deprecateWrap;
|
|
|
5
5
|
exports.getConsole = getConsole;
|
|
6
6
|
exports.getNativeConsole = getNativeConsole;
|
|
7
7
|
exports.warn = warn;
|
|
8
|
-
|
|
9
8
|
/*!
|
|
10
9
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
11
10
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -17,8 +16,8 @@ exports.warn = warn;
|
|
|
17
16
|
*
|
|
18
17
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
19
|
/* global window */
|
|
20
|
+
|
|
22
21
|
function getNativeConsole() {
|
|
23
22
|
if (typeof window !== 'undefined') {
|
|
24
23
|
return window.console;
|
|
@@ -28,15 +27,13 @@ function getNativeConsole() {
|
|
|
28
27
|
return undefined;
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
function getConsole() {
|
|
33
|
-
var nativeConsole = getNativeConsole();
|
|
31
|
+
var nativeConsole = getNativeConsole();
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
34
33
|
// @ts-ignore
|
|
35
|
-
|
|
36
34
|
if (nativeConsole && nativeConsole.log) {
|
|
37
35
|
return nativeConsole;
|
|
38
36
|
}
|
|
39
|
-
|
|
40
37
|
return {
|
|
41
38
|
log: function () {},
|
|
42
39
|
warn: function () {},
|
|
@@ -44,7 +41,6 @@ function getConsole() {
|
|
|
44
41
|
groupEnd: function () {}
|
|
45
42
|
};
|
|
46
43
|
}
|
|
47
|
-
|
|
48
44
|
function warn(text) {
|
|
49
45
|
/* eslint-disable no-console */
|
|
50
46
|
getConsole().warn('[okta-auth-sdk] WARN: ' + text);
|
package/cjs/util/console.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","names":["getNativeConsole","window","console","undefined","getConsole","nativeConsole","log","warn","group","groupEnd","text","deprecate","deprecateWrap","fn","apply","arguments"],"sources":["../../../lib/util/console.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n/* global window */\n\nexport function getNativeConsole() {\n if (typeof window !== 'undefined') {\n return window.console;\n } else if (typeof console !== 'undefined') {\n return console;\n } else {\n return undefined;\n }\n}\n\nexport function getConsole() {\n var nativeConsole = getNativeConsole();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (nativeConsole && nativeConsole.log) {\n return nativeConsole;\n }\n return {\n log: function() {},\n warn: function() {},\n group: function() {},\n groupEnd: function() {}\n };\n}\n\nexport function warn(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] WARN: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecate(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] DEPRECATION: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecateWrap(text, fn) {\n return function() {\n deprecate(text);\n return fn.apply(null, arguments);\n };\n}\n\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"console.js","names":["getNativeConsole","window","console","undefined","getConsole","nativeConsole","log","warn","group","groupEnd","text","deprecate","deprecateWrap","fn","apply","arguments"],"sources":["../../../lib/util/console.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n/* global window */\n\nexport function getNativeConsole() {\n if (typeof window !== 'undefined') {\n return window.console;\n } else if (typeof console !== 'undefined') {\n return console;\n } else {\n return undefined;\n }\n}\n\nexport function getConsole() {\n var nativeConsole = getNativeConsole();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (nativeConsole && nativeConsole.log) {\n return nativeConsole;\n }\n return {\n log: function() {},\n warn: function() {},\n group: function() {},\n groupEnd: function() {}\n };\n}\n\nexport function warn(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] WARN: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecate(text) {\n /* eslint-disable no-console */\n getConsole().warn('[okta-auth-sdk] DEPRECATION: ' + text);\n /* eslint-enable */\n}\n\nexport function deprecateWrap(text, fn) {\n return function() {\n deprecate(text);\n return fn.apply(null, arguments);\n };\n}\n\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASA,gBAAgB,GAAG;EACjC,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,OAAOA,MAAM,CAACC,OAAO;EACvB,CAAC,MAAM,IAAI,OAAOA,OAAO,KAAK,WAAW,EAAE;IACzC,OAAOA,OAAO;EAChB,CAAC,MAAM;IACL,OAAOC,SAAS;EAClB;AACF;AAEO,SAASC,UAAU,GAAG;EAC3B,IAAIC,aAAa,GAAGL,gBAAgB,EAAE;EACtC;EACA;EACA,IAAIK,aAAa,IAAIA,aAAa,CAACC,GAAG,EAAE;IACtC,OAAOD,aAAa;EACtB;EACA,OAAO;IACLC,GAAG,EAAE,YAAW,CAAC,CAAC;IAClBC,IAAI,EAAE,YAAW,CAAC,CAAC;IACnBC,KAAK,EAAE,YAAW,CAAC,CAAC;IACpBC,QAAQ,EAAE,YAAW,CAAC;EACxB,CAAC;AACH;AAEO,SAASF,IAAI,CAACG,IAAI,EAAE;EACzB;EACAN,UAAU,EAAE,CAACG,IAAI,CAAC,wBAAwB,GAAGG,IAAI,CAAC;EAClD;AACF;;AAEO,SAASC,SAAS,CAACD,IAAI,EAAE;EAC9B;EACAN,UAAU,EAAE,CAACG,IAAI,CAAC,+BAA+B,GAAGG,IAAI,CAAC;EACzD;AACF;;AAEO,SAASE,aAAa,CAACF,IAAI,EAAEG,EAAE,EAAE;EACtC,OAAO,YAAW;IAChBF,SAAS,CAACD,IAAI,CAAC;IACf,OAAOG,EAAE,CAACC,KAAK,CAAC,IAAI,EAAEC,SAAS,CAAC;EAClC,CAAC;AACH"}
|
package/cjs/util/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _console = require("./console");
|
|
4
|
-
|
|
5
4
|
Object.keys(_console).forEach(function (key) {
|
|
6
5
|
if (key === "default" || key === "__esModule") return;
|
|
7
6
|
if (key in exports && exports[key] === _console[key]) return;
|
|
@@ -12,9 +11,7 @@ Object.keys(_console).forEach(function (key) {
|
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
13
|
});
|
|
15
|
-
|
|
16
14
|
var _misc = require("./misc");
|
|
17
|
-
|
|
18
15
|
Object.keys(_misc).forEach(function (key) {
|
|
19
16
|
if (key === "default" || key === "__esModule") return;
|
|
20
17
|
if (key in exports && exports[key] === _misc[key]) return;
|
|
@@ -25,9 +22,7 @@ Object.keys(_misc).forEach(function (key) {
|
|
|
25
22
|
}
|
|
26
23
|
});
|
|
27
24
|
});
|
|
28
|
-
|
|
29
25
|
var _object = require("./object");
|
|
30
|
-
|
|
31
26
|
Object.keys(_object).forEach(function (key) {
|
|
32
27
|
if (key === "default" || key === "__esModule") return;
|
|
33
28
|
if (key in exports && exports[key] === _object[key]) return;
|
|
@@ -38,9 +33,7 @@ Object.keys(_object).forEach(function (key) {
|
|
|
38
33
|
}
|
|
39
34
|
});
|
|
40
35
|
});
|
|
41
|
-
|
|
42
36
|
var _PromiseQueue = require("./PromiseQueue");
|
|
43
|
-
|
|
44
37
|
Object.keys(_PromiseQueue).forEach(function (key) {
|
|
45
38
|
if (key === "default" || key === "__esModule") return;
|
|
46
39
|
if (key in exports && exports[key] === _PromiseQueue[key]) return;
|
|
@@ -51,9 +44,7 @@ Object.keys(_PromiseQueue).forEach(function (key) {
|
|
|
51
44
|
}
|
|
52
45
|
});
|
|
53
46
|
});
|
|
54
|
-
|
|
55
47
|
var _types = require("./types");
|
|
56
|
-
|
|
57
48
|
Object.keys(_types).forEach(function (key) {
|
|
58
49
|
if (key === "default" || key === "__esModule") return;
|
|
59
50
|
if (key in exports && exports[key] === _types[key]) return;
|
|
@@ -64,9 +55,7 @@ Object.keys(_types).forEach(function (key) {
|
|
|
64
55
|
}
|
|
65
56
|
});
|
|
66
57
|
});
|
|
67
|
-
|
|
68
58
|
var _url = require("./url");
|
|
69
|
-
|
|
70
59
|
Object.keys(_url).forEach(function (key) {
|
|
71
60
|
if (key === "default" || key === "__esModule") return;
|
|
72
61
|
if (key in exports && exports[key] === _url[key]) return;
|
package/cjs/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../lib/util/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nexport * from './console';\nexport * from './misc';\nexport * from './object';\nexport * from './PromiseQueue';\nexport * from './types';\nexport * from './url';\n"],"mappings":";;AAaA
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../lib/util/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nexport * from './console';\nexport * from './misc';\nexport * from './object';\nexport * from './PromiseQueue';\nexport * from './types';\nexport * from './url';\n"],"mappings":";;AAaA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/cjs/util/misc.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.delay = delay;
|
|
|
4
4
|
exports.genRandomString = genRandomString;
|
|
5
5
|
exports.isoToUTCString = isoToUTCString;
|
|
6
6
|
exports.split2 = split2;
|
|
7
|
-
|
|
8
7
|
/*!
|
|
9
8
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -16,30 +15,26 @@ exports.split2 = split2;
|
|
|
16
15
|
*
|
|
17
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
17
|
*/
|
|
18
|
+
|
|
19
19
|
function isoToUTCString(str) {
|
|
20
20
|
var parts = str.match(/\d+/g),
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),
|
|
22
|
+
isoDate = new Date(isoTime);
|
|
23
23
|
return isoDate.toUTCString();
|
|
24
24
|
}
|
|
25
|
-
|
|
26
25
|
function genRandomString(length) {
|
|
27
26
|
var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
28
27
|
var random = '';
|
|
29
|
-
|
|
30
28
|
for (var c = 0, cl = randomCharset.length; c < length; ++c) {
|
|
31
29
|
random += randomCharset[Math.floor(Math.random() * cl)];
|
|
32
30
|
}
|
|
33
|
-
|
|
34
31
|
return random;
|
|
35
32
|
}
|
|
36
|
-
|
|
37
33
|
function delay(ms) {
|
|
38
34
|
return new Promise(function (resolve) {
|
|
39
35
|
setTimeout(resolve, ms);
|
|
40
36
|
});
|
|
41
37
|
}
|
|
42
|
-
|
|
43
38
|
function split2(str, delim) {
|
|
44
39
|
const parts = str.split(delim);
|
|
45
40
|
return [parts[0], parts.splice(1, parts.length).join(delim)];
|
package/cjs/util/misc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.js","names":["isoToUTCString","str","parts","match","isoTime","Date","UTC","isoDate","toUTCString","genRandomString","length","randomCharset","random","c","cl","Math","floor","delay","ms","Promise","resolve","setTimeout","split2","delim","split","splice","join"],"sources":["../../../lib/util/misc.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport function isoToUTCString(str) {\n var parts = str.match(/\\d+/g),\n isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),\n isoDate = new Date(isoTime);\n\n return isoDate.toUTCString();\n}\n\nexport function genRandomString(length) {\n var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n var random = '';\n for (var c = 0, cl = randomCharset.length; c < length; ++c) {\n random += randomCharset[Math.floor(Math.random() * cl)];\n }\n return random;\n}\n\nexport function delay(ms) {\n return new Promise(function(resolve) {\n setTimeout(resolve, ms);\n });\n}\n\nexport function split2(str, delim) {\n const parts = str.split(delim);\n return [\n parts[0], \n parts.splice(1, parts.length).join(delim),\n ];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"misc.js","names":["isoToUTCString","str","parts","match","isoTime","Date","UTC","isoDate","toUTCString","genRandomString","length","randomCharset","random","c","cl","Math","floor","delay","ms","Promise","resolve","setTimeout","split2","delim","split","splice","join"],"sources":["../../../lib/util/misc.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport function isoToUTCString(str) {\n var parts = str.match(/\\d+/g),\n isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]),\n isoDate = new Date(isoTime);\n\n return isoDate.toUTCString();\n}\n\nexport function genRandomString(length) {\n var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n var random = '';\n for (var c = 0, cl = randomCharset.length; c < length; ++c) {\n random += randomCharset[Math.floor(Math.random() * cl)];\n }\n return random;\n}\n\nexport function delay(ms) {\n return new Promise(function(resolve) {\n setTimeout(resolve, ms);\n });\n}\n\nexport function split2(str, delim) {\n const parts = str.split(delim);\n return [\n parts[0], \n parts.splice(1, parts.length).join(delim),\n ];\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASA,cAAc,CAACC,GAAG,EAAE;EAClC,IAAIC,KAAK,GAAGD,GAAG,CAACE,KAAK,CAAC,MAAM,CAAC;IACzBC,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACJ,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,CAAC;IAClFK,OAAO,GAAG,IAAIF,IAAI,CAACD,OAAO,CAAC;EAE/B,OAAOG,OAAO,CAACC,WAAW,EAAE;AAC9B;AAEO,SAASC,eAAe,CAACC,MAAM,EAAE;EACtC,IAAIC,aAAa,GAAG,+DAA+D;EACnF,IAAIC,MAAM,GAAG,EAAE;EACf,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,EAAE,GAAGH,aAAa,CAACD,MAAM,EAAEG,CAAC,GAAGH,MAAM,EAAE,EAAEG,CAAC,EAAE;IAC1DD,MAAM,IAAID,aAAa,CAACI,IAAI,CAACC,KAAK,CAACD,IAAI,CAACH,MAAM,EAAE,GAAGE,EAAE,CAAC,CAAC;EACzD;EACA,OAAOF,MAAM;AACf;AAEO,SAASK,KAAK,CAACC,EAAE,EAAE;EACxB,OAAO,IAAIC,OAAO,CAAC,UAASC,OAAO,EAAE;IACnCC,UAAU,CAACD,OAAO,EAAEF,EAAE,CAAC;EACzB,CAAC,CAAC;AACJ;AAEO,SAASI,MAAM,CAACrB,GAAG,EAAEsB,KAAK,EAAE;EACjC,MAAMrB,KAAK,GAAGD,GAAG,CAACuB,KAAK,CAACD,KAAK,CAAC;EAC9B,OAAO,CACLrB,KAAK,CAAC,CAAC,CAAC,EACRA,KAAK,CAACuB,MAAM,CAAC,CAAC,EAAEvB,KAAK,CAACQ,MAAM,CAAC,CAACgB,IAAI,CAACH,KAAK,CAAC,CAC1C;AACH"}
|
package/cjs/util/object.js
CHANGED
|
@@ -7,7 +7,6 @@ exports.find = find;
|
|
|
7
7
|
exports.getLink = getLink;
|
|
8
8
|
exports.omit = omit;
|
|
9
9
|
exports.removeNils = removeNils;
|
|
10
|
-
|
|
11
10
|
/*!
|
|
12
11
|
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
13
12
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,6 +18,7 @@ exports.removeNils = removeNils;
|
|
|
19
18
|
*
|
|
20
19
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
21
20
|
*/
|
|
21
|
+
|
|
22
22
|
function bind(fn, ctx) {
|
|
23
23
|
var additionalArgs = Array.prototype.slice.call(arguments, 2);
|
|
24
24
|
return function () {
|
|
@@ -26,13 +26,13 @@ function bind(fn, ctx) {
|
|
|
26
26
|
args = additionalArgs.concat(args);
|
|
27
27
|
return fn.apply(ctx, args);
|
|
28
28
|
};
|
|
29
|
-
}
|
|
30
|
-
|
|
29
|
+
}
|
|
31
30
|
|
|
31
|
+
// TODO: replace all references with `Object.assign` then remove this function
|
|
32
32
|
function extend() {
|
|
33
33
|
// First object will be modified!
|
|
34
|
-
var obj1 = arguments[0];
|
|
35
|
-
|
|
34
|
+
var obj1 = arguments[0];
|
|
35
|
+
// Properties from other objects will be copied over
|
|
36
36
|
var objArray = [].slice.call(arguments, 1);
|
|
37
37
|
objArray.forEach(function (obj) {
|
|
38
38
|
for (var prop in obj) {
|
|
@@ -47,77 +47,63 @@ function extend() {
|
|
|
47
47
|
|
|
48
48
|
function removeNils(obj) {
|
|
49
49
|
var cleaned = {};
|
|
50
|
-
|
|
51
50
|
for (var prop in obj) {
|
|
52
51
|
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
53
52
|
var value = obj[prop];
|
|
54
|
-
|
|
55
53
|
if (value !== null && value !== undefined) {
|
|
56
54
|
cleaned[prop] = value;
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
|
-
|
|
61
58
|
return cleaned;
|
|
62
59
|
}
|
|
63
|
-
|
|
64
60
|
function clone(obj) {
|
|
65
61
|
if (obj) {
|
|
66
62
|
var str = JSON.stringify(obj);
|
|
67
|
-
|
|
68
63
|
if (str) {
|
|
69
64
|
return JSON.parse(str);
|
|
70
65
|
}
|
|
71
66
|
}
|
|
72
|
-
|
|
73
67
|
return obj;
|
|
74
|
-
}
|
|
75
|
-
|
|
68
|
+
}
|
|
76
69
|
|
|
70
|
+
// Analogous to _.omit
|
|
77
71
|
function omit(obj, ...props) {
|
|
78
72
|
// var props = Array.prototype.slice.call(arguments, 1);
|
|
79
73
|
var newobj = {};
|
|
80
|
-
|
|
81
74
|
for (var p in obj) {
|
|
82
75
|
if (Object.prototype.hasOwnProperty.call(obj, p) && props.indexOf(p) == -1) {
|
|
83
76
|
newobj[p] = obj[p];
|
|
84
77
|
}
|
|
85
78
|
}
|
|
86
|
-
|
|
87
79
|
return clone(newobj);
|
|
88
80
|
}
|
|
89
|
-
|
|
90
81
|
function find(collection, searchParams) {
|
|
91
82
|
var c = collection.length;
|
|
92
|
-
|
|
93
83
|
while (c--) {
|
|
94
84
|
var item = collection[c];
|
|
95
85
|
var found = true;
|
|
96
|
-
|
|
97
86
|
for (var prop in searchParams) {
|
|
98
87
|
if (!Object.prototype.hasOwnProperty.call(searchParams, prop)) {
|
|
99
88
|
continue;
|
|
100
89
|
}
|
|
101
|
-
|
|
102
90
|
if (item[prop] !== searchParams[prop]) {
|
|
103
91
|
found = false;
|
|
104
92
|
break;
|
|
105
93
|
}
|
|
106
94
|
}
|
|
107
|
-
|
|
108
95
|
if (found) {
|
|
109
96
|
return item;
|
|
110
97
|
}
|
|
111
98
|
}
|
|
112
99
|
}
|
|
113
|
-
|
|
114
100
|
function getLink(obj, linkName, altName) {
|
|
115
101
|
if (!obj || !obj._links) {
|
|
116
102
|
return;
|
|
117
103
|
}
|
|
104
|
+
var link = clone(obj._links[linkName]);
|
|
118
105
|
|
|
119
|
-
|
|
120
|
-
|
|
106
|
+
// If a link has a name and we have an altName, return if they match
|
|
121
107
|
if (link && link.name && altName) {
|
|
122
108
|
if (link.name === altName) {
|
|
123
109
|
return link;
|