@azure/msal-common 0.0.1-alpha.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/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/_virtual/_tslib.js +90 -0
- package/dist/_virtual/_tslib.js.map +1 -0
- package/dist/account/AccountInfo.d.ts +30 -0
- package/dist/account/AccountInfo.d.ts.map +1 -0
- package/dist/account/AuthToken.d.ts +17 -0
- package/dist/account/AuthToken.d.ts.map +1 -0
- package/dist/account/AuthToken.js +43 -0
- package/dist/account/AuthToken.js.map +1 -0
- package/dist/account/CcsCredential.d.ts +9 -0
- package/dist/account/CcsCredential.d.ts.map +1 -0
- package/dist/account/CcsCredential.js +14 -0
- package/dist/account/CcsCredential.js.map +1 -0
- package/dist/account/ClientCredentials.d.ts +15 -0
- package/dist/account/ClientCredentials.d.ts.map +1 -0
- package/dist/account/ClientInfo.d.ts +20 -0
- package/dist/account/ClientInfo.d.ts.map +1 -0
- package/dist/account/ClientInfo.js +44 -0
- package/dist/account/ClientInfo.js.map +1 -0
- package/dist/account/DecodedAuthToken.d.ts +9 -0
- package/dist/account/DecodedAuthToken.d.ts.map +1 -0
- package/dist/account/TokenClaims.d.ts +60 -0
- package/dist/account/TokenClaims.d.ts.map +1 -0
- package/dist/authority/Authority.d.ts +200 -0
- package/dist/authority/Authority.d.ts.map +1 -0
- package/dist/authority/Authority.js +678 -0
- package/dist/authority/Authority.js.map +1 -0
- package/dist/authority/AuthorityFactory.d.ts +29 -0
- package/dist/authority/AuthorityFactory.d.ts.map +1 -0
- package/dist/authority/AuthorityFactory.js +69 -0
- package/dist/authority/AuthorityFactory.js.map +1 -0
- package/dist/authority/AuthorityMetadata.d.ts +623 -0
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -0
- package/dist/authority/AuthorityMetadata.js +12 -0
- package/dist/authority/AuthorityMetadata.js.map +1 -0
- package/dist/authority/AuthorityOptions.d.ts +19 -0
- package/dist/authority/AuthorityOptions.d.ts.map +1 -0
- package/dist/authority/AuthorityOptions.js +24 -0
- package/dist/authority/AuthorityOptions.js.map +1 -0
- package/dist/authority/AuthorityType.d.ts +8 -0
- package/dist/authority/AuthorityType.d.ts.map +1 -0
- package/dist/authority/AuthorityType.js +17 -0
- package/dist/authority/AuthorityType.js.map +1 -0
- package/dist/authority/AzureRegion.d.ts +2 -0
- package/dist/authority/AzureRegion.d.ts.map +1 -0
- package/dist/authority/AzureRegionConfiguration.d.ts +6 -0
- package/dist/authority/AzureRegionConfiguration.d.ts.map +1 -0
- package/dist/authority/CloudDiscoveryMetadata.d.ts +6 -0
- package/dist/authority/CloudDiscoveryMetadata.d.ts.map +1 -0
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +10 -0
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -0
- package/dist/authority/CloudInstanceDiscoveryResponse.js +13 -0
- package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -0
- package/dist/authority/ImdsOptions.d.ts +7 -0
- package/dist/authority/ImdsOptions.d.ts.map +1 -0
- package/dist/authority/OpenIdConfigResponse.d.ts +12 -0
- package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -0
- package/dist/authority/OpenIdConfigResponse.js +15 -0
- package/dist/authority/OpenIdConfigResponse.js.map +1 -0
- package/dist/authority/ProtocolMode.d.ts +8 -0
- package/dist/authority/ProtocolMode.d.ts.map +1 -0
- package/dist/authority/ProtocolMode.js +17 -0
- package/dist/authority/ProtocolMode.js.map +1 -0
- package/dist/authority/RegionDiscovery.d.ts +28 -0
- package/dist/authority/RegionDiscovery.d.ts.map +1 -0
- package/dist/authority/RegionDiscovery.js +127 -0
- package/dist/authority/RegionDiscovery.js.map +1 -0
- package/dist/authority/RegionDiscoveryMetadata.d.ts +7 -0
- package/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -0
- package/dist/cache/CacheManager.d.ts +393 -0
- package/dist/cache/CacheManager.d.ts.map +1 -0
- package/dist/cache/CacheManager.js +885 -0
- package/dist/cache/CacheManager.js.map +1 -0
- package/dist/cache/entities/AccessTokenEntity.d.ts +57 -0
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -0
- package/dist/cache/entities/AccessTokenEntity.js +124 -0
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -0
- package/dist/cache/entities/AccountEntity.d.ts +100 -0
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -0
- package/dist/cache/entities/AccountEntity.js +243 -0
- package/dist/cache/entities/AccountEntity.js.map +1 -0
- package/dist/cache/entities/AppMetadataEntity.d.ts +40 -0
- package/dist/cache/entities/AppMetadataEntity.d.ts.map +1 -0
- package/dist/cache/entities/AppMetadataEntity.js +74 -0
- package/dist/cache/entities/AppMetadataEntity.js.map +1 -0
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +48 -0
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -0
- package/dist/cache/entities/AuthorityMetadataEntity.js +82 -0
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -0
- package/dist/cache/entities/CacheRecord.d.ts +14 -0
- package/dist/cache/entities/CacheRecord.d.ts.map +1 -0
- package/dist/cache/entities/CacheRecord.js +19 -0
- package/dist/cache/entities/CacheRecord.js.map +1 -0
- package/dist/cache/entities/CredentialEntity.d.ts +94 -0
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -0
- package/dist/cache/entities/CredentialEntity.js +164 -0
- package/dist/cache/entities/CredentialEntity.js.map +1 -0
- package/dist/cache/entities/IdTokenEntity.d.ts +35 -0
- package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -0
- package/dist/cache/entities/IdTokenEntity.js +70 -0
- package/dist/cache/entities/IdTokenEntity.js.map +1 -0
- package/dist/cache/entities/RefreshTokenEntity.d.ts +37 -0
- package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -0
- package/dist/cache/entities/RefreshTokenEntity.js +73 -0
- package/dist/cache/entities/RefreshTokenEntity.js.map +1 -0
- package/dist/cache/entities/ServerTelemetryEntity.d.ts +13 -0
- package/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -0
- package/dist/cache/entities/ServerTelemetryEntity.js +35 -0
- package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -0
- package/dist/cache/entities/ThrottlingEntity.d.ts +14 -0
- package/dist/cache/entities/ThrottlingEntity.d.ts.map +1 -0
- package/dist/cache/entities/ThrottlingEntity.js +32 -0
- package/dist/cache/entities/ThrottlingEntity.js.map +1 -0
- package/dist/cache/interface/ICacheManager.d.ts +157 -0
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -0
- package/dist/cache/interface/ICachePlugin.d.ts +6 -0
- package/dist/cache/interface/ICachePlugin.d.ts.map +1 -0
- package/dist/cache/interface/ISerializableTokenCache.d.ts +5 -0
- package/dist/cache/interface/ISerializableTokenCache.d.ts.map +1 -0
- package/dist/cache/persistence/TokenCacheContext.d.ts +24 -0
- package/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -0
- package/dist/cache/persistence/TokenCacheContext.js +39 -0
- package/dist/cache/persistence/TokenCacheContext.js.map +1 -0
- package/dist/cache/utils/CacheTypes.d.ts +60 -0
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -0
- package/dist/client/AuthorizationCodeClient.d.ts +76 -0
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -0
- package/dist/client/AuthorizationCodeClient.js +468 -0
- package/dist/client/AuthorizationCodeClient.js.map +1 -0
- package/dist/client/BaseClient.d.ts +45 -0
- package/dist/client/BaseClient.d.ts.map +1 -0
- package/dist/client/BaseClient.js +103 -0
- package/dist/client/BaseClient.js.map +1 -0
- package/dist/client/ClientCredentialClient.d.ts +39 -0
- package/dist/client/ClientCredentialClient.d.ts.map +1 -0
- package/dist/client/ClientCredentialClient.js +202 -0
- package/dist/client/ClientCredentialClient.js.map +1 -0
- package/dist/client/DeviceCodeClient.d.ts +52 -0
- package/dist/client/DeviceCodeClient.d.ts.map +1 -0
- package/dist/client/DeviceCodeClient.js +232 -0
- package/dist/client/DeviceCodeClient.js.map +1 -0
- package/dist/client/OnBehalfOfClient.d.ts +51 -0
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -0
- package/dist/client/OnBehalfOfClient.js +244 -0
- package/dist/client/OnBehalfOfClient.js.map +1 -0
- package/dist/client/RefreshTokenClient.d.ts +40 -0
- package/dist/client/RefreshTokenClient.d.ts.map +1 -0
- package/dist/client/RefreshTokenClient.js +255 -0
- package/dist/client/RefreshTokenClient.js.map +1 -0
- package/dist/client/SilentFlowClient.d.ts +25 -0
- package/dist/client/SilentFlowClient.d.ts.map +1 -0
- package/dist/client/SilentFlowClient.js +128 -0
- package/dist/client/SilentFlowClient.js.map +1 -0
- package/dist/client/UsernamePasswordClient.d.ts +29 -0
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -0
- package/dist/client/UsernamePasswordClient.js +120 -0
- package/dist/client/UsernamePasswordClient.js.map +1 -0
- package/dist/config/AppTokenProvider.d.ts +39 -0
- package/dist/config/AppTokenProvider.d.ts.map +1 -0
- package/dist/config/ClientConfiguration.d.ts +135 -0
- package/dist/config/ClientConfiguration.d.ts.map +1 -0
- package/dist/config/ClientConfiguration.js +105 -0
- package/dist/config/ClientConfiguration.js.map +1 -0
- package/dist/crypto/ICrypto.d.ts +63 -0
- package/dist/crypto/ICrypto.d.ts.map +1 -0
- package/dist/crypto/ICrypto.js +80 -0
- package/dist/crypto/ICrypto.js.map +1 -0
- package/dist/crypto/IGuidGenerator.d.ts +5 -0
- package/dist/crypto/IGuidGenerator.d.ts.map +1 -0
- package/dist/crypto/JoseHeader.d.ts +22 -0
- package/dist/crypto/JoseHeader.d.ts.map +1 -0
- package/dist/crypto/JoseHeader.js +45 -0
- package/dist/crypto/JoseHeader.js.map +1 -0
- package/dist/crypto/PopTokenGenerator.d.ts +56 -0
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -0
- package/dist/crypto/PopTokenGenerator.js +107 -0
- package/dist/crypto/PopTokenGenerator.js.map +1 -0
- package/dist/crypto/SignedHttpRequest.d.ts +12 -0
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -0
- package/dist/error/AuthError.d.ts +48 -0
- package/dist/error/AuthError.d.ts.map +1 -0
- package/dist/error/AuthError.js +61 -0
- package/dist/error/AuthError.js.map +1 -0
- package/dist/error/ClientAuthError.d.ts +372 -0
- package/dist/error/ClientAuthError.d.ts.map +1 -0
- package/dist/error/ClientAuthError.js +477 -0
- package/dist/error/ClientAuthError.js.map +1 -0
- package/dist/error/ClientConfigurationError.d.ts +199 -0
- package/dist/error/ClientConfigurationError.d.ts.map +1 -0
- package/dist/error/ClientConfigurationError.js +260 -0
- package/dist/error/ClientConfigurationError.js.map +1 -0
- package/dist/error/InteractionRequiredAuthError.d.ts +42 -0
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -0
- package/dist/error/InteractionRequiredAuthError.js +80 -0
- package/dist/error/InteractionRequiredAuthError.js.map +1 -0
- package/dist/error/JoseHeaderError.d.ts +29 -0
- package/dist/error/JoseHeaderError.d.ts.map +1 -0
- package/dist/error/JoseHeaderError.js +50 -0
- package/dist/error/JoseHeaderError.js.map +1 -0
- package/dist/error/ServerError.d.ts +8 -0
- package/dist/error/ServerError.d.ts.map +1 -0
- package/dist/error/ServerError.js +25 -0
- package/dist/error/ServerError.js.map +1 -0
- package/dist/index.cjs.js +8441 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/Logger.d.ts +95 -0
- package/dist/logger/Logger.d.ts.map +1 -0
- package/dist/logger/Logger.js +185 -0
- package/dist/logger/Logger.js.map +1 -0
- package/dist/network/INetworkModule.d.ts +31 -0
- package/dist/network/INetworkModule.d.ts.map +1 -0
- package/dist/network/INetworkModule.js +21 -0
- package/dist/network/INetworkModule.js.map +1 -0
- package/dist/network/NetworkManager.d.ts +21 -0
- package/dist/network/NetworkManager.d.ts.map +1 -0
- package/dist/network/NetworkManager.js +56 -0
- package/dist/network/NetworkManager.js.map +1 -0
- package/dist/network/RequestThumbprint.d.ts +17 -0
- package/dist/network/RequestThumbprint.d.ts.map +1 -0
- package/dist/network/ThrottlingUtils.d.ts +42 -0
- package/dist/network/ThrottlingUtils.d.ts.map +1 -0
- package/dist/network/ThrottlingUtils.js +101 -0
- package/dist/network/ThrottlingUtils.js.map +1 -0
- package/dist/packageMetadata.d.ts +3 -0
- package/dist/packageMetadata.d.ts.map +1 -0
- package/dist/packageMetadata.js +8 -0
- package/dist/packageMetadata.js.map +1 -0
- package/dist/request/AuthenticationHeaderParser.d.ts +20 -0
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
- package/dist/request/AuthenticationHeaderParser.js +64 -0
- package/dist/request/AuthenticationHeaderParser.js.map +1 -0
- package/dist/request/BaseAuthRequest.d.ts +34 -0
- package/dist/request/BaseAuthRequest.d.ts.map +1 -0
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +28 -0
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -0
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +51 -0
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -0
- package/dist/request/CommonClientCredentialRequest.d.ts +17 -0
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -0
- package/dist/request/CommonDeviceCodeRequest.d.ts +19 -0
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -0
- package/dist/request/CommonEndSessionRequest.d.ts +21 -0
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -0
- package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -0
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -0
- package/dist/request/CommonRefreshTokenRequest.d.ts +21 -0
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -0
- package/dist/request/CommonSilentFlowRequest.d.ts +20 -0
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -0
- package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -0
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -0
- package/dist/request/RequestParameterBuilder.d.ts +217 -0
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -0
- package/dist/request/RequestParameterBuilder.js +387 -0
- package/dist/request/RequestParameterBuilder.js.map +1 -0
- package/dist/request/RequestValidator.d.ts +34 -0
- package/dist/request/RequestValidator.d.ts.map +1 -0
- package/dist/request/RequestValidator.js +92 -0
- package/dist/request/RequestValidator.js.map +1 -0
- package/dist/request/ScopeSet.d.ts +83 -0
- package/dist/request/ScopeSet.d.ts.map +1 -0
- package/dist/request/ScopeSet.js +192 -0
- package/dist/request/ScopeSet.js.map +1 -0
- package/dist/response/AuthenticationResult.d.ts +38 -0
- package/dist/response/AuthenticationResult.d.ts.map +1 -0
- package/dist/response/AuthorizationCodePayload.d.ts +14 -0
- package/dist/response/AuthorizationCodePayload.d.ts.map +1 -0
- package/dist/response/DeviceCodeResponse.d.ts +26 -0
- package/dist/response/DeviceCodeResponse.d.ts.map +1 -0
- package/dist/response/ExternalTokenResponse.d.ts +15 -0
- package/dist/response/ExternalTokenResponse.d.ts.map +1 -0
- package/dist/response/IMDSBadResponse.d.ts +5 -0
- package/dist/response/IMDSBadResponse.d.ts.map +1 -0
- package/dist/response/ResponseHandler.d.ts +71 -0
- package/dist/response/ResponseHandler.d.ts.map +1 -0
- package/dist/response/ResponseHandler.js +293 -0
- package/dist/response/ResponseHandler.js.map +1 -0
- package/dist/response/ServerAuthorizationCodeResponse.d.ts +22 -0
- package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -0
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +43 -0
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -0
- package/dist/telemetry/performance/IPerformanceClient.d.ts +22 -0
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -0
- package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +6 -0
- package/dist/telemetry/performance/IPerformanceMeasurement.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceClient.d.ts +125 -0
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceClient.js +281 -0
- package/dist/telemetry/performance/PerformanceClient.js.map +1 -0
- package/dist/telemetry/performance/PerformanceEvent.d.ts +249 -0
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceEvent.js +121 -0
- package/dist/telemetry/performance/PerformanceEvent.js.map +1 -0
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +13 -0
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -0
- package/dist/telemetry/performance/StubPerformanceClient.js +37 -0
- package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -0
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +67 -0
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -0
- package/dist/telemetry/server/ServerTelemetryManager.js +168 -0
- package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -0
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts +9 -0
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -0
- package/dist/url/IUri.d.ts +13 -0
- package/dist/url/IUri.d.ts.map +1 -0
- package/dist/url/UrlString.d.ts +62 -0
- package/dist/url/UrlString.d.ts.map +1 -0
- package/dist/url/UrlString.js +208 -0
- package/dist/url/UrlString.js.map +1 -0
- package/dist/utils/Constants.d.ts +340 -0
- package/dist/utils/Constants.d.ts.map +1 -0
- package/dist/utils/Constants.js +381 -0
- package/dist/utils/Constants.js.map +1 -0
- package/dist/utils/MsalTypes.d.ts +7 -0
- package/dist/utils/MsalTypes.d.ts.map +1 -0
- package/dist/utils/ProtocolUtils.d.ts +43 -0
- package/dist/utils/ProtocolUtils.d.ts.map +1 -0
- package/dist/utils/ProtocolUtils.js +77 -0
- package/dist/utils/ProtocolUtils.js.map +1 -0
- package/dist/utils/StringUtils.d.ts +54 -0
- package/dist/utils/StringUtils.d.ts.map +1 -0
- package/dist/utils/StringUtils.js +129 -0
- package/dist/utils/StringUtils.js.map +1 -0
- package/dist/utils/TimeUtils.d.ts +28 -0
- package/dist/utils/TimeUtils.d.ts.map +1 -0
- package/dist/utils/TimeUtils.js +53 -0
- package/dist/utils/TimeUtils.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CredentialType, AuthenticationScheme } from "../../utils/Constants";
|
|
2
|
+
/**
|
|
3
|
+
* Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc
|
|
4
|
+
*
|
|
5
|
+
* Key:Value Schema:
|
|
6
|
+
*
|
|
7
|
+
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>
|
|
8
|
+
*
|
|
9
|
+
* Value Schema:
|
|
10
|
+
* {
|
|
11
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
12
|
+
* environment: entity that issued the token, represented as a full host
|
|
13
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
14
|
+
* clientId: client ID of the application
|
|
15
|
+
* secret: Actual credential as a string
|
|
16
|
+
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
17
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
18
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
19
|
+
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
|
|
20
|
+
* requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request
|
|
21
|
+
* userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow
|
|
22
|
+
* }
|
|
23
|
+
*/
|
|
24
|
+
export declare class CredentialEntity {
|
|
25
|
+
homeAccountId: string;
|
|
26
|
+
environment: string;
|
|
27
|
+
credentialType: CredentialType;
|
|
28
|
+
clientId: string;
|
|
29
|
+
secret: string;
|
|
30
|
+
familyId?: string;
|
|
31
|
+
realm?: string;
|
|
32
|
+
target?: string;
|
|
33
|
+
userAssertionHash?: string;
|
|
34
|
+
tokenType?: AuthenticationScheme;
|
|
35
|
+
keyId?: string;
|
|
36
|
+
requestedClaimsHash?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
39
|
+
*/
|
|
40
|
+
generateAccountId(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>
|
|
43
|
+
*/
|
|
44
|
+
generateCredentialId(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Generate target key component as per schema: <target>
|
|
47
|
+
*/
|
|
48
|
+
generateTarget(): string;
|
|
49
|
+
/**
|
|
50
|
+
* generates credential key
|
|
51
|
+
*/
|
|
52
|
+
generateCredentialKey(): string;
|
|
53
|
+
/**
|
|
54
|
+
* returns the type of the cache (in this case credential)
|
|
55
|
+
*/
|
|
56
|
+
generateType(): number;
|
|
57
|
+
/**
|
|
58
|
+
* helper function to return `CredentialType`
|
|
59
|
+
* @param key
|
|
60
|
+
*/
|
|
61
|
+
static getCredentialType(key: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* generates credential key
|
|
64
|
+
* <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
|
|
65
|
+
*/
|
|
66
|
+
static generateCredentialCacheKey(homeAccountId: string, environment: string, credentialType: CredentialType, clientId: string, realm?: string, target?: string, familyId?: string, tokenType?: AuthenticationScheme, requestedClaimsHash?: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* generates Account Id for keys
|
|
69
|
+
* @param homeAccountId
|
|
70
|
+
* @param environment
|
|
71
|
+
*/
|
|
72
|
+
private static generateAccountIdForCacheKey;
|
|
73
|
+
/**
|
|
74
|
+
* Generates Credential Id for keys
|
|
75
|
+
* @param credentialType
|
|
76
|
+
* @param realm
|
|
77
|
+
* @param clientId
|
|
78
|
+
* @param familyId
|
|
79
|
+
*/
|
|
80
|
+
private static generateCredentialIdForCacheKey;
|
|
81
|
+
/**
|
|
82
|
+
* Generate target key component as per schema: <target>
|
|
83
|
+
*/
|
|
84
|
+
private static generateTargetForCacheKey;
|
|
85
|
+
/**
|
|
86
|
+
* Generate requested claims key component as per schema: <requestedClaims>
|
|
87
|
+
*/
|
|
88
|
+
private static generateClaimsHashForCacheKey;
|
|
89
|
+
/**
|
|
90
|
+
* Generate scheme key componenet as per schema: <scheme>
|
|
91
|
+
*/
|
|
92
|
+
private static generateSchemeForCacheKey;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=CredentialEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,cAAc,EAAwB,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG/G;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,gBAAgB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAI3B;;OAEG;IACH,oBAAoB,IAAI,MAAM;IAS9B;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,qBAAqB,IAAI,MAAM;IAc/B;;OAEG;IACH,YAAY,IAAI,MAAM;IAetB;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAiB7C;;;OAGG;IACH,MAAM,CAAC,0BAA0B,CAC7B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,oBAAoB,EAChC,mBAAmB,CAAC,EAAE,MAAM,GAC7B,MAAM;IAYT;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAQ3C;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAmB9C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAIxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAI5C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;CAO3C"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*! @azure/msal-common v0.0.1-alpha.0 2022-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { CredentialType, CacheType, Constants, Separators, AuthenticationScheme } from '../../utils/Constants.js';
|
|
4
|
+
import { ClientAuthError } from '../../error/ClientAuthError.js';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
|
+
* Licensed under the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc
|
|
12
|
+
*
|
|
13
|
+
* Key:Value Schema:
|
|
14
|
+
*
|
|
15
|
+
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>
|
|
16
|
+
*
|
|
17
|
+
* Value Schema:
|
|
18
|
+
* {
|
|
19
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
20
|
+
* environment: entity that issued the token, represented as a full host
|
|
21
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
22
|
+
* clientId: client ID of the application
|
|
23
|
+
* secret: Actual credential as a string
|
|
24
|
+
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
25
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
26
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
27
|
+
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
|
|
28
|
+
* requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request
|
|
29
|
+
* userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
var CredentialEntity = /** @class */ (function () {
|
|
33
|
+
function CredentialEntity() {
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
37
|
+
*/
|
|
38
|
+
CredentialEntity.prototype.generateAccountId = function () {
|
|
39
|
+
return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>
|
|
43
|
+
*/
|
|
44
|
+
CredentialEntity.prototype.generateCredentialId = function () {
|
|
45
|
+
return CredentialEntity.generateCredentialIdForCacheKey(this.credentialType, this.clientId, this.realm, this.familyId);
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Generate target key component as per schema: <target>
|
|
49
|
+
*/
|
|
50
|
+
CredentialEntity.prototype.generateTarget = function () {
|
|
51
|
+
return CredentialEntity.generateTargetForCacheKey(this.target);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* generates credential key
|
|
55
|
+
*/
|
|
56
|
+
CredentialEntity.prototype.generateCredentialKey = function () {
|
|
57
|
+
return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType, this.requestedClaimsHash);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* returns the type of the cache (in this case credential)
|
|
61
|
+
*/
|
|
62
|
+
CredentialEntity.prototype.generateType = function () {
|
|
63
|
+
switch (this.credentialType) {
|
|
64
|
+
case CredentialType.ID_TOKEN:
|
|
65
|
+
return CacheType.ID_TOKEN;
|
|
66
|
+
case CredentialType.ACCESS_TOKEN:
|
|
67
|
+
case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
|
|
68
|
+
return CacheType.ACCESS_TOKEN;
|
|
69
|
+
case CredentialType.REFRESH_TOKEN:
|
|
70
|
+
return CacheType.REFRESH_TOKEN;
|
|
71
|
+
default: {
|
|
72
|
+
throw ClientAuthError.createUnexpectedCredentialTypeError();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* helper function to return `CredentialType`
|
|
78
|
+
* @param key
|
|
79
|
+
*/
|
|
80
|
+
CredentialEntity.getCredentialType = function (key) {
|
|
81
|
+
// First keyword search will match all "AccessToken" and "AccessToken_With_AuthScheme" credentials
|
|
82
|
+
if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {
|
|
83
|
+
// Perform second search to differentiate between "AccessToken" and "AccessToken_With_AuthScheme" credential types
|
|
84
|
+
if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {
|
|
85
|
+
return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
86
|
+
}
|
|
87
|
+
return CredentialType.ACCESS_TOKEN;
|
|
88
|
+
}
|
|
89
|
+
else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {
|
|
90
|
+
return CredentialType.ID_TOKEN;
|
|
91
|
+
}
|
|
92
|
+
else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {
|
|
93
|
+
return CredentialType.REFRESH_TOKEN;
|
|
94
|
+
}
|
|
95
|
+
return Constants.NOT_DEFINED;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* generates credential key
|
|
99
|
+
* <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
|
|
100
|
+
*/
|
|
101
|
+
CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType, requestedClaimsHash) {
|
|
102
|
+
var credentialKey = [
|
|
103
|
+
this.generateAccountIdForCacheKey(homeAccountId, environment),
|
|
104
|
+
this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),
|
|
105
|
+
this.generateTargetForCacheKey(target),
|
|
106
|
+
this.generateClaimsHashForCacheKey(requestedClaimsHash),
|
|
107
|
+
this.generateSchemeForCacheKey(tokenType)
|
|
108
|
+
];
|
|
109
|
+
return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* generates Account Id for keys
|
|
113
|
+
* @param homeAccountId
|
|
114
|
+
* @param environment
|
|
115
|
+
*/
|
|
116
|
+
CredentialEntity.generateAccountIdForCacheKey = function (homeAccountId, environment) {
|
|
117
|
+
var accountId = [homeAccountId, environment];
|
|
118
|
+
return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Generates Credential Id for keys
|
|
122
|
+
* @param credentialType
|
|
123
|
+
* @param realm
|
|
124
|
+
* @param clientId
|
|
125
|
+
* @param familyId
|
|
126
|
+
*/
|
|
127
|
+
CredentialEntity.generateCredentialIdForCacheKey = function (credentialType, clientId, realm, familyId) {
|
|
128
|
+
var clientOrFamilyId = credentialType === CredentialType.REFRESH_TOKEN
|
|
129
|
+
? familyId || clientId
|
|
130
|
+
: clientId;
|
|
131
|
+
var credentialId = [
|
|
132
|
+
credentialType,
|
|
133
|
+
clientOrFamilyId,
|
|
134
|
+
realm || Constants.EMPTY_STRING,
|
|
135
|
+
];
|
|
136
|
+
return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Generate target key component as per schema: <target>
|
|
140
|
+
*/
|
|
141
|
+
CredentialEntity.generateTargetForCacheKey = function (scopes) {
|
|
142
|
+
return (scopes || Constants.EMPTY_STRING).toLowerCase();
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Generate requested claims key component as per schema: <requestedClaims>
|
|
146
|
+
*/
|
|
147
|
+
CredentialEntity.generateClaimsHashForCacheKey = function (requestedClaimsHash) {
|
|
148
|
+
return (requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Generate scheme key componenet as per schema: <scheme>
|
|
152
|
+
*/
|
|
153
|
+
CredentialEntity.generateSchemeForCacheKey = function (tokenType) {
|
|
154
|
+
/*
|
|
155
|
+
* PoP Tokens and SSH certs include scheme in cache key
|
|
156
|
+
* Cast to lowercase to handle "bearer" from ADFS
|
|
157
|
+
*/
|
|
158
|
+
return (tokenType && tokenType.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;
|
|
159
|
+
};
|
|
160
|
+
return CredentialEntity;
|
|
161
|
+
}());
|
|
162
|
+
|
|
163
|
+
export { CredentialEntity };
|
|
164
|
+
//# sourceMappingURL=CredentialEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialEntity.js","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Separators, CredentialType, CacheType, Constants, AuthenticationScheme } from \"../../utils/Constants\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\n *\n * Key:Value Schema:\n *\n * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)\n * requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request\n * userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow\n * }\n */\nexport class CredentialEntity {\n homeAccountId: string;\n environment: string;\n credentialType: CredentialType;\n clientId: string;\n secret: string;\n familyId?: string;\n realm?: string;\n target?: string;\n userAssertionHash?: string;\n tokenType?: AuthenticationScheme;\n keyId?: string;\n requestedClaimsHash?: string;\n\n /**\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\n */\n generateAccountId(): string {\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\n }\n\n /**\n * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>\n */\n generateCredentialId(): string {\n return CredentialEntity.generateCredentialIdForCacheKey(\n this.credentialType,\n this.clientId,\n this.realm,\n this.familyId\n );\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n generateTarget(): string {\n return CredentialEntity.generateTargetForCacheKey(this.target);\n }\n\n /**\n * generates credential key\n */\n generateCredentialKey(): string {\n return CredentialEntity.generateCredentialCacheKey(\n this.homeAccountId,\n this.environment,\n this.credentialType,\n this.clientId,\n this.realm,\n this.target,\n this.familyId,\n this.tokenType,\n this.requestedClaimsHash,\n );\n }\n\n /**\n * returns the type of the cache (in this case credential)\n */\n generateType(): number {\n switch (this.credentialType) {\n case CredentialType.ID_TOKEN:\n return CacheType.ID_TOKEN;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n return CacheType.ACCESS_TOKEN;\n case CredentialType.REFRESH_TOKEN:\n return CacheType.REFRESH_TOKEN;\n default: {\n throw ClientAuthError.createUnexpectedCredentialTypeError();\n }\n }\n }\n\n /**\n * helper function to return `CredentialType`\n * @param key\n */\n static getCredentialType(key: string): string {\n // First keyword search will match all \"AccessToken\" and \"AccessToken_With_AuthScheme\" credentials\n if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {\n // Perform second search to differentiate between \"AccessToken\" and \"AccessToken_With_AuthScheme\" credential types\n if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {\n return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\n }\n return CredentialType.ACCESS_TOKEN;\n } else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.ID_TOKEN;\n } else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.REFRESH_TOKEN;\n }\n\n return Constants.NOT_DEFINED;\n }\n\n /**\n * generates credential key\n * <home_account_id*>-\\<environment>-<credential_type>-<client_id>-<realm\\*>-<target\\*>-<scheme\\*>\n */\n static generateCredentialCacheKey(\n homeAccountId: string,\n environment: string,\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n target?: string,\n familyId?: string,\n tokenType?: AuthenticationScheme,\n requestedClaimsHash?: string\n ): string {\n const credentialKey = [\n this.generateAccountIdForCacheKey(homeAccountId, environment),\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\n this.generateTargetForCacheKey(target),\n this.generateClaimsHashForCacheKey(requestedClaimsHash),\n this.generateSchemeForCacheKey(tokenType)\n ];\n\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * generates Account Id for keys\n * @param homeAccountId\n * @param environment\n */\n private static generateAccountIdForCacheKey(\n homeAccountId: string,\n environment: string\n ): string {\n const accountId: Array<string> = [homeAccountId, environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generates Credential Id for keys\n * @param credentialType\n * @param realm\n * @param clientId\n * @param familyId\n */\n private static generateCredentialIdForCacheKey(\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n familyId?: string\n ): string {\n const clientOrFamilyId =\n credentialType === CredentialType.REFRESH_TOKEN\n ? familyId || clientId\n : clientId;\n const credentialId: Array<string> = [\n credentialType,\n clientOrFamilyId,\n realm || Constants.EMPTY_STRING,\n ];\n\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n private static generateTargetForCacheKey(scopes?: string): string {\n return (scopes || Constants.EMPTY_STRING).toLowerCase();\n }\n\n /**\n * Generate requested claims key component as per schema: <requestedClaims>\n */\n private static generateClaimsHashForCacheKey(requestedClaimsHash?: string): string {\n return(requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();\n }\n\n /**\n * Generate scheme key componenet as per schema: <scheme>\n */\n private static generateSchemeForCacheKey(tokenType?: string): string {\n /*\n * PoP Tokens and SSH certs include scheme in cache key\n * Cast to lowercase to handle \"bearer\" from ADFS\n */\n return (tokenType && tokenType.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;;;;;;;;;;;;;;;;;;;;AAqBG;AACH,IAAA,gBAAA,kBAAA,YAAA;AAAA,IAAA,SAAA,gBAAA,GAAA;KAyLC;AA3KG;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,iBAAiB,GAAjB,YAAA;AACI,QAAA,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;KAC9F,CAAA;AAED;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,oBAAoB,GAApB,YAAA;QACI,OAAO,gBAAgB,CAAC,+BAA+B,CACnD,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,CAChB,CAAC;KACL,CAAA;AAED;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,cAAc,GAAd,YAAA;QACI,OAAO,gBAAgB,CAAC,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAClE,CAAA;AAED;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,qBAAqB,GAArB,YAAA;AACI,QAAA,OAAO,gBAAgB,CAAC,0BAA0B,CAC9C,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,mBAAmB,CAC3B,CAAC;KACL,CAAA;AAED;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,YAAY,GAAZ,YAAA;QACI,QAAQ,IAAI,CAAC,cAAc;YACvB,KAAK,cAAc,CAAC,QAAQ;gBACxB,OAAO,SAAS,CAAC,QAAQ,CAAC;YAC9B,KAAK,cAAc,CAAC,YAAY,CAAC;YACjC,KAAK,cAAc,CAAC,6BAA6B;gBAC7C,OAAO,SAAS,CAAC,YAAY,CAAC;YAClC,KAAK,cAAc,CAAC,aAAa;gBAC7B,OAAO,SAAS,CAAC,aAAa,CAAC;AACnC,YAAA,SAAS;AACL,gBAAA,MAAM,eAAe,CAAC,mCAAmC,EAAE,CAAC;AAC/D,aAAA;AACJ,SAAA;KACJ,CAAA;AAED;;;AAGG;IACI,gBAAiB,CAAA,iBAAA,GAAxB,UAAyB,GAAW,EAAA;;AAEhC,QAAA,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;;AAE/D,YAAA,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,6BAA6B,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;gBAChF,OAAO,cAAc,CAAC,6BAA6B,CAAC;AACvD,aAAA;YACD,OAAO,cAAc,CAAC,YAAY,CAAC;AACtC,SAAA;AAAM,aAAA,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YAClE,OAAO,cAAc,CAAC,QAAQ,CAAC;AAClC,SAAA;AAAM,aAAA,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YACvE,OAAO,cAAc,CAAC,aAAa,CAAC;AACvC,SAAA;QAED,OAAO,SAAS,CAAC,WAAW,CAAC;KAChC,CAAA;AAED;;;AAGG;AACI,IAAA,gBAAA,CAAA,0BAA0B,GAAjC,UACI,aAAqB,EACrB,WAAmB,EACnB,cAA8B,EAC9B,QAAgB,EAChB,KAAc,EACd,MAAe,EACf,QAAiB,EACjB,SAAgC,EAChC,mBAA4B,EAAA;AAE5B,QAAA,IAAM,aAAa,GAAG;AAClB,YAAA,IAAI,CAAC,4BAA4B,CAAC,aAAa,EAAE,WAAW,CAAC;YAC7D,IAAI,CAAC,+BAA+B,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC;AAC/E,YAAA,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC;AACtC,YAAA,IAAI,CAAC,6BAA6B,CAAC,mBAAmB,CAAC;AACvD,YAAA,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC;SAC5C,CAAC;QAEF,OAAO,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KAC3E,CAAA;AAED;;;;AAIG;AACY,IAAA,gBAAA,CAAA,4BAA4B,GAA3C,UACI,aAAqB,EACrB,WAAmB,EAAA;AAEnB,QAAA,IAAM,SAAS,GAAkB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAC9D,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACvE,CAAA;AAED;;;;;;AAMG;IACY,gBAA+B,CAAA,+BAAA,GAA9C,UACI,cAA8B,EAC9B,QAAgB,EAChB,KAAc,EACd,QAAiB,EAAA;AAEjB,QAAA,IAAM,gBAAgB,GAClB,cAAc,KAAK,cAAc,CAAC,aAAa;cACzC,QAAQ,IAAI,QAAQ;cACpB,QAAQ,CAAC;AACnB,QAAA,IAAM,YAAY,GAAkB;YAChC,cAAc;YACd,gBAAgB;YAChB,KAAK,IAAI,SAAS,CAAC,YAAY;SAClC,CAAC;QAEF,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KAC1E,CAAA;AAED;;AAEG;IACY,gBAAyB,CAAA,yBAAA,GAAxC,UAAyC,MAAe,EAAA;QACpD,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;KAC3D,CAAA;AAED;;AAEG;IACY,gBAA6B,CAAA,6BAAA,GAA5C,UAA6C,mBAA4B,EAAA;QACrE,OAAM,CAAC,mBAAmB,IAAI,SAAS,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;KACvE,CAAA;AAED;;AAEG;IACY,gBAAyB,CAAA,yBAAA,GAAxC,UAAyC,SAAkB,EAAA;AACvD;;;AAGG;AACH,QAAA,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,oBAAoB,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,YAAY,CAAC;KAClJ,CAAA;IACL,OAAC,gBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CredentialEntity } from "./CredentialEntity";
|
|
2
|
+
/**
|
|
3
|
+
* ID_TOKEN Cache
|
|
4
|
+
*
|
|
5
|
+
* Key:Value Schema:
|
|
6
|
+
*
|
|
7
|
+
* Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-
|
|
8
|
+
*
|
|
9
|
+
* Value Schema:
|
|
10
|
+
* {
|
|
11
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
12
|
+
* environment: entity that issued the token, represented as a full host
|
|
13
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
14
|
+
* clientId: client ID of the application
|
|
15
|
+
* secret: Actual credential as a string
|
|
16
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
export declare class IdTokenEntity extends CredentialEntity {
|
|
20
|
+
realm: string;
|
|
21
|
+
/**
|
|
22
|
+
* Create IdTokenEntity
|
|
23
|
+
* @param homeAccountId
|
|
24
|
+
* @param authenticationResult
|
|
25
|
+
* @param clientId
|
|
26
|
+
* @param authority
|
|
27
|
+
*/
|
|
28
|
+
static createIdTokenEntity(homeAccountId: string, environment: string, idToken: string, clientId: string, tenantId: string): IdTokenEntity;
|
|
29
|
+
/**
|
|
30
|
+
* Validates an entity: checks for all expected params
|
|
31
|
+
* @param entity
|
|
32
|
+
*/
|
|
33
|
+
static isIdTokenEntity(entity: object): boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=IdTokenEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdTokenEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;IAC/C,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,MAAM,CAAC,mBAAmB,CACtB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACjB,aAAa;IAahB;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;CAgBlD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*! @azure/msal-common v0.0.1-alpha.0 2022-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { __extends } from '../../_virtual/_tslib.js';
|
|
4
|
+
import { CredentialEntity } from './CredentialEntity.js';
|
|
5
|
+
import { CredentialType } from '../../utils/Constants.js';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* ID_TOKEN Cache
|
|
13
|
+
*
|
|
14
|
+
* Key:Value Schema:
|
|
15
|
+
*
|
|
16
|
+
* Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-
|
|
17
|
+
*
|
|
18
|
+
* Value Schema:
|
|
19
|
+
* {
|
|
20
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
21
|
+
* environment: entity that issued the token, represented as a full host
|
|
22
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
23
|
+
* clientId: client ID of the application
|
|
24
|
+
* secret: Actual credential as a string
|
|
25
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
var IdTokenEntity = /** @class */ (function (_super) {
|
|
29
|
+
__extends(IdTokenEntity, _super);
|
|
30
|
+
function IdTokenEntity() {
|
|
31
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create IdTokenEntity
|
|
35
|
+
* @param homeAccountId
|
|
36
|
+
* @param authenticationResult
|
|
37
|
+
* @param clientId
|
|
38
|
+
* @param authority
|
|
39
|
+
*/
|
|
40
|
+
IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId) {
|
|
41
|
+
var idTokenEntity = new IdTokenEntity();
|
|
42
|
+
idTokenEntity.credentialType = CredentialType.ID_TOKEN;
|
|
43
|
+
idTokenEntity.homeAccountId = homeAccountId;
|
|
44
|
+
idTokenEntity.environment = environment;
|
|
45
|
+
idTokenEntity.clientId = clientId;
|
|
46
|
+
idTokenEntity.secret = idToken;
|
|
47
|
+
idTokenEntity.realm = tenantId;
|
|
48
|
+
return idTokenEntity;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Validates an entity: checks for all expected params
|
|
52
|
+
* @param entity
|
|
53
|
+
*/
|
|
54
|
+
IdTokenEntity.isIdTokenEntity = function (entity) {
|
|
55
|
+
if (!entity) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return (entity.hasOwnProperty("homeAccountId") &&
|
|
59
|
+
entity.hasOwnProperty("environment") &&
|
|
60
|
+
entity.hasOwnProperty("credentialType") &&
|
|
61
|
+
entity.hasOwnProperty("realm") &&
|
|
62
|
+
entity.hasOwnProperty("clientId") &&
|
|
63
|
+
entity.hasOwnProperty("secret") &&
|
|
64
|
+
entity["credentialType"] === CredentialType.ID_TOKEN);
|
|
65
|
+
};
|
|
66
|
+
return IdTokenEntity;
|
|
67
|
+
}(CredentialEntity));
|
|
68
|
+
|
|
69
|
+
export { IdTokenEntity };
|
|
70
|
+
//# sourceMappingURL=IdTokenEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdTokenEntity.js","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * ID_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * realm: Full tenant or organizational identifier that the account belongs to\n * }\n */\nexport class IdTokenEntity extends CredentialEntity {\n realm: string;\n\n /**\n * Create IdTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createIdTokenEntity(\n homeAccountId: string,\n environment: string,\n idToken: string,\n clientId: string,\n tenantId: string,\n ): IdTokenEntity {\n const idTokenEntity = new IdTokenEntity();\n\n idTokenEntity.credentialType = CredentialType.ID_TOKEN;\n idTokenEntity.homeAccountId = homeAccountId;\n idTokenEntity.environment = environment;\n idTokenEntity.clientId = clientId;\n idTokenEntity.secret = idToken;\n idTokenEntity.realm = tenantId;\n\n return idTokenEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isIdTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.ID_TOKEN\n );\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAKH;;;;;;;;;;;;;;;;AAgBG;AACH,IAAA,aAAA,kBAAA,UAAA,MAAA,EAAA;IAAmC,SAAgB,CAAA,aAAA,EAAA,MAAA,CAAA,CAAA;AAAnD,IAAA,SAAA,aAAA,GAAA;;KAiDC;AA9CG;;;;;;AAMG;IACI,aAAmB,CAAA,mBAAA,GAA1B,UACI,aAAqB,EACrB,WAAmB,EACnB,OAAe,EACf,QAAgB,EAChB,QAAgB,EAAA;AAEhB,QAAA,IAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AAE1C,QAAA,aAAa,CAAC,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC;AACvD,QAAA,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC;AAC5C,QAAA,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;AACxC,QAAA,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAClC,QAAA,aAAa,CAAC,MAAM,GAAG,OAAO,CAAC;AAC/B,QAAA,aAAa,CAAC,KAAK,GAAG,QAAQ,CAAC;AAE/B,QAAA,OAAO,aAAa,CAAC;KACxB,CAAA;AAED;;;AAGG;IACI,aAAe,CAAA,eAAA,GAAtB,UAAuB,MAAc,EAAA;QAEjC,IAAI,CAAC,MAAM,EAAE;AACT,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;AAED,QAAA,QACI,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;AACtC,YAAA,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC;AACpC,YAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;AACvC,YAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC;AAC9B,YAAA,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;AACjC,YAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,QAAQ,EACtD;KACL,CAAA;IACL,OAAC,aAAA,CAAA;AAAD,CAjDA,CAAmC,gBAAgB,CAiDlD;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CredentialEntity } from "./CredentialEntity";
|
|
2
|
+
/**
|
|
3
|
+
* REFRESH_TOKEN Cache
|
|
4
|
+
*
|
|
5
|
+
* Key:Value Schema:
|
|
6
|
+
*
|
|
7
|
+
* Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--
|
|
8
|
+
*
|
|
9
|
+
* Value:
|
|
10
|
+
* {
|
|
11
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
12
|
+
* environment: entity that issued the token, represented as a full host
|
|
13
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
14
|
+
* clientId: client ID of the application
|
|
15
|
+
* secret: Actual credential as a string
|
|
16
|
+
* familyId: Family ID identifier, '1' represents Microsoft Family
|
|
17
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
18
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export declare class RefreshTokenEntity extends CredentialEntity {
|
|
22
|
+
familyId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Create RefreshTokenEntity
|
|
25
|
+
* @param homeAccountId
|
|
26
|
+
* @param authenticationResult
|
|
27
|
+
* @param clientId
|
|
28
|
+
* @param authority
|
|
29
|
+
*/
|
|
30
|
+
static createRefreshTokenEntity(homeAccountId: string, environment: string, refreshToken: string, clientId: string, familyId?: string, userAssertionHash?: string): RefreshTokenEntity;
|
|
31
|
+
/**
|
|
32
|
+
* Validates an entity: checks for all expected params
|
|
33
|
+
* @param entity
|
|
34
|
+
*/
|
|
35
|
+
static isRefreshTokenEntity(entity: object): boolean;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=RefreshTokenEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshTokenEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/RefreshTokenEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,kBAAmB,SAAQ,gBAAgB;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,MAAM,CAAC,wBAAwB,CAC3B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,iBAAiB,CAAC,EAAE,MAAM,GAC3B,kBAAkB;IAgBrB;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;CAevD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*! @azure/msal-common v0.0.1-alpha.0 2022-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { __extends } from '../../_virtual/_tslib.js';
|
|
4
|
+
import { CredentialEntity } from './CredentialEntity.js';
|
|
5
|
+
import { CredentialType } from '../../utils/Constants.js';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* REFRESH_TOKEN Cache
|
|
13
|
+
*
|
|
14
|
+
* Key:Value Schema:
|
|
15
|
+
*
|
|
16
|
+
* Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--
|
|
17
|
+
*
|
|
18
|
+
* Value:
|
|
19
|
+
* {
|
|
20
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
21
|
+
* environment: entity that issued the token, represented as a full host
|
|
22
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
23
|
+
* clientId: client ID of the application
|
|
24
|
+
* secret: Actual credential as a string
|
|
25
|
+
* familyId: Family ID identifier, '1' represents Microsoft Family
|
|
26
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
27
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
var RefreshTokenEntity = /** @class */ (function (_super) {
|
|
31
|
+
__extends(RefreshTokenEntity, _super);
|
|
32
|
+
function RefreshTokenEntity() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create RefreshTokenEntity
|
|
37
|
+
* @param homeAccountId
|
|
38
|
+
* @param authenticationResult
|
|
39
|
+
* @param clientId
|
|
40
|
+
* @param authority
|
|
41
|
+
*/
|
|
42
|
+
RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash) {
|
|
43
|
+
var rtEntity = new RefreshTokenEntity();
|
|
44
|
+
rtEntity.clientId = clientId;
|
|
45
|
+
rtEntity.credentialType = CredentialType.REFRESH_TOKEN;
|
|
46
|
+
rtEntity.environment = environment;
|
|
47
|
+
rtEntity.homeAccountId = homeAccountId;
|
|
48
|
+
rtEntity.secret = refreshToken;
|
|
49
|
+
rtEntity.userAssertionHash = userAssertionHash;
|
|
50
|
+
if (familyId)
|
|
51
|
+
rtEntity.familyId = familyId;
|
|
52
|
+
return rtEntity;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Validates an entity: checks for all expected params
|
|
56
|
+
* @param entity
|
|
57
|
+
*/
|
|
58
|
+
RefreshTokenEntity.isRefreshTokenEntity = function (entity) {
|
|
59
|
+
if (!entity) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return (entity.hasOwnProperty("homeAccountId") &&
|
|
63
|
+
entity.hasOwnProperty("environment") &&
|
|
64
|
+
entity.hasOwnProperty("credentialType") &&
|
|
65
|
+
entity.hasOwnProperty("clientId") &&
|
|
66
|
+
entity.hasOwnProperty("secret") &&
|
|
67
|
+
entity["credentialType"] === CredentialType.REFRESH_TOKEN);
|
|
68
|
+
};
|
|
69
|
+
return RefreshTokenEntity;
|
|
70
|
+
}(CredentialEntity));
|
|
71
|
+
|
|
72
|
+
export { RefreshTokenEntity };
|
|
73
|
+
//# sourceMappingURL=RefreshTokenEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshTokenEntity.js","sources":["../../../src/cache/entities/RefreshTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * REFRESH_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--\n *\n * Value:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, '1' represents Microsoft Family\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * }\n */\nexport class RefreshTokenEntity extends CredentialEntity {\n familyId?: string;\n\n /**\n * Create RefreshTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createRefreshTokenEntity(\n homeAccountId: string,\n environment: string,\n refreshToken: string,\n clientId: string,\n familyId?: string,\n userAssertionHash?: string\n ): RefreshTokenEntity {\n const rtEntity = new RefreshTokenEntity();\n\n rtEntity.clientId = clientId;\n rtEntity.credentialType = CredentialType.REFRESH_TOKEN;\n rtEntity.environment = environment;\n rtEntity.homeAccountId = homeAccountId;\n rtEntity.secret = refreshToken;\n rtEntity.userAssertionHash = userAssertionHash;\n\n if (familyId)\n rtEntity.familyId = familyId;\n\n return rtEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isRefreshTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.REFRESH_TOKEN\n );\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAKH;;;;;;;;;;;;;;;;;;AAkBG;AACH,IAAA,kBAAA,kBAAA,UAAA,MAAA,EAAA;IAAwC,SAAgB,CAAA,kBAAA,EAAA,MAAA,CAAA,CAAA;AAAxD,IAAA,SAAA,kBAAA,GAAA;;KAoDC;AAjDG;;;;;;AAMG;AACI,IAAA,kBAAA,CAAA,wBAAwB,GAA/B,UACI,aAAqB,EACrB,WAAmB,EACnB,YAAoB,EACpB,QAAgB,EAChB,QAAiB,EACjB,iBAA0B,EAAA;AAE1B,QAAA,IAAM,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAE1C,QAAA,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAA,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC;AACvD,QAAA,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;AACnC,QAAA,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;AACvC,QAAA,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC;AAC/B,QAAA,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAE/C,QAAA,IAAI,QAAQ;AACR,YAAA,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAEjC,QAAA,OAAO,QAAQ,CAAC;KACnB,CAAA;AAED;;;AAGG;IACI,kBAAoB,CAAA,oBAAA,GAA3B,UAA4B,MAAc,EAAA;QAEtC,IAAI,CAAC,MAAM,EAAE;AACT,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;AAED,QAAA,QACI,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;AACtC,YAAA,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC;AACpC,YAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;AACvC,YAAA,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;AACjC,YAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,aAAa,EAC3D;KACL,CAAA;IACL,OAAC,kBAAA,CAAA;AAAD,CApDA,CAAwC,gBAAgB,CAoDvD;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class ServerTelemetryEntity {
|
|
2
|
+
failedRequests: Array<string | number>;
|
|
3
|
+
errors: string[];
|
|
4
|
+
cacheHits: number;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* validates if a given cache entry is "Telemetry", parses <key,value>
|
|
8
|
+
* @param key
|
|
9
|
+
* @param entity
|
|
10
|
+
*/
|
|
11
|
+
static isServerTelemetryEntity(key: string, entity?: object): boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ServerTelemetryEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerTelemetryEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/ServerTelemetryEntity.ts"],"names":[],"mappings":"AAOA,qBAAa,qBAAqB;IAC9B,cAAc,EAAE,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;;IAQlB;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO;CAcxE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*! @azure/msal-common v0.0.1-alpha.0 2022-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { SERVER_TELEM_CONSTANTS } from '../../utils/Constants.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
var ServerTelemetryEntity = /** @class */ (function () {
|
|
10
|
+
function ServerTelemetryEntity() {
|
|
11
|
+
this.failedRequests = [];
|
|
12
|
+
this.errors = [];
|
|
13
|
+
this.cacheHits = 0;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* validates if a given cache entry is "Telemetry", parses <key,value>
|
|
17
|
+
* @param key
|
|
18
|
+
* @param entity
|
|
19
|
+
*/
|
|
20
|
+
ServerTelemetryEntity.isServerTelemetryEntity = function (key, entity) {
|
|
21
|
+
var validateKey = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;
|
|
22
|
+
var validateEntity = true;
|
|
23
|
+
if (entity) {
|
|
24
|
+
validateEntity =
|
|
25
|
+
entity.hasOwnProperty("failedRequests") &&
|
|
26
|
+
entity.hasOwnProperty("errors") &&
|
|
27
|
+
entity.hasOwnProperty("cacheHits");
|
|
28
|
+
}
|
|
29
|
+
return validateKey && validateEntity;
|
|
30
|
+
};
|
|
31
|
+
return ServerTelemetryEntity;
|
|
32
|
+
}());
|
|
33
|
+
|
|
34
|
+
export { ServerTelemetryEntity };
|
|
35
|
+
//# sourceMappingURL=ServerTelemetryEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerTelemetryEntity.js","sources":["../../../src/cache/entities/ServerTelemetryEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SERVER_TELEM_CONSTANTS } from \"../../utils/Constants\";\n\nexport class ServerTelemetryEntity {\n failedRequests: Array<string|number>;\n errors: string[];\n cacheHits: number;\n\n constructor() {\n this.failedRequests = [];\n this.errors = [];\n this.cacheHits = 0;\n }\n\n /**\n * validates if a given cache entry is \"Telemetry\", parses <key,value>\n * @param key\n * @param entity\n */\n static isServerTelemetryEntity(key: string, entity?: object): boolean {\n\n const validateKey: boolean = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\n let validateEntity: boolean = true;\n\n if (entity) {\n validateEntity =\n entity.hasOwnProperty(\"failedRequests\") &&\n entity.hasOwnProperty(\"errors\") &&\n entity.hasOwnProperty(\"cacheHits\");\n }\n\n return validateKey && validateEntity;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH,IAAA,qBAAA,kBAAA,YAAA;AAKI,IAAA,SAAA,qBAAA,GAAA;AACI,QAAA,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;AACzB,QAAA,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACjB,QAAA,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;KACtB;AAED;;;;AAIG;AACI,IAAA,qBAAA,CAAA,uBAAuB,GAA9B,UAA+B,GAAW,EAAE,MAAe,EAAA;AAEvD,QAAA,IAAM,WAAW,GAAY,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjF,IAAI,cAAc,GAAY,IAAI,CAAC;AAEnC,QAAA,IAAI,MAAM,EAAE;YACR,cAAc;AACV,gBAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;AACvC,oBAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;AAC/B,oBAAA,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAC1C,SAAA;QAED,OAAO,WAAW,IAAI,cAAc,CAAC;KACxC,CAAA;IACL,OAAC,qBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class ThrottlingEntity {
|
|
2
|
+
throttleTime: number;
|
|
3
|
+
error?: string;
|
|
4
|
+
errorCodes?: Array<string>;
|
|
5
|
+
errorMessage?: string;
|
|
6
|
+
subError?: string;
|
|
7
|
+
/**
|
|
8
|
+
* validates if a given cache entry is "Throttling", parses <key,value>
|
|
9
|
+
* @param key
|
|
10
|
+
* @param entity
|
|
11
|
+
*/
|
|
12
|
+
static isThrottlingEntity(key: string, entity?: object): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ThrottlingEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThrottlingEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/ThrottlingEntity.ts"],"names":[],"mappings":"AAOA,qBAAa,gBAAgB;IAEzB,YAAY,EAAE,MAAM,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO;CAcnE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! @azure/msal-common v0.0.1-alpha.0 2022-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { ThrottlingConstants } from '../../utils/Constants.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
var ThrottlingEntity = /** @class */ (function () {
|
|
10
|
+
function ThrottlingEntity() {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* validates if a given cache entry is "Throttling", parses <key,value>
|
|
14
|
+
* @param key
|
|
15
|
+
* @param entity
|
|
16
|
+
*/
|
|
17
|
+
ThrottlingEntity.isThrottlingEntity = function (key, entity) {
|
|
18
|
+
var validateKey = false;
|
|
19
|
+
if (key) {
|
|
20
|
+
validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;
|
|
21
|
+
}
|
|
22
|
+
var validateEntity = true;
|
|
23
|
+
if (entity) {
|
|
24
|
+
validateEntity = entity.hasOwnProperty("throttleTime");
|
|
25
|
+
}
|
|
26
|
+
return validateKey && validateEntity;
|
|
27
|
+
};
|
|
28
|
+
return ThrottlingEntity;
|
|
29
|
+
}());
|
|
30
|
+
|
|
31
|
+
export { ThrottlingEntity };
|
|
32
|
+
//# sourceMappingURL=ThrottlingEntity.js.map
|