diff --git a/src/Microsoft.IdentityModel.Tokens/Delegates.cs b/src/Microsoft.IdentityModel.Tokens/Delegates.cs index e3842a9fa3..6977faf180 100644 --- a/src/Microsoft.IdentityModel.Tokens/Delegates.cs +++ b/src/Microsoft.IdentityModel.Tokens/Delegates.cs @@ -204,7 +204,7 @@ namespace Microsoft.IdentityModel.Tokens /// The to be used for logging. /// This method is not expected to throw. /// The validated . - internal delegate ValidationResult SignatureValidatorDelegate(SecurityToken token, ValidationParameters validationParameters, BaseConfiguration? configuration, CallContext? callContext); + internal delegate ValidationResult SignatureValidationDelegate(SecurityToken token, ValidationParameters validationParameters, BaseConfiguration? configuration, CallContext? callContext); /// /// Transforms the security token before signature validation. diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs b/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs index 048a371776..96bd08d62d 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs @@ -25,14 +25,14 @@ internal class ValidationParameters private IList _validTokenTypes; private IList _validAudiences; - private AlgorithmValidatorDelegate _algorithmValidator = Validators.ValidateAlgorithm; - private AudienceValidatorDelegate _audienceValidator = Validators.ValidateAudience; + private AlgorithmValidationDelegate _algorithmValidator = Validators.ValidateAlgorithm; + private AudienceValidationDelegate _audienceValidator = Validators.ValidateAudience; private IssuerValidationDelegateAsync _issuerValidatorAsync = Validators.ValidateIssuerAsync; - private LifetimeValidatorDelegate _lifetimeValidator = Validators.ValidateLifetime; - private SignatureValidatorDelegate _signatureValidator; - private TokenReplayValidatorDelegate _tokenReplayValidator = Validators.ValidateTokenReplay; - private TypeValidatorDelegate _typeValidator = Validators.ValidateTokenType; - private IssuerSigningKeyValidatorDelegate _issuerSigningKeyValidator = Validators.ValidateIssuerSigningKey; + private LifetimeValidationDelegate _lifetimeValidator = Validators.ValidateLifetime; + private SignatureValidationDelegate _signatureValidator; + private TokenReplayValidationDelegate _tokenReplayValidator = Validators.ValidateTokenReplay; + private TokenTypeValidationDelegate _tokenTypeValidator = Validators.ValidateTokenType; + private IssuerSigningKeyValidationDelegate _issuerSigningKeyValidator = Validators.ValidateIssuerSigningKey; /// /// This is the default value of when creating a . @@ -121,7 +121,7 @@ public ValidationParameters() /// If no delegate is set, the default implementation will be used. The default checks the algorithm /// against the property, if present. If not, it will succeed. /// - public AlgorithmValidatorDelegate AlgorithmValidator + public AlgorithmValidationDelegate AlgorithmValidator { get { return _algorithmValidator; } set { _algorithmValidator = value ?? throw new ArgumentNullException(nameof(value), "AlgorithmValidator cannot be null."); } @@ -135,8 +135,8 @@ public AlgorithmValidatorDelegate AlgorithmValidator /// This means that no default 'audience' validation will occur. /// /// Thrown when the value is set as null. - /// The used to validate the issuer of a token - public AudienceValidatorDelegate AudienceValidator + /// The used to validate the issuer of a token + public AudienceValidationDelegate AudienceValidator { get { return _audienceValidator; } set { _audienceValidator = value ?? throw new ArgumentNullException(nameof(value), "AudienceValidator cannot be set as null."); } @@ -273,7 +273,7 @@ public virtual ClaimsIdentity CreateClaimsIdentity(SecurityToken securityToken, /// If both and are set, IssuerSigningKeyResolverUsingConfiguration takes /// priority. /// - public IssuerSigningKeyValidatorDelegate IssuerSigningKeyValidator + public IssuerSigningKeyValidationDelegate IssuerSigningKeyValidator { get => _issuerSigningKeyValidator; set => _issuerSigningKeyValidator = value ?? throw new ArgumentNullException(nameof(value), "IssuerSigningKeyValidator cannot be set as null."); @@ -328,8 +328,8 @@ public IssuerValidationDelegateAsync IssuerValidatorAsync /// Allows overriding the delegate that will be used to validate the lifetime of the token /// /// Thrown when the value is set as null. - /// The used to validate the lifetime of a token - public LifetimeValidatorDelegate LifetimeValidator + /// The used to validate the lifetime of a token + public LifetimeValidationDelegate LifetimeValidator { get { return _lifetimeValidator; } set { _lifetimeValidator = value ?? throw new ArgumentNullException(nameof(value), "LifetimeValidator cannot be set as null."); } @@ -441,7 +441,7 @@ public string RoleClaimType /// /// If set, this delegate will be called to validate the signature of the token, instead of default processing. /// - public SignatureValidatorDelegate SignatureValidator + public SignatureValidationDelegate SignatureValidator { get { return _signatureValidator; } set { _signatureValidator = value; } @@ -479,8 +479,8 @@ public SignatureValidatorDelegate SignatureValidator /// This means no default token replay validation will occur. /// /// Thrown when the value is set as null. - /// The used to validate the token replay of the token. - public TokenReplayValidatorDelegate TokenReplayValidator + /// The used to validate the token replay of the token. + public TokenReplayValidationDelegate TokenReplayValidator { get { return _tokenReplayValidator; } set { _tokenReplayValidator = value ?? throw new ArgumentNullException(nameof(value), "TokenReplayValidator cannot be set as null."); } @@ -504,11 +504,11 @@ public TokenReplayValidatorDelegate TokenReplayValidator /// against the property, if the type is present then, it will succeed. /// /// Thrown when the value is set as null. - /// The used to validate the token type of a token - public TypeValidatorDelegate TypeValidator + /// The used to validate the token type of a token + public TokenTypeValidationDelegate TypeValidator { - get { return _typeValidator; } - set { _typeValidator = value ?? throw new ArgumentNullException(nameof(value), "TypeValidator cannot be set as null."); } + get { return _tokenTypeValidator; } + set { _tokenTypeValidator = value ?? throw new ArgumentNullException(nameof(value), "TypeValidator cannot be set as null."); } } /// diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs index 9505b52bc1..f21f7e237d 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs @@ -19,7 +19,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// A that contains the results of validating the algorithm. /// This delegate is not expected to throw. - internal delegate ValidationResult AlgorithmValidatorDelegate( + internal delegate ValidationResult AlgorithmValidationDelegate( string algorithm, SecurityKey securityKey, SecurityToken securityToken, diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs index 34ac915730..01d0e25934 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs @@ -19,7 +19,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// A that contains the results of validating the issuer. /// This delegate is not expected to throw. - internal delegate ValidationResult AudienceValidatorDelegate( + internal delegate ValidationResult AudienceValidationDelegate( IList audiences, SecurityToken? securityToken, ValidationParameters validationParameters, diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.IssuerSigningKey.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.IssuerSigningKey.cs index 3ccc81b6d8..3e27f653e4 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.IssuerSigningKey.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.IssuerSigningKey.cs @@ -21,7 +21,7 @@ internal record struct ValidatedSigningKeyLifetime(DateTime? ValidFrom, DateTime /// The to be used for logging. /// A that contains the results of validating the issuer. /// This delegate is not expected to throw. - internal delegate ValidationResult IssuerSigningKeyValidatorDelegate( + internal delegate ValidationResult IssuerSigningKeyValidationDelegate( SecurityKey signingKey, SecurityToken securityToken, ValidationParameters validationParameters, diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Lifetime.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Lifetime.cs index ce1461bf8c..548e0fbb2a 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Lifetime.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Lifetime.cs @@ -20,7 +20,7 @@ internal record struct ValidatedLifetime(DateTime? NotBefore, DateTime? Expires) /// /// A that contains the results of validating the issuer. /// This delegate is not expected to throw. - internal delegate ValidationResult LifetimeValidatorDelegate( + internal delegate ValidationResult LifetimeValidationDelegate( DateTime? notBefore, DateTime? expires, SecurityToken? securityToken, diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenReplay.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenReplay.cs index 5751caa967..28d3a387c2 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenReplay.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenReplay.cs @@ -16,7 +16,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// A that contains the results of validating the token. /// This delegate is not expected to throw. - internal delegate ValidationResult TokenReplayValidatorDelegate( + internal delegate ValidationResult TokenReplayValidationDelegate( DateTime? expirationTime, string securityToken, ValidationParameters validationParameters, diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenType.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenType.cs index 90feebb66f..096ca3c447 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenType.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenType.cs @@ -19,7 +19,7 @@ internal record struct ValidatedTokenType(string Type, int ValidTypeCount); /// /// A that contains the results of validating the token type. /// An EXACT match is required. (case sensitive) is used for comparing against . - internal delegate ValidationResult TypeValidatorDelegate( + internal delegate ValidationResult TokenTypeValidationDelegate( string? type, SecurityToken? securityToken, ValidationParameters validationParameters,