@azure/msal-common 15.8.0 → 15.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.mjs +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/cache/CacheManager.mjs +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +5 -4
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.mjs +1 -1
- package/dist/client/RefreshTokenClient.mjs +1 -1
- package/dist/client/SilentFlowClient.mjs +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.mjs +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.d.ts +0 -5
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +2 -7
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +2 -3
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index-browser.mjs +1 -1
- package/dist/index-node.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/RequestThumbprint.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/lib/index-browser.cjs +2 -2
- package/lib/{index-node-2PsHlOld.js → index-node-BCM1mkg5.js} +6 -76
- package/lib/index-node-BCM1mkg5.js.map +1 -0
- package/lib/index-node.cjs +2 -2
- package/lib/index.cjs +2 -2
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationError.d.ts +0 -5
- package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/package.json +1 -1
- package/src/client/AuthorizationCodeClient.ts +5 -2
- package/src/error/ClientConfigurationError.ts +0 -8
- package/src/error/ClientConfigurationErrorCodes.ts +0 -1
- package/src/packageMetadata.ts +1 -1
- package/dist/request/RequestValidator.d.ts +0 -28
- package/dist/request/RequestValidator.d.ts.map +0 -1
- package/dist/request/RequestValidator.mjs +0 -73
- package/dist/request/RequestValidator.mjs.map +0 -1
- package/lib/index-node-2PsHlOld.js.map +0 -1
- package/lib/types/request/RequestValidator.d.ts +0 -28
- package/lib/types/request/RequestValidator.d.ts.map +0 -1
- package/src/request/RequestValidator.ts +0 -90
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
createClientConfigurationError,
|
|
8
|
-
ClientConfigurationErrorCodes,
|
|
9
|
-
} from "../error/ClientConfigurationError.js";
|
|
10
|
-
import { PromptValue, CodeChallengeMethodValues } from "../utils/Constants.js";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Validates server consumable params from the "request" objects
|
|
14
|
-
*/
|
|
15
|
-
export class RequestValidator {
|
|
16
|
-
/**
|
|
17
|
-
* Utility to check if the `redirectUri` in the request is a non-null value
|
|
18
|
-
* @param redirectUri
|
|
19
|
-
*/
|
|
20
|
-
static validateRedirectUri(redirectUri: string): void {
|
|
21
|
-
if (!redirectUri) {
|
|
22
|
-
throw createClientConfigurationError(
|
|
23
|
-
ClientConfigurationErrorCodes.redirectUriEmpty
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Utility to validate prompt sent by the user in the request
|
|
30
|
-
* @param prompt
|
|
31
|
-
*/
|
|
32
|
-
static validatePrompt(prompt: string): void {
|
|
33
|
-
const promptValues = [];
|
|
34
|
-
|
|
35
|
-
for (const value in PromptValue) {
|
|
36
|
-
promptValues.push(PromptValue[value]);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (promptValues.indexOf(prompt) < 0) {
|
|
40
|
-
throw createClientConfigurationError(
|
|
41
|
-
ClientConfigurationErrorCodes.invalidPromptValue
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static validateClaims(claims: string): void {
|
|
47
|
-
try {
|
|
48
|
-
JSON.parse(claims);
|
|
49
|
-
} catch (e) {
|
|
50
|
-
throw createClientConfigurationError(
|
|
51
|
-
ClientConfigurationErrorCodes.invalidClaims
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Utility to validate code_challenge and code_challenge_method
|
|
58
|
-
* @param codeChallenge
|
|
59
|
-
* @param codeChallengeMethod
|
|
60
|
-
*/
|
|
61
|
-
static validateCodeChallengeParams(
|
|
62
|
-
codeChallenge: string,
|
|
63
|
-
codeChallengeMethod: string
|
|
64
|
-
): void {
|
|
65
|
-
if (!codeChallenge || !codeChallengeMethod) {
|
|
66
|
-
throw createClientConfigurationError(
|
|
67
|
-
ClientConfigurationErrorCodes.pkceParamsMissing
|
|
68
|
-
);
|
|
69
|
-
} else {
|
|
70
|
-
this.validateCodeChallengeMethod(codeChallengeMethod);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Utility to validate code_challenge_method
|
|
76
|
-
* @param codeChallengeMethod
|
|
77
|
-
*/
|
|
78
|
-
static validateCodeChallengeMethod(codeChallengeMethod: string): void {
|
|
79
|
-
if (
|
|
80
|
-
[
|
|
81
|
-
CodeChallengeMethodValues.PLAIN,
|
|
82
|
-
CodeChallengeMethodValues.S256,
|
|
83
|
-
].indexOf(codeChallengeMethod) < 0
|
|
84
|
-
) {
|
|
85
|
-
throw createClientConfigurationError(
|
|
86
|
-
ClientConfigurationErrorCodes.invalidCodeChallengeMethod
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|