Skip to content
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

Regression tests: Audience #2838

Merged
merged 15 commits into from
Oct 1, 2024
Merged

Regression tests: Audience #2838

merged 15 commits into from
Oct 1, 2024

Conversation

iNinja
Copy link
Contributor

@iNinja iNinja commented Sep 23, 2024

Regression tests: Audience

  • Extracted regression tests related to audience to a separate file.
  • Added extra scenarios for audience related validations.
  • Fixed audience validation unit tests and renamed variables to improve clarity.

Note: Upcoming PRs will continue to extract the different aspects of regression tests into separate files.

Part of #2711

@iNinja iNinja requested a review from a team as a code owner September 23, 2024 13:51
{
TokenValidationParameters = CreateTokenValidationParameters(null),
ValidationParameters = CreateValidationParameters(null),
Audience = string.Empty,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should this be a valid Audience while the Audiences property on TVP or VP is null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current validation path considers the case where no valid audiences are provided to be invalid and throws.
The new validation path took that as a base and kept the same behaviour.

If you believe that having no valid audiences should be considered the same as skipping the validation, we can look into it and find out what the correct behaviour would be.

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

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

can we open an issue to track the changes to the IDX??? values so we can revisit before releasing?
:shipit:

_invalidAudiences = invalidAudiences;
}

internal override void AddAdditionalInformation(ISecurityTokenException exception)
Copy link
Member

Choose a reason for hiding this comment

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

I suspect that since we are creating derived ValidationError types, we do not need the method AddAdditionalInformation or the interface ISecurityTokenException.

For example, when we create the AudienceValidationError, we call the ctor that takes the list of available audiences.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let’s keep the conversation going on that to find the best solution that can support any exception our users may decide to return.
I’d rather not expand the scope of this PR to that as it’s already a week in review.

@iNinja iNinja merged commit 8b4eea6 into dev Oct 1, 2024
6 checks passed
@iNinja iNinja self-assigned this Oct 22, 2024
@iNinja iNinja deleted the iinglese/regression-tests-audience branch November 15, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants