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

Conversation

tnorling
Copy link
Collaborator

@tnorling tnorling commented Jul 1, 2025

Removes unused RequestValidator class

@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 22:07
@github-actions github-actions bot added documentation Related to documentation. msal-common Related to msal-common package labels Jul 1, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the unused RequestValidator class and its tests, inlines redirect URI validation in AuthorizationCodeClient, and cleans up related error codes and API metadata.

  • Deletes RequestValidator and its spec file.
  • Inlines redirectUri validation in AuthorizationCodeClient.
  • Removes invalidPromptValue entries from error codes, messages, and API review.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/msal-common/test/request/RequestValidator.spec.ts Removed tests covering RequestValidator
lib/msal-common/src/request/RequestValidator.ts Deleted the entire RequestValidator implementation
lib/msal-common/src/error/ClientConfigurationErrorCodes.ts Removed invalidPromptValue constant
lib/msal-common/src/error/ClientConfigurationError.ts Removed messages related to invalidPromptValue
lib/msal-common/src/client/AuthorizationCodeClient.ts Inlined redirect URI validation, removed import
lib/msal-common/apiReview/msal-common.api.md Cleaned up API metadata for removed prompt error code
change/@azure-msal-common-76b2aadc-a06c-4ad6-b941-94031039267f.json Bump patch version and note removal of RequestValidator
Comments suppressed due to low confidence (2)

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

  • Add unit tests for this new inline redirect URI validation branch to verify that it throws the correct error (redirectUriEmpty) when request.redirectUri is missing.
            if (!request.redirectUri) {

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

  • The PR deletes the RequestValidator class but only inlines validateRedirectUri. The other validation methods (validatePrompt, validateClaims, validateCodeChallengeParams) have been removed without replacement—ensure any remaining callers are updated or migrate those validation checks.
            if (!request.redirectUri) {

@tnorling tnorling linked an issue Jul 1, 2025 that may be closed by this pull request
Copy link
Member

@sameerag sameerag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why we are not using them anymore? Approving, just curious. They look very superficial checks anyway not much value add.

@tnorling
Copy link
Collaborator Author

tnorling commented Jul 3, 2025

Do we know why we are not using them anymore? Approving, just curious. They look very superficial checks anyway not much value add.

Some of these checks are still being done, just not with these helpers. They got refactored out at some point

@tnorling tnorling enabled auto-merge (squash) July 3, 2025 18:24
@tnorling tnorling merged commit b77fac5 into dev Jul 3, 2025
8 checks passed
@tnorling tnorling deleted the remove-request-validator branch July 3, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-common Related to msal-common package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expanding or Disabling the Prompt Value Validation
3 participants