Skip to content

Remove unused RequestValidator class #7892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Remove RequestValidator class",
"packageName": "@azure/msal-common",
"email": "[email protected]",
"dependentChangeType": "patch"
}
16 changes: 3 additions & 13 deletions lib/msal-common/apiReview/msal-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,6 @@ declare namespace ClientConfigurationErrorCodes {
urlParseError,
urlEmptyError,
emptyInputScopesError,
invalidPromptValue,
invalidClaims,
tokenRequestEmpty,
logoutRequestEmpty,
Expand Down Expand Up @@ -1710,10 +1709,6 @@ export const ClientConfigurationErrorMessage: {
code: string;
desc: string;
};
invalidPrompt: {
code: string;
desc: string;
};
invalidClaimsRequest: {
code: string;
desc: string;
Expand Down Expand Up @@ -2693,11 +2688,6 @@ const invalidCloudDiscoveryMetadata = "invalid_cloud_discovery_metadata";
// @public (undocumented)
const invalidCodeChallengeMethod = "invalid_code_challenge_method";

// 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)
//
// @public (undocumented)
const invalidPromptValue = "invalid_prompt_value";

// 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)
//
// @public (undocumented)
Expand Down Expand Up @@ -4636,10 +4626,10 @@ const X_MS_LIB_CAPABILITY = "x-ms-lib-capability";
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
Expand Down
7 changes: 5 additions & 2 deletions lib/msal-common/src/client/AuthorizationCodeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import {
createClientConfigurationError,
ClientConfigurationErrorCodes,
} from "../error/ClientConfigurationError.js";
import { RequestValidator } from "../request/RequestValidator.js";
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
import { PerformanceEvents } from "../telemetry/performance/PerformanceEvent.js";
import { invokeAsync } from "../utils/FunctionWrappers.js";
Expand Down Expand Up @@ -250,7 +249,11 @@ export class AuthorizationCodeClient extends BaseClient {
*/
if (!this.includeRedirectUri) {
// Just validate
RequestValidator.validateRedirectUri(request.redirectUri);
if (!request.redirectUri) {
throw createClientConfigurationError(
ClientConfigurationErrorCodes.redirectUriEmpty
);
}
} else {
// Validate and include redirect uri
RequestParameterBuilder.addRedirectUri(
Expand Down
8 changes: 0 additions & 8 deletions lib/msal-common/src/error/ClientConfigurationError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const ClientConfigurationErrorMessages = {
[ClientConfigurationErrorCodes.urlEmptyError]: "URL was empty or null.",
[ClientConfigurationErrorCodes.emptyInputScopesError]:
"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",
[ClientConfigurationErrorCodes.invalidPromptValue]:
"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",
[ClientConfigurationErrorCodes.invalidClaims]:
"Given claims parameter must be a stringified JSON object.",
[ClientConfigurationErrorCodes.tokenRequestEmpty]:
Expand Down Expand Up @@ -94,12 +92,6 @@ export const ClientConfigurationErrorMessage = {
ClientConfigurationErrorCodes.emptyInputScopesError
],
},
invalidPrompt: {
code: ClientConfigurationErrorCodes.invalidPromptValue,
desc: ClientConfigurationErrorMessages[
ClientConfigurationErrorCodes.invalidPromptValue
],
},
invalidClaimsRequest: {
code: ClientConfigurationErrorCodes.invalidClaims,
desc: ClientConfigurationErrorMessages[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export const authorityUriInsecure = "authority_uri_insecure";
export const urlParseError = "url_parse_error";
export const urlEmptyError = "empty_url_error";
export const emptyInputScopesError = "empty_input_scopes_error";
export const invalidPromptValue = "invalid_prompt_value";
export const invalidClaims = "invalid_claims";
export const tokenRequestEmpty = "token_request_empty";
export const logoutRequestEmpty = "logout_request_empty";
Expand Down
90 changes: 0 additions & 90 deletions lib/msal-common/src/request/RequestValidator.ts

This file was deleted.

94 changes: 0 additions & 94 deletions lib/msal-common/test/request/RequestValidator.spec.ts

This file was deleted.