-
Notifications
You must be signed in to change notification settings - Fork 422
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
Introduce ConfigurationValidationException #2076
Conversation
@ciaozhang, consider creating a GitHub issue for this PR with a summary of the issue and why this change is needed. This will help with updating the release notes with relevant information. |
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/ConfigurationManagerTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use hard-coded "null", use Microsoft.IdentityModel.Tokens.Utility.Null instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why renaming this class? The original ConfigurationValidationException is thrown when a configuration fails to validate, which seems right to me.
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationInvalidException.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationInvalidException.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationInvalidException.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/ConfigurationManagerTests.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
{ | ||
theoryData.ExpectedException.ProcessException(ex, context); | ||
// this should throw, because last configuration retrieved was null | ||
Assert.Throws<AggregateException>(() => configuration = configurationManager.GetConfigurationAsync().Result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are throwing a new exception that does not derive from a previously thrown exception, we need to derive InvalidConfigurationException from the exception that was previously thrown.
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please either unify jitter or cut a PBI to unify jitter before checking in. We shouldn't proliferate different ways of doing this in our code without a plan to address.
Approving with the expectation you'll open an issue before merging. (same goes for pending error message marking as PII but that's probably easier to just fix).
ConfigurationManager won't cache configuration if config is invalid and ConfigurationValidationException