Skip to content

Commit b77fac5

Browse files
authored
Remove unused RequestValidator class (#7892)
Removes unused `RequestValidator` class
1 parent 648a76f commit b77fac5

File tree

7 files changed

+15
-208
lines changed

7 files changed

+15
-208
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Remove RequestValidator class",
4+
"packageName": "@azure/msal-common",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

lib/msal-common/apiReview/msal-common.api.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,6 @@ declare namespace ClientConfigurationErrorCodes {
16621662
urlParseError,
16631663
urlEmptyError,
16641664
emptyInputScopesError,
1665-
invalidPromptValue,
16661665
invalidClaims,
16671666
tokenRequestEmpty,
16681667
logoutRequestEmpty,
@@ -1710,10 +1709,6 @@ export const ClientConfigurationErrorMessage: {
17101709
code: string;
17111710
desc: string;
17121711
};
1713-
invalidPrompt: {
1714-
code: string;
1715-
desc: string;
1716-
};
17171712
invalidClaimsRequest: {
17181713
code: string;
17191714
desc: string;
@@ -2693,11 +2688,6 @@ const invalidCloudDiscoveryMetadata = "invalid_cloud_discovery_metadata";
26932688
// @public (undocumented)
26942689
const invalidCodeChallengeMethod = "invalid_code_challenge_method";
26952690

2696-
// Warning: (ae-missing-release-tag) "invalidPromptValue" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
2697-
//
2698-
// @public (undocumented)
2699-
const invalidPromptValue = "invalid_prompt_value";
2700-
27012691
// Warning: (ae-missing-release-tag) "invalidState" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
27022692
//
27032693
// @public (undocumented)
@@ -4636,10 +4626,10 @@ const X_MS_LIB_CAPABILITY = "x-ms-lib-capability";
46364626
// src/cache/CacheManager.ts:1862:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
46374627
// src/cache/utils/CacheTypes.ts:94:53 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
46384628
// src/cache/utils/CacheTypes.ts:94:43 - (tsdoc-malformed-html-name) Invalid HTML element: An HTML name must be an ASCII letter followed by zero or more letters, digits, or hyphens
4629+
// src/client/AuthorizationCodeClient.ts:157:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
46394630
// src/client/AuthorizationCodeClient.ts:158:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4640-
// src/client/AuthorizationCodeClient.ts:159:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4641-
// src/client/AuthorizationCodeClient.ts:228:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4642-
// src/client/AuthorizationCodeClient.ts:460:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4631+
// src/client/AuthorizationCodeClient.ts:227:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
4632+
// src/client/AuthorizationCodeClient.ts:463:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
46434633
// src/client/RefreshTokenClient.ts:194:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
46444634
// src/client/RefreshTokenClient.ts:290:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
46454635
// src/client/RefreshTokenClient.ts:291:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen

lib/msal-common/src/client/AuthorizationCodeClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
createClientConfigurationError,
4343
ClientConfigurationErrorCodes,
4444
} from "../error/ClientConfigurationError.js";
45-
import { RequestValidator } from "../request/RequestValidator.js";
4645
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
4746
import { PerformanceEvents } from "../telemetry/performance/PerformanceEvent.js";
4847
import { invokeAsync } from "../utils/FunctionWrappers.js";
@@ -250,7 +249,11 @@ export class AuthorizationCodeClient extends BaseClient {
250249
*/
251250
if (!this.includeRedirectUri) {
252251
// Just validate
253-
RequestValidator.validateRedirectUri(request.redirectUri);
252+
if (!request.redirectUri) {
253+
throw createClientConfigurationError(
254+
ClientConfigurationErrorCodes.redirectUriEmpty
255+
);
256+
}
254257
} else {
255258
// Validate and include redirect uri
256259
RequestParameterBuilder.addRedirectUri(

lib/msal-common/src/error/ClientConfigurationError.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export const ClientConfigurationErrorMessages = {
1919
[ClientConfigurationErrorCodes.urlEmptyError]: "URL was empty or null.",
2020
[ClientConfigurationErrorCodes.emptyInputScopesError]:
2121
"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",
22-
[ClientConfigurationErrorCodes.invalidPromptValue]:
23-
"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",
2422
[ClientConfigurationErrorCodes.invalidClaims]:
2523
"Given claims parameter must be a stringified JSON object.",
2624
[ClientConfigurationErrorCodes.tokenRequestEmpty]:
@@ -94,12 +92,6 @@ export const ClientConfigurationErrorMessage = {
9492
ClientConfigurationErrorCodes.emptyInputScopesError
9593
],
9694
},
97-
invalidPrompt: {
98-
code: ClientConfigurationErrorCodes.invalidPromptValue,
99-
desc: ClientConfigurationErrorMessages[
100-
ClientConfigurationErrorCodes.invalidPromptValue
101-
],
102-
},
10395
invalidClaimsRequest: {
10496
code: ClientConfigurationErrorCodes.invalidClaims,
10597
desc: ClientConfigurationErrorMessages[

lib/msal-common/src/error/ClientConfigurationErrorCodes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export const authorityUriInsecure = "authority_uri_insecure";
99
export const urlParseError = "url_parse_error";
1010
export const urlEmptyError = "empty_url_error";
1111
export const emptyInputScopesError = "empty_input_scopes_error";
12-
export const invalidPromptValue = "invalid_prompt_value";
1312
export const invalidClaims = "invalid_claims";
1413
export const tokenRequestEmpty = "token_request_empty";
1514
export const logoutRequestEmpty = "logout_request_empty";

lib/msal-common/src/request/RequestValidator.ts

Lines changed: 0 additions & 90 deletions
This file was deleted.

lib/msal-common/test/request/RequestValidator.spec.ts

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)