diff --git a/src/Microsoft.IdentityModel.JsonWebTokens/JsonWebTokenHandler.ValidateToken.Internal.cs b/src/Microsoft.IdentityModel.JsonWebTokens/JsonWebTokenHandler.ValidateToken.Internal.cs index 2fd9d160c2..0b5eb7f3c1 100644 --- a/src/Microsoft.IdentityModel.JsonWebTokens/JsonWebTokenHandler.ValidateToken.Internal.cs +++ b/src/Microsoft.IdentityModel.JsonWebTokens/JsonWebTokenHandler.ValidateToken.Internal.cs @@ -25,7 +25,7 @@ public partial class JsonWebTokenHandler : TokenHandler /// A that contains call information. /// A that can be used to request cancellation of the asynchronous operation. /// A with either a if the token was validated or an with the failure information and exception otherwise. - internal async Task> ValidateTokenAsync( + public async Task> ValidateTokenAsync( string token, ValidationParameters validationParameters, CallContext callContext, diff --git a/src/Microsoft.IdentityModel.Tokens/Delegates.cs b/src/Microsoft.IdentityModel.Tokens/Delegates.cs index 876d267345..338722ba6b 100644 --- a/src/Microsoft.IdentityModel.Tokens/Delegates.cs +++ b/src/Microsoft.IdentityModel.Tokens/Delegates.cs @@ -182,7 +182,7 @@ namespace Microsoft.IdentityModel.Tokens /// The used for logging. /// The used to validate the signature. /// If both and are set, takes priority. - internal delegate SecurityKey? IssuerSigningKeyResolverDelegate(string token, SecurityToken? securityToken, string? kid, ValidationParameters validationParameters, BaseConfiguration? configuration, CallContext? callContext); + public delegate SecurityKey? IssuerSigningKeyResolverDelegate(string token, SecurityToken? securityToken, string? kid, ValidationParameters validationParameters, BaseConfiguration? configuration, CallContext? callContext); /// /// Resolves the decryption key for the security token. @@ -193,7 +193,7 @@ namespace Microsoft.IdentityModel.Tokens /// The to be used for validating the token. /// The to be used for logging. /// The used to decrypt the token. - internal delegate IList DecryptionKeyResolverDelegate(string token, SecurityToken securityToken, string kid, ValidationParameters validationParameters, CallContext? callContext); + public delegate IList DecryptionKeyResolverDelegate(string token, SecurityToken securityToken, string kid, ValidationParameters validationParameters, CallContext? callContext); /// /// Validates the signature of the security token. @@ -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 SignatureValidationDelegate( + public delegate ValidationResult SignatureValidationDelegate( SecurityToken token, ValidationParameters validationParameters, BaseConfiguration? configuration, diff --git a/src/Microsoft.IdentityModel.Tokens/PublicAPI.Unshipped.txt b/src/Microsoft.IdentityModel.Tokens/PublicAPI.Unshipped.txt index d2c20a77d4..12506e33b9 100644 --- a/src/Microsoft.IdentityModel.Tokens/PublicAPI.Unshipped.txt +++ b/src/Microsoft.IdentityModel.Tokens/PublicAPI.Unshipped.txt @@ -1,2 +1,207 @@ +#nullable enable +const Microsoft.IdentityModel.Tokens.ValidationParameters.DefaultAuthenticationType = "AuthenticationTypes.Federation" -> string! +const Microsoft.IdentityModel.Tokens.ValidationParameters.DefaultMaximumTokenSizeInBytes = 256000 -> int +Microsoft.IdentityModel.Tokens.AlgorithmValidationDelegate +Microsoft.IdentityModel.Tokens.AudienceValidationDelegate +Microsoft.IdentityModel.Tokens.DecryptionKeyResolverDelegate +Microsoft.IdentityModel.Tokens.IssuerSigningKeyResolverDelegate +Microsoft.IdentityModel.Tokens.IssuerSigningKeyValidationDelegate +Microsoft.IdentityModel.Tokens.IssuerValidationDelegateAsync +Microsoft.IdentityModel.Tokens.IssuerValidationSource +Microsoft.IdentityModel.Tokens.IssuerValidationSource.IssuerValidationSource(string! name) -> void +Microsoft.IdentityModel.Tokens.IssuerValidationSource.Name.get -> string! +Microsoft.IdentityModel.Tokens.LifetimeValidationDelegate +Microsoft.IdentityModel.Tokens.SignatureValidationDelegate +Microsoft.IdentityModel.Tokens.TokenReplayValidationDelegate +Microsoft.IdentityModel.Tokens.TokenTypeValidationDelegate Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor.IncludeKeyIdInHeader.get -> bool Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor.IncludeKeyIdInHeader.set -> void +Microsoft.IdentityModel.Tokens.ValidatedIssuer +Microsoft.IdentityModel.Tokens.ValidatedIssuer.Equals(Microsoft.IdentityModel.Tokens.ValidatedIssuer other) -> bool +Microsoft.IdentityModel.Tokens.ValidatedIssuer.Issuer.get -> string! +Microsoft.IdentityModel.Tokens.ValidatedIssuer.ValidatedIssuer() -> void +Microsoft.IdentityModel.Tokens.ValidatedIssuer.ValidatedIssuer(string! Issuer, Microsoft.IdentityModel.Tokens.IssuerValidationSource! ValidationSource) -> void +Microsoft.IdentityModel.Tokens.ValidatedIssuer.ValidationSource.get -> Microsoft.IdentityModel.Tokens.IssuerValidationSource! +Microsoft.IdentityModel.Tokens.ValidatedLifetime +Microsoft.IdentityModel.Tokens.ValidatedLifetime.Equals(Microsoft.IdentityModel.Tokens.ValidatedLifetime other) -> bool +Microsoft.IdentityModel.Tokens.ValidatedLifetime.Expires.get -> System.DateTime? +Microsoft.IdentityModel.Tokens.ValidatedLifetime.NotBefore.get -> System.DateTime? +Microsoft.IdentityModel.Tokens.ValidatedLifetime.ValidatedLifetime() -> void +Microsoft.IdentityModel.Tokens.ValidatedLifetime.ValidatedLifetime(System.DateTime? NotBefore, System.DateTime? Expires) -> void +Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime +Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.Equals(Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime other) -> bool +Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.ValidatedSigningKeyLifetime() -> void +Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.ValidationTime.get -> System.DateTime? +Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.ValidFrom.get -> System.DateTime? +Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.ValidTo.get -> System.DateTime? +Microsoft.IdentityModel.Tokens.ValidatedToken +Microsoft.IdentityModel.Tokens.ValidatedToken.ActorValidationResult.get -> Microsoft.IdentityModel.Tokens.ValidatedToken? +Microsoft.IdentityModel.Tokens.ValidatedToken.Claims.get -> System.Collections.Generic.IDictionary! +Microsoft.IdentityModel.Tokens.ValidatedToken.ClaimsIdentity.get -> System.Security.Claims.ClaimsIdentity! +Microsoft.IdentityModel.Tokens.ValidatedToken.ClaimsIdentity.set -> void +Microsoft.IdentityModel.Tokens.ValidatedToken.Log(Microsoft.Extensions.Logging.ILogger! logger) -> void +Microsoft.IdentityModel.Tokens.ValidatedToken.SecurityToken.get -> Microsoft.IdentityModel.Tokens.SecurityToken! +Microsoft.IdentityModel.Tokens.ValidatedToken.TokenHandler.get -> Microsoft.IdentityModel.Tokens.TokenHandler! +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedAudience.get -> string? +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedIssuer.get -> Microsoft.IdentityModel.Tokens.ValidatedIssuer? +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedLifetime.get -> Microsoft.IdentityModel.Tokens.ValidatedLifetime? +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedSigningKey.get -> Microsoft.IdentityModel.Tokens.SecurityKey? +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedSigningKeyLifetime.get -> Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime? +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedToken(Microsoft.IdentityModel.Tokens.SecurityToken! securityToken, Microsoft.IdentityModel.Tokens.TokenHandler! tokenHandler, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters) -> void +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedTokenReplayExpirationTime.get -> System.DateTime? +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidatedTokenType.get -> Microsoft.IdentityModel.Tokens.ValidatedTokenType? +Microsoft.IdentityModel.Tokens.ValidatedToken.ValidationParameters.get -> Microsoft.IdentityModel.Tokens.ValidationParameters! +Microsoft.IdentityModel.Tokens.ValidatedTokenType +Microsoft.IdentityModel.Tokens.ValidatedTokenType.Equals(Microsoft.IdentityModel.Tokens.ValidatedTokenType other) -> bool +Microsoft.IdentityModel.Tokens.ValidatedTokenType.Type.get -> string! +Microsoft.IdentityModel.Tokens.ValidatedTokenType.ValidatedTokenType() -> void +Microsoft.IdentityModel.Tokens.ValidatedTokenType.ValidatedTokenType(string! Type, int ValidTypeCount) -> void +Microsoft.IdentityModel.Tokens.ValidatedTokenType.ValidTypeCount.get -> int +Microsoft.IdentityModel.Tokens.ValidationError +Microsoft.IdentityModel.Tokens.ValidationError.AddStackFrame(System.Diagnostics.StackFrame! stackFrame) -> Microsoft.IdentityModel.Tokens.ValidationError! +Microsoft.IdentityModel.Tokens.ValidationError.ExceptionType.get -> System.Type! +Microsoft.IdentityModel.Tokens.ValidationError.FailureType.get -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +Microsoft.IdentityModel.Tokens.ValidationError.InnerException.get -> System.Exception? +Microsoft.IdentityModel.Tokens.ValidationError.StackFrames.get -> System.Collections.Generic.IList! +Microsoft.IdentityModel.Tokens.ValidationFailureType +Microsoft.IdentityModel.Tokens.ValidationFailureType.Name.get -> string! +Microsoft.IdentityModel.Tokens.ValidationFailureType.ValidationFailureType(string! name) -> void +Microsoft.IdentityModel.Tokens.ValidationParameters +Microsoft.IdentityModel.Tokens.ValidationParameters.ActorValidationParameters.get -> Microsoft.IdentityModel.Tokens.ValidationParameters? +Microsoft.IdentityModel.Tokens.ValidationParameters.ActorValidationParameters.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.AlgorithmValidator.get -> Microsoft.IdentityModel.Tokens.AlgorithmValidationDelegate! +Microsoft.IdentityModel.Tokens.ValidationParameters.AlgorithmValidator.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.AudienceValidator.get -> Microsoft.IdentityModel.Tokens.AudienceValidationDelegate! +Microsoft.IdentityModel.Tokens.ValidationParameters.AudienceValidator.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.AuthenticationType.get -> string? +Microsoft.IdentityModel.Tokens.ValidationParameters.AuthenticationType.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.ClockSkew.get -> System.TimeSpan +Microsoft.IdentityModel.Tokens.ValidationParameters.ClockSkew.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.ConfigurationManager.get -> Microsoft.IdentityModel.Tokens.BaseConfigurationManager? +Microsoft.IdentityModel.Tokens.ValidationParameters.ConfigurationManager.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.CryptoProviderFactory.get -> Microsoft.IdentityModel.Tokens.CryptoProviderFactory? +Microsoft.IdentityModel.Tokens.ValidationParameters.CryptoProviderFactory.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.DebugId.get -> string? +Microsoft.IdentityModel.Tokens.ValidationParameters.DebugId.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.IgnoreTrailingSlashWhenValidatingAudience.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.IgnoreTrailingSlashWhenValidatingAudience.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.IncludeTokenOnFailedValidation.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.IncludeTokenOnFailedValidation.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.InstancePropertyBag.get -> System.Collections.Generic.IDictionary! +Microsoft.IdentityModel.Tokens.ValidationParameters.IsClone.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.IsClone.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.IssuerSigningKeyResolver.get -> Microsoft.IdentityModel.Tokens.IssuerSigningKeyResolverDelegate? +Microsoft.IdentityModel.Tokens.ValidationParameters.IssuerSigningKeyResolver.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.IssuerSigningKeys.get -> System.Collections.Generic.IList! +Microsoft.IdentityModel.Tokens.ValidationParameters.IssuerSigningKeyValidator.get -> Microsoft.IdentityModel.Tokens.IssuerSigningKeyValidationDelegate! +Microsoft.IdentityModel.Tokens.ValidationParameters.IssuerSigningKeyValidator.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.IssuerValidatorAsync.get -> Microsoft.IdentityModel.Tokens.IssuerValidationDelegateAsync! +Microsoft.IdentityModel.Tokens.ValidationParameters.IssuerValidatorAsync.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.LifetimeValidator.get -> Microsoft.IdentityModel.Tokens.LifetimeValidationDelegate! +Microsoft.IdentityModel.Tokens.ValidationParameters.LifetimeValidator.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.LogTokenId.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.LogTokenId.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.NameClaimType.get -> string! +Microsoft.IdentityModel.Tokens.ValidationParameters.NameClaimType.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.NameClaimTypeRetriever.get -> System.Func? +Microsoft.IdentityModel.Tokens.ValidationParameters.NameClaimTypeRetriever.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.PropertyBag.get -> System.Collections.Generic.IDictionary! +Microsoft.IdentityModel.Tokens.ValidationParameters.RefreshBeforeValidation.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.RefreshBeforeValidation.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.RoleClaimType.get -> string! +Microsoft.IdentityModel.Tokens.ValidationParameters.RoleClaimType.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.RoleClaimTypeRetriever.get -> System.Func? +Microsoft.IdentityModel.Tokens.ValidationParameters.RoleClaimTypeRetriever.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.SaveSigninToken.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.SaveSigninToken.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.SignatureValidator.get -> Microsoft.IdentityModel.Tokens.SignatureValidationDelegate? +Microsoft.IdentityModel.Tokens.ValidationParameters.SignatureValidator.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.TokenDecryptionKeys.get -> System.Collections.Generic.IList! +Microsoft.IdentityModel.Tokens.ValidationParameters.TokenReplayCache.get -> Microsoft.IdentityModel.Tokens.ITokenReplayCache? +Microsoft.IdentityModel.Tokens.ValidationParameters.TokenReplayCache.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.TokenReplayValidator.get -> Microsoft.IdentityModel.Tokens.TokenReplayValidationDelegate! +Microsoft.IdentityModel.Tokens.ValidationParameters.TokenReplayValidator.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.TokenTypeValidator.get -> Microsoft.IdentityModel.Tokens.TokenTypeValidationDelegate! +Microsoft.IdentityModel.Tokens.ValidationParameters.TokenTypeValidator.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.TryAllIssuerSigningKeys.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.TryAllIssuerSigningKeys.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidAlgorithms.get -> System.Collections.Generic.IList! +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidateActor.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidateActor.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidateWithLKG.get -> bool +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidateWithLKG.set -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidationParameters() -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidationParameters(Microsoft.IdentityModel.Tokens.ValidationParameters! other) -> void +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidAudiences.get -> System.Collections.Generic.IList! +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidIssuers.get -> System.Collections.Generic.IList! +Microsoft.IdentityModel.Tokens.ValidationParameters.ValidTypes.get -> System.Collections.Generic.IList! +Microsoft.IdentityModel.Tokens.ValidationResult +Microsoft.IdentityModel.Tokens.ValidationResult.Equals(Microsoft.IdentityModel.Tokens.ValidationResult other) -> bool +Microsoft.IdentityModel.Tokens.ValidationResult.Error.get -> Microsoft.IdentityModel.Tokens.ValidationError? +Microsoft.IdentityModel.Tokens.ValidationResult.IsValid.get -> bool +Microsoft.IdentityModel.Tokens.ValidationResult.Result.get -> TResult? +Microsoft.IdentityModel.Tokens.ValidationResult.ToValidationResult() -> Microsoft.IdentityModel.Tokens.ValidationResult +Microsoft.IdentityModel.Tokens.ValidationResult.ValidationResult() -> void +Microsoft.IdentityModel.Tokens.ValidationResult.ValidationResult(Microsoft.IdentityModel.Tokens.ValidationError! error) -> void +Microsoft.IdentityModel.Tokens.ValidationResult.ValidationResult(TResult result) -> void +override Microsoft.IdentityModel.Tokens.ValidatedIssuer.Equals(object? obj) -> bool +override Microsoft.IdentityModel.Tokens.ValidatedIssuer.GetHashCode() -> int +override Microsoft.IdentityModel.Tokens.ValidatedLifetime.Equals(object? obj) -> bool +override Microsoft.IdentityModel.Tokens.ValidatedLifetime.GetHashCode() -> int +override Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.Equals(object? obj) -> bool +override Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.GetHashCode() -> int +override Microsoft.IdentityModel.Tokens.ValidatedTokenType.Equals(object? obj) -> bool +override Microsoft.IdentityModel.Tokens.ValidatedTokenType.GetHashCode() -> int +override Microsoft.IdentityModel.Tokens.ValidationResult.Equals(object? obj) -> bool +override Microsoft.IdentityModel.Tokens.ValidationResult.GetHashCode() -> int +static Microsoft.IdentityModel.Tokens.ValidatedIssuer.operator !=(Microsoft.IdentityModel.Tokens.ValidatedIssuer left, Microsoft.IdentityModel.Tokens.ValidatedIssuer right) -> bool +static Microsoft.IdentityModel.Tokens.ValidatedIssuer.operator ==(Microsoft.IdentityModel.Tokens.ValidatedIssuer left, Microsoft.IdentityModel.Tokens.ValidatedIssuer right) -> bool +static Microsoft.IdentityModel.Tokens.ValidatedLifetime.operator !=(Microsoft.IdentityModel.Tokens.ValidatedLifetime left, Microsoft.IdentityModel.Tokens.ValidatedLifetime right) -> bool +static Microsoft.IdentityModel.Tokens.ValidatedLifetime.operator ==(Microsoft.IdentityModel.Tokens.ValidatedLifetime left, Microsoft.IdentityModel.Tokens.ValidatedLifetime right) -> bool +static Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.operator !=(Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime left, Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime right) -> bool +static Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime.operator ==(Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime left, Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime right) -> bool +static Microsoft.IdentityModel.Tokens.ValidatedTokenType.operator !=(Microsoft.IdentityModel.Tokens.ValidatedTokenType left, Microsoft.IdentityModel.Tokens.ValidatedTokenType right) -> bool +static Microsoft.IdentityModel.Tokens.ValidatedTokenType.operator ==(Microsoft.IdentityModel.Tokens.ValidatedTokenType left, Microsoft.IdentityModel.Tokens.ValidatedTokenType right) -> bool +static Microsoft.IdentityModel.Tokens.ValidationResult.implicit operator Microsoft.IdentityModel.Tokens.ValidationResult(Microsoft.IdentityModel.Tokens.ValidationError! error) -> Microsoft.IdentityModel.Tokens.ValidationResult +static Microsoft.IdentityModel.Tokens.ValidationResult.implicit operator Microsoft.IdentityModel.Tokens.ValidationResult(TResult result) -> Microsoft.IdentityModel.Tokens.ValidationResult +static Microsoft.IdentityModel.Tokens.ValidationResult.operator !=(Microsoft.IdentityModel.Tokens.ValidationResult left, Microsoft.IdentityModel.Tokens.ValidationResult right) -> bool +static Microsoft.IdentityModel.Tokens.ValidationResult.operator ==(Microsoft.IdentityModel.Tokens.ValidationResult left, Microsoft.IdentityModel.Tokens.ValidationResult right) -> bool +static Microsoft.IdentityModel.Tokens.Validators.ValidateAlgorithm(string! algorithm, Microsoft.IdentityModel.Tokens.SecurityKey! securityKey, Microsoft.IdentityModel.Tokens.SecurityToken! securityToken, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters, Microsoft.IdentityModel.Tokens.CallContext! callContext) -> Microsoft.IdentityModel.Tokens.ValidationResult +static Microsoft.IdentityModel.Tokens.Validators.ValidateAudience(System.Collections.Generic.IList! tokenAudiences, Microsoft.IdentityModel.Tokens.SecurityToken? securityToken, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters, Microsoft.IdentityModel.Tokens.CallContext! callContext) -> Microsoft.IdentityModel.Tokens.ValidationResult +static Microsoft.IdentityModel.Tokens.Validators.ValidateIssuerAsync(string? issuer, Microsoft.IdentityModel.Tokens.SecurityToken? securityToken, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters, Microsoft.IdentityModel.Tokens.CallContext? callContext, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>! +static Microsoft.IdentityModel.Tokens.Validators.ValidateIssuerSigningKey(Microsoft.IdentityModel.Tokens.SecurityKey! securityKey, Microsoft.IdentityModel.Tokens.SecurityToken! securityToken, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters, Microsoft.IdentityModel.Tokens.BaseConfiguration? configuration, Microsoft.IdentityModel.Tokens.CallContext! callContext) -> Microsoft.IdentityModel.Tokens.ValidationResult +static Microsoft.IdentityModel.Tokens.Validators.ValidateLifetime(System.DateTime? notBefore, System.DateTime? expires, Microsoft.IdentityModel.Tokens.SecurityToken? securityToken, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters, Microsoft.IdentityModel.Tokens.CallContext! callContext) -> Microsoft.IdentityModel.Tokens.ValidationResult +static Microsoft.IdentityModel.Tokens.Validators.ValidateTokenReplay(System.DateTime? expirationTime, string! securityToken, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters, Microsoft.IdentityModel.Tokens.CallContext! callContext) -> Microsoft.IdentityModel.Tokens.ValidationResult +static Microsoft.IdentityModel.Tokens.Validators.ValidateTokenType(string? type, Microsoft.IdentityModel.Tokens.SecurityToken? securityToken, Microsoft.IdentityModel.Tokens.ValidationParameters! validationParameters, Microsoft.IdentityModel.Tokens.CallContext! callContext) -> Microsoft.IdentityModel.Tokens.ValidationResult +static readonly Microsoft.IdentityModel.Tokens.IssuerValidationSource.IssuerMatchedConfiguration -> Microsoft.IdentityModel.Tokens.IssuerValidationSource! +static readonly Microsoft.IdentityModel.Tokens.IssuerValidationSource.IssuerMatchedValidationParameters -> Microsoft.IdentityModel.Tokens.IssuerValidationSource! +static readonly Microsoft.IdentityModel.Tokens.IssuerValidationSource.NotValidated -> Microsoft.IdentityModel.Tokens.IssuerValidationSource! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.AlgorithmValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.AlgorithmValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.AudienceValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.AudienceValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.InvalidSecurityToken -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.IssuerSigningKeyValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.IssuerValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.IssuerValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.LifetimeValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.LifetimeValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.NoTokenAudiencesProvided -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.NoValidationParameterAudiencesProvided -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.NullArgument -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.SignatureAlgorithmValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.SignatureValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.SignatureValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.SigningKeyValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenDecryptionFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenExceedsMaximumSize -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenIsNotSigned -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenReadingFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenReplayValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenReplayValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenTypeValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.TokenTypeValidatorThrew -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationFailureType.XmlValidationFailed -> Microsoft.IdentityModel.Tokens.ValidationFailureType! +static readonly Microsoft.IdentityModel.Tokens.ValidationParameters.DefaultClockSkew -> System.TimeSpan +virtual Microsoft.IdentityModel.Tokens.ValidationParameters.Clone() -> Microsoft.IdentityModel.Tokens.ValidationParameters! +virtual Microsoft.IdentityModel.Tokens.ValidationParameters.CreateClaimsIdentity(Microsoft.IdentityModel.Tokens.SecurityToken! securityToken, string! issuer) -> System.Security.Claims.ClaimsIdentity! \ No newline at end of file diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/Details/ValidationError.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/Details/ValidationError.cs index b4e0a6714f..21f1439ed2 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/Details/ValidationError.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/Details/ValidationError.cs @@ -15,7 +15,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// Contains information so that Exceptions can be logged or thrown written as required. /// - internal class ValidationError + public class ValidationError { private Type _exceptionType; @@ -199,7 +199,7 @@ internal void Log(ILogger logger) /// /// Gets the type of validation failure that occurred. /// - internal ValidationFailureType FailureType { get; } + public ValidationFailureType FailureType { get; } /// /// Gets the type of exception that occurred. diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/IssuerValidationSource.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/IssuerValidationSource.cs index 30ae1301ed..bd8351a2c5 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/IssuerValidationSource.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/IssuerValidationSource.cs @@ -7,7 +7,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// Represents the source of the validation of an issuer. /// - internal class IssuerValidationSource + public class IssuerValidationSource { /// /// Initializes a new instance of . diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedIssuer.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedIssuer.cs index e5752cec94..efe7feb154 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedIssuer.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedIssuer.cs @@ -9,7 +9,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// Represents a validated issuer, including the source of the validation. /// - internal readonly struct ValidatedIssuer : IEquatable + public readonly struct ValidatedIssuer : IEquatable { /// /// Initializes a new instance of . diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedLifetime.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedLifetime.cs index 88f17d02bf..59be568bc3 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedLifetime.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedLifetime.cs @@ -9,7 +9,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// Represents a validated lifetime, including the NotBefore and Expires values. /// - internal readonly struct ValidatedLifetime : IEquatable + public readonly struct ValidatedLifetime : IEquatable { /// /// Initializes a new instance of . diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedSigningKeyLifetime.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedSigningKeyLifetime.cs index dc7285728f..3c22bd89d0 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedSigningKeyLifetime.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedSigningKeyLifetime.cs @@ -9,7 +9,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// Represents a validated signing key lifetime. /// - internal readonly struct ValidatedSigningKeyLifetime : IEquatable + public readonly struct ValidatedSigningKeyLifetime : IEquatable { /// /// Initializes a new instance of . diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedToken.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedToken.cs index ba4fe95fa4..085a4cec51 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedToken.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedToken.cs @@ -20,7 +20,7 @@ namespace Microsoft.IdentityModel.Tokens /// The that is being validated. /// The that is being used to validate the token. /// The to be used for validating the token. - internal class ValidatedToken( + public class ValidatedToken( SecurityToken securityToken, TokenHandler tokenHandler, ValidationParameters validationParameters) diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedTokenType.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedTokenType.cs index 8c76e00fa3..b3598164f2 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedTokenType.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidatedTokenType.cs @@ -9,7 +9,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// Represents a validated token type, including the number of valid types present in the validation parameters. /// - internal readonly struct ValidatedTokenType : IEquatable + public readonly struct ValidatedTokenType : IEquatable { /// /// Initializes a new instance of . @@ -62,10 +62,7 @@ public override int GetHashCode() /// The left value to compare. /// The right value to compare. /// A boolean indicating whether the left value is equal to the right one. - public static bool operator ==(ValidatedTokenType left, ValidatedTokenType right) - { - return left.Equals(right); - } + public static bool operator ==(ValidatedTokenType left, ValidatedTokenType right) => left.Equals(right); /// /// Inequality comparison operator for . diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidationResult.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidationResult.cs index 8bb3c9d5e0..aa4243f299 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidationResult.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Results/ValidationResult.cs @@ -11,7 +11,7 @@ namespace Microsoft.IdentityModel.Tokens /// Represents a validation result that can be either valid or invalid. /// /// - internal readonly struct ValidationResult : IEquatable> + public readonly struct ValidationResult : IEquatable> { readonly TResult? _result; readonly ValidationError? _error; diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/ValidationFailureType.cs b/src/Microsoft.IdentityModel.Tokens/Validation/ValidationFailureType.cs index 2556fea941..12bd6194bb 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/ValidationFailureType.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/ValidationFailureType.cs @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#nullable enable namespace Microsoft.IdentityModel.Tokens { /// /// The type of the failure that occurred when validating a . /// - internal abstract class ValidationFailureType + public abstract class ValidationFailureType { /// /// Creates an instance of @@ -19,7 +20,7 @@ protected ValidationFailureType(string name) /// /// Gets the name of the . /// - public string Name { get; } + public string Name { get; internal set; } /// /// Defines a type that represents a required parameter was null. @@ -171,3 +172,4 @@ private class IssuerValidatorFailure : ValidationFailureType { internal IssuerVa public static readonly ValidationFailureType TokenTypeValidatorThrew = new TokenTypeValidationFailure("TokenTypeValidatorThrew"); } } +#nullable restore diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs b/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs index 6b0d151d0a..8d4a139cb5 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/ValidationParameters.cs @@ -14,7 +14,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// Contains a set of parameters that are used by a when validating a . /// - internal class ValidationParameters + public class ValidationParameters { private string? _authenticationType; private TimeSpan _clockSkew = DefaultClockSkew; diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs index 1ed23b224b..deb6c4eb08 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Algorithm.cs @@ -18,7 +18,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// A that contains the results of validating the algorithm. /// This delegate is not expected to throw. - internal delegate ValidationResult AlgorithmValidationDelegate( + public delegate ValidationResult AlgorithmValidationDelegate( string algorithm, SecurityKey securityKey, SecurityToken securityToken, @@ -38,7 +38,7 @@ public static partial class Validators /// The being validated. /// required for validation. /// The that contains call information. - internal static ValidationResult ValidateAlgorithm( + public static ValidationResult ValidateAlgorithm( string algorithm, #pragma warning disable CA1801 SecurityKey securityKey, diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs index 3c11cf948d..e9e4977f1d 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Audience.cs @@ -18,7 +18,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// A that contains the results of validating the issuer. /// This delegate is not expected to throw. - internal delegate ValidationResult AudienceValidationDelegate( + public delegate ValidationResult AudienceValidationDelegate( IList tokenAudiences, SecurityToken? securityToken, ValidationParameters validationParameters, @@ -37,7 +37,7 @@ public static partial class Validators /// The to be used for validating the token. /// The that contains call information. /// An EXACT match is required. - internal static ValidationResult ValidateAudience( + public static ValidationResult ValidateAudience( IList tokenAudiences, #pragma warning disable CA1801 SecurityToken? securityToken, diff --git a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Issuer.cs b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Issuer.cs index 4772b31fc4..b302c04ba0 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Issuer.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Issuer.cs @@ -18,7 +18,7 @@ namespace Microsoft.IdentityModel.Tokens /// /// An that contains the results of validating the issuer. /// This delegate is not expected to throw. - internal delegate Task> IssuerValidationDelegateAsync( + public delegate Task> IssuerValidationDelegateAsync( string issuer, SecurityToken securityToken, ValidationParameters validationParameters, @@ -40,7 +40,7 @@ public static partial class Validators /// /// An that contains either the issuer that was validated or an error. /// An EXACT match is required. - internal static async Task> ValidateIssuerAsync( + public static async Task> ValidateIssuerAsync( string? issuer, 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 1c0cfec536..57e57f2dec 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.IssuerSigningKey.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.IssuerSigningKey.cs @@ -18,7 +18,7 @@ namespace Microsoft.IdentityModel.Tokens /// 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 IssuerSigningKeyValidationDelegate( + public delegate ValidationResult IssuerSigningKeyValidationDelegate( SecurityKey signingKey, SecurityToken securityToken, ValidationParameters validationParameters, @@ -38,7 +38,7 @@ public static partial class Validators /// The to be used for validating the token. /// The to be used for validation. /// The that contains call information. - internal static ValidationResult ValidateIssuerSigningKey( + public static ValidationResult ValidateIssuerSigningKey( SecurityKey securityKey, 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 7aa37577b3..dd58e9951b 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Lifetime.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.Lifetime.cs @@ -17,7 +17,7 @@ namespace Microsoft.IdentityModel.Tokens /// The that contains call information. /// A that contains the results of validating the issuer. /// This delegate is not expected to throw. - internal delegate ValidationResult LifetimeValidationDelegate( + public delegate ValidationResult LifetimeValidationDelegate( DateTime? notBefore, DateTime? expires, SecurityToken? securityToken, @@ -40,7 +40,7 @@ public static partial class Validators /// A indicating whether validation was successful, and providing a if it was not. /// All time comparisons apply . #pragma warning disable CA1801 - internal static ValidationResult ValidateLifetime( + public static ValidationResult ValidateLifetime( 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 f25292e5cb..5170b627be 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenReplay.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenReplay.cs @@ -15,7 +15,7 @@ namespace Microsoft.IdentityModel.Tokens /// The that contains call information. /// A that contains the results of validating the token. /// This delegate is not expected to throw. - internal delegate ValidationResult TokenReplayValidationDelegate( + public delegate ValidationResult TokenReplayValidationDelegate( DateTime? expirationTime, string securityToken, ValidationParameters validationParameters, @@ -34,7 +34,7 @@ public static partial class Validators /// The to be used for validating the token. /// The that contains call information. #pragma warning disable CA1801 // Review unused parameters - internal static ValidationResult ValidateTokenReplay( + public static ValidationResult ValidateTokenReplay( 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 2ccce42550..25531bb043 100644 --- a/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenType.cs +++ b/src/Microsoft.IdentityModel.Tokens/Validation/Validators.TokenType.cs @@ -17,7 +17,7 @@ namespace Microsoft.IdentityModel.Tokens /// The that contains call information. /// 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 TokenTypeValidationDelegate( + public delegate ValidationResult TokenTypeValidationDelegate( string? type, SecurityToken? securityToken, ValidationParameters validationParameters, @@ -37,11 +37,11 @@ public static partial class Validators /// The that contains call information. /// A that contains the results of validating the token type. /// An EXACT match is required. (case sensitive) is used for comparing against . -#pragma warning disable CA1801 - internal static ValidationResult ValidateTokenType( + public static ValidationResult ValidateTokenType( string? type, SecurityToken? securityToken, ValidationParameters validationParameters, +#pragma warning disable CA1801 CallContext callContext) #pragma warning restore CA1801 {