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

Use int to guard when metadata update is due #2988

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

brentschmaltz
Copy link
Member

The previous guard was a DateTimeOffset which could be in an indeterminate state when being read.
This PR records the DateTimeOffset when ConfigurationManager is instantiated StartupTime.
The next refresh (automatic or requestRefresh) is an offset in seconds from the StartupTime.

An int is used to store the offset of the last refresh.
If a service runs over 68 years, int will overflow, we could have some complicated logic to avoid this, it seems ok to leave it as is.

We also could have performed a simple calculation of:
NumberOfTimesAutomaticRefreshRequested * _automaticRefreshIntervalInSeconds > (StartupTime - UtcNow).TotalSeconds
We add a small amount %5 in a random manner when calculating the next interval, adds complexity.

We added internals to aid in testing.

@brentschmaltz brentschmaltz requested a review from a team as a code owner November 8, 2024 02:21
Copy link
Contributor

@keegan-caruso keegan-caruso left a comment

Choose a reason for hiding this comment

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

I need a little more time with this, but this is my first pass.

@pmaytak pmaytak self-requested a review November 8, 2024 08:20
@pmaytak pmaytak linked an issue Nov 8, 2024 that may be closed by this pull request
14 tasks
Copy link
Contributor

@keegan-caruso keegan-caruso left a comment

Choose a reason for hiding this comment

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

I want to make sure @pmaytak gets a chance to look at this, but this is looking good.

Copy link

github-actions bot commented Nov 8, 2024

Summary

Summary
Generated on: 11/8/2024 - 5:44:32 PM
Coverage date: 11/8/2024 - 5:34:55 PM - 11/8/2024 - 5:44:02 PM
Parser: MultiReport (62x Cobertura)
Assemblies: 16
Classes: 525
Files: 421
Line coverage: 54.3% (29880 of 54955)
Covered lines: 29880
Uncovered lines: 25075
Coverable lines: 54955
Total lines: 102773
Branch coverage: 64.2% (9354 of 14561)
Covered branches: 9354
Total branches: 14561
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.Abstractions - 70.2%
Name Line Branch
Microsoft.IdentityModel.Abstractions 70.2% 100%
Microsoft.IdentityModel.Abstractions.LogEntry 66.6%
Microsoft.IdentityModel.Abstractions.NullIdentityModelLogger 60%
Microsoft.IdentityModel.Abstractions.NullTelemetryClient 0%
Microsoft.IdentityModel.Abstractions.TelemetryEventDetails 100% 100%
Microsoft.IdentityModel.JsonWebTokens - 80%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80% 71.7%
Microsoft.IdentityModel.JsonWebTokens.ClaimTypeMapping 100% 100%
Microsoft.IdentityModel.JsonWebTokens.JsonClaimSet 85.4% 79.6%
Microsoft.IdentityModel.JsonWebTokens.JsonWebToken 83.7% 82.8%
Microsoft.IdentityModel.JsonWebTokens.JsonWebTokenHandler 78.6% 69.7%
Microsoft.IdentityModel.JsonWebTokens.JwtHeaderUtf8Bytes 46.6%
Microsoft.IdentityModel.JsonWebTokens.JwtPayloadUtf8Bytes 27.5%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenDecryptionParameters 73.3%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 78.2% 69%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%
Microsoft.IdentityModel.Logging - 74.9%
Name Line Branch
Microsoft.IdentityModel.Logging 74.9% 73.3%
Microsoft.IdentityModel.Logging.IdentityModelEventSource 71.3% 54.6%
Microsoft.IdentityModel.Logging.IdentityModelTelemetryUtil 96.9% 100%
Microsoft.IdentityModel.Logging.LoggerContext 100%
Microsoft.IdentityModel.Logging.LogHelper 70.8% 80.7%
Microsoft.IdentityModel.Logging.NonPII 100% 100%
Microsoft.IdentityModel.Logging.SecurityArtifact 100% 100%
Microsoft.IdentityModel.Logging.TextWriterEventListener 82.1% 68.7%
System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute 0%
System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute 0%
System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute 0%
Microsoft.IdentityModel.Protocols - 89.2%
Name Line Branch
Microsoft.IdentityModel.Protocols 89.2% 88%
Microsoft.IdentityModel.Protocols.AuthenticationProtocolMessage 78.6% 90.6%
Microsoft.IdentityModel.Protocols.Configuration.InvalidConfigurationExcepti
on
25%
Microsoft.IdentityModel.Protocols.Configuration.LastKnownGoodConfigurationC
acheOptions
0%
Microsoft.IdentityModel.Protocols.ConfigurationManager`1 99.4% 85.4%
Microsoft.IdentityModel.Protocols.ConfigurationValidationResult 100%
Microsoft.IdentityModel.Protocols.FileDocumentRetriever 100% 100%
Microsoft.IdentityModel.Protocols.HttpDocumentRetriever 94.9% 86.6%
Microsoft.IdentityModel.Protocols.HttpRequestData 95.8% 100%
Microsoft.IdentityModel.Protocols.StaticConfigurationManager`1 71.4% 50%
Microsoft.IdentityModel.Protocols.OpenIdConnect - 81.4%
Name Line Branch
Microsoft.IdentityModel.Protocols.OpenIdConnect 81.4% 89.6%
Microsoft.IdentityModel.Protocols.OpenIdConnect.Configuration.OpenIdConnect
ConfigurationValidator
95.3% 87.5%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration 59.4% 95%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationR
etriever
76.4% 71.4%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationS
erializer
88.7% 87.1%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectMessage 86.4% 79.1%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectParameterUtf8B
ytes
0%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolExcept
ion
50%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolInvali
dAtHashException
50%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolInvali
dCHashException
50%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolInvali
dNonceException
50%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolInvali
dStateException
50%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValida
tionContext
100%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValida
tor
95.3% 95.2%
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdProviderMetadataUtf8B
ytes
96.9%
Microsoft.IdentityModel.Protocols.SignedHttpRequest - 93.4%
Name Line Branch
Microsoft.IdentityModel.Protocols.SignedHttpRequest 93.4% 93.3%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.Cnf 96.1% 94.4%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.ConfirmationClaimTypesU
tf8Bytes
80%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestCreati
onException
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestCreati
onParameters
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestDescri
ptor
100% 100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestHandle
r
95% 94.4%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dAtClaimException
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dBClaimException
75%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dCnfClaimException
75%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dHClaimException
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dMClaimException
75%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dNonceClaimException
46.1%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dPClaimException
75%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dPopKeyException
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dQClaimException
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dSignatureException
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dTsClaimException
75%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestInvali
dUClaimException
75%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestUtilit
ies
100% 86.3%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestValida
tionContext
100% 100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestValida
tionException
100%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestValida
tionParameters
81.8% 50%
Microsoft.IdentityModel.Protocols.SignedHttpRequest.SignedHttpRequestValida
tionResult
100%
Microsoft.IdentityModel.Protocols.Tests - 0%
Name Line Branch
Microsoft.IdentityModel.Protocols.Tests 0% 0%
AutoGeneratedProgram 0%
Microsoft.IdentityModel.Protocols.Tests.AuthenticationProtocolMessageTests 0% 0%
Microsoft.IdentityModel.Protocols.Tests.DocumentRetrieverTheoryData 0%
Microsoft.IdentityModel.Protocols.Tests.ExtensibilityTests 0% 0%
Microsoft.IdentityModel.Protocols.Tests.FileDocumentRetrieverTests 0%
Microsoft.IdentityModel.Protocols.Tests.HttpDocumentRetrieverTests 0% 0%
Microsoft.IdentityModel.Protocols.Tests.HttpRequestDataTests 0%
Microsoft.IdentityModel.Protocols.Tests.IssuerConfigurationRetriever 0%
Microsoft.IdentityModel.Protocols.Tests.IssuerMetadata 0%
Microsoft.IdentityModel.Protocols.Tests.MessageComparer 0% 0%
Microsoft.IdentityModel.Protocols.Tests.StaticConfigurationManagerTests 0%
Microsoft.IdentityModel.Protocols.WsFederation - 80.9%
Name Line Branch
Microsoft.IdentityModel.Protocols.WsFederation 80.9% 76%
Microsoft.IdentityModel.Protocols.WsFederation.KeyValueAccumulator 87.5% 50%
Microsoft.IdentityModel.Protocols.WsFederation.QueryHelper 72.4% 61.5%
Microsoft.IdentityModel.Protocols.WsFederation.SecurityTokenServiceTypeRole
Descriptor
85.7%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationConfiguration 100%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationConfigurationRet
riever
0% 0%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationConfigurationVal
idator
84.9% 84.7%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationConstants 100%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationException 50%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationMessage 74.1% 65.1%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationMetadataSerializ
er
97.8% 92.3%
Microsoft.IdentityModel.Protocols.WsFederation.WsFederationReadException 22.2%
Microsoft.IdentityModel.Tokens.CertificateHelper 100%
Microsoft.IdentityModel.TestUtils - 86.7%
Name Line Branch
Microsoft.IdentityModel.TestUtils 86.7% 60.9%
AutoGeneratedProgram 0%
Microsoft.IdentityModel.TestUtils.Acr 100%
Microsoft.IdentityModel.TestUtils.Address 100%
Microsoft.IdentityModel.TestUtils.AES_128_CBC_HMAC_SHA_256 74.5%
Microsoft.IdentityModel.TestUtils.AES_192_CBC_HMAC_SHA_384 70.9%
Microsoft.IdentityModel.TestUtils.AES_256_CBC_HMAC_SHA_512 70.1%
Microsoft.IdentityModel.TestUtils.AES_256_GCM 87%
Microsoft.IdentityModel.TestUtils.AES128_KeyWrap 100%
Microsoft.IdentityModel.TestUtils.AuthenticatedEncryptionCryptoProviderFact
ory
45% 100%
Microsoft.IdentityModel.TestUtils.AuthTime 100%
Microsoft.IdentityModel.TestUtils.CertificateHelper 100%
Microsoft.IdentityModel.TestUtils.ClaimSets 83.9% 37.8%
Microsoft.IdentityModel.TestUtils.CompareContext 91.4% 91.6%
Microsoft.IdentityModel.TestUtils.CustomSecurityKey 100%
Microsoft.IdentityModel.TestUtils.DecryptAuthenticatedEncryptionProvider 100%
Microsoft.IdentityModel.TestUtils.DecryptSymmetricSignatureProvider 50%
Microsoft.IdentityModel.TestUtils.Default 93.3% 83.3%
Microsoft.IdentityModel.TestUtils.DerivedAuthenticatedEncryptionProvider 97.6%
Microsoft.IdentityModel.TestUtils.DerivedKeyWrapProvider 100%
Microsoft.IdentityModel.TestUtils.DerivedRsa 25%
Microsoft.IdentityModel.TestUtils.DerivedRsaKeyWrapProvider 94.7%
Microsoft.IdentityModel.TestUtils.DerivedSecurityKey 25% 0%
Microsoft.IdentityModel.TestUtils.DerivedSecurityToken 0%
Microsoft.IdentityModel.TestUtils.ECDH_ES 55%
Microsoft.IdentityModel.TestUtils.EncryptAuthenticatedEncryptionProvider 100%
Microsoft.IdentityModel.TestUtils.EncryptSymmetricSignatureProvider 50%
Microsoft.IdentityModel.TestUtils.Entity 100%
Microsoft.IdentityModel.TestUtils.EventControlledConfigurationManger`1 100% 100%
Microsoft.IdentityModel.TestUtils.EventDrivenConfigurationRetriever`1 0%
Microsoft.IdentityModel.TestUtils.ExpectedException 80% 57.5%
Microsoft.IdentityModel.TestUtils.FaultingSymmetricSecurityKey 85.7% 50%
Microsoft.IdentityModel.TestUtils.GetSetContext 100%
Microsoft.IdentityModel.TestUtils.HttpResponseMessageUtils 100%
Microsoft.IdentityModel.TestUtils.IdentityComparer 80% 70.2%
Microsoft.IdentityModel.TestUtils.IdentityUtilities 65.6% 41.6%
Microsoft.IdentityModel.TestUtils.InMemoryDocumentRetriever 100% 100%
Microsoft.IdentityModel.TestUtils.KeyInfoTestSet 93.6%
Microsoft.IdentityModel.TestUtils.KeyingMaterial 91.1% 75%
Microsoft.IdentityModel.TestUtils.MockConfigurationManager`1 65.3% 55.5%
Microsoft.IdentityModel.TestUtils.MockHttpMessageHandler 100% 100%
Microsoft.IdentityModel.TestUtils.MockTimeProvider 100% 50%
Microsoft.IdentityModel.TestUtils.NotAsymmetricOrSymmetricSecurityKey 50%
Microsoft.IdentityModel.TestUtils.NotDefault 18.7%
Microsoft.IdentityModel.TestUtils.ReferenceMetadata 99.1% 100%
Microsoft.IdentityModel.TestUtils.ReferenceSaml 99.3% 100%
Microsoft.IdentityModel.TestUtils.ReferenceTestSet 100%
Microsoft.IdentityModel.TestUtils.ReferenceTokens 100%
Microsoft.IdentityModel.TestUtils.ReferenceXml 77.7%
Microsoft.IdentityModel.TestUtils.Request 100%
Microsoft.IdentityModel.TestUtils.RSAES_OAEP_KeyWrap 100%
Microsoft.IdentityModel.TestUtils.RSAES_PKCS1_KeyWrap 100%
Microsoft.IdentityModel.TestUtils.SamlActionTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlAdviceTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlAssertionTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlAttributeStatementTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlAttributeTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlAudienceRestrictionConditionTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlAuthenticationStatementTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlAuthorizationDecisionStatementTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlConditionsTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlEvidenceTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlSubjectTestSet 100%
Microsoft.IdentityModel.TestUtils.SamlTokenTestSet 100%
Microsoft.IdentityModel.TestUtils.SampleCustomCompressionProvider 75% 50%
Microsoft.IdentityModel.TestUtils.SampleCustomCompressionProviderDecompress
AndCompressAlwaysFail
78.5%
Microsoft.IdentityModel.TestUtils.SampleListener 100% 66.6%
Microsoft.IdentityModel.TestUtils.SecurityKeyConverterWithTypeDiscriminator 74.2% 58.3%
Microsoft.IdentityModel.TestUtils.SignatureTestSet 62.5%
Microsoft.IdentityModel.TestUtils.SignedInfoTestSet 100%
Microsoft.IdentityModel.TestUtils.SkipValidationDelegates 100%
Microsoft.IdentityModel.TestUtils.TestException 100%
Microsoft.IdentityModel.TestUtils.TestStubTests 0% 0%
Microsoft.IdentityModel.TestUtils.TestStubTheoryData 0%
Microsoft.IdentityModel.TestUtils.TestTheoryData 100%
Microsoft.IdentityModel.TestUtils.TestUtilities 57.4% 46.2%
Microsoft.IdentityModel.TestUtils.TheoryDataBase 100%
Microsoft.IdentityModel.TestUtils.TokenReplayCache 100%
Microsoft.IdentityModel.TestUtils.TokenReplayTheoryData 100%
Microsoft.IdentityModel.TestUtils.TokenTheoryData 100%
Microsoft.IdentityModel.TestUtils.TransformsTestSet 100%
Microsoft.IdentityModel.TestUtils.TransformTestSet 94.8% 100%
Microsoft.IdentityModel.TestUtils.TupleListExtensions 100%
Microsoft.IdentityModel.TestUtils.ValidationDelegates 51.9% 50%
Microsoft.IdentityModel.TestUtils.WsFederationMessageTestSet 100%
Microsoft.IdentityModel.TestUtils.XmlEement 90.9% 75%
Microsoft.IdentityModel.TestUtils.XmlGenerator 82.5% 76.9%
Microsoft.IdentityModel.TestUtils.XmlTestSet 100%
Microsoft.IdentityModel.TestUtils.XmlUtilities 94.2% 62.5%
Microsoft.IdentityModel.Tokens - 76.4%
Name Line Branch
Microsoft.IdentityModel.Tokens 76.4% 72.2%
Microsoft.IdentityModel.Tokens.AesAead 85.8% 50%
Microsoft.IdentityModel.Tokens.AesBCryptModes 100%
Microsoft.IdentityModel.Tokens.AesGcm 96.5% 75%
Microsoft.IdentityModel.Tokens.AlgorithmValidationError 93.3% 50%
Microsoft.IdentityModel.Tokens.AppContextSwitches 93.3% 87.5%
Microsoft.IdentityModel.Tokens.AsymmetricAdapter 77.2% 81.8%
Microsoft.IdentityModel.Tokens.AsymmetricSecurityKey 100%
Microsoft.IdentityModel.Tokens.AsymmetricSignatureProvider 73.2% 70.3%
Microsoft.IdentityModel.Tokens.AudienceValidationError 100% 100%
Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionProvider 87.4% 83.6%
Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionResult 100%
Microsoft.IdentityModel.Tokens.Base64UrlEncoder 76.1% 69.1%
Microsoft.IdentityModel.Tokens.Base64UrlEncoding 79.5% 79.7%
Microsoft.IdentityModel.Tokens.BaseConfiguration 100%
Microsoft.IdentityModel.Tokens.BaseConfigurationComparer 100% 100%
Microsoft.IdentityModel.Tokens.BaseConfigurationManager 95.7% 38.8%
Microsoft.IdentityModel.Tokens.CallContext 100%
Microsoft.IdentityModel.Tokens.CaseSensitiveClaimsIdentity 100% 70%
Microsoft.IdentityModel.Tokens.CertificateHelper 100%
Microsoft.IdentityModel.Tokens.ClaimsIdentityFactory 66.6% 50%
Microsoft.IdentityModel.Tokens.Cng 60% 50%
Microsoft.IdentityModel.Tokens.CollectionUtilities 100% 100%
Microsoft.IdentityModel.Tokens.CompressionProviderFactory 77.1% 75%
Microsoft.IdentityModel.Tokens.Configuration.LKGConfigurationCacheOptions 77.7% 0%
Microsoft.IdentityModel.Tokens.CryptographicOperations 0%
Microsoft.IdentityModel.Tokens.CryptoProviderCacheOptions 100% 100%
Microsoft.IdentityModel.Tokens.CryptoProviderFactory 84.8% 75.9%
Microsoft.IdentityModel.Tokens.CryptoThrowHelper 47.3% 50%
Microsoft.IdentityModel.Tokens.DateTimeUtil 81.2% 80%
Microsoft.IdentityModel.Tokens.DeflateCompressionProvider 82.7% 70%
Microsoft.IdentityModel.Tokens.DisposableObjectPool`1 93.7% 92.8%
Microsoft.IdentityModel.Tokens.EcdhKeyExchangeProvider 70.5% 67.1%
Microsoft.IdentityModel.Tokens.ECDsaAdapter 35.5% 32.9%
Microsoft.IdentityModel.Tokens.ECDsaSecurityKey 62.7% 50%
Microsoft.IdentityModel.Tokens.EncodingUtils 27.7%
Microsoft.IdentityModel.Tokens.EncryptingCredentials 100% 100%
Microsoft.IdentityModel.Tokens.EpochTime 100% 100%
Microsoft.IdentityModel.Tokens.EventBasedLRUCache`2 71.2% 66.6%
Microsoft.IdentityModel.Tokens.InMemoryCryptoProviderCache 76.3% 81.5%
Microsoft.IdentityModel.Tokens.InternalValidators 100%
Microsoft.IdentityModel.Tokens.Interop 63.9% 36.3%
Microsoft.IdentityModel.Tokens.IssuerValidationError 92.8% 50%
Microsoft.IdentityModel.Tokens.Json.JsonSerializerPrimitives 77.6% 75.3%
Microsoft.IdentityModel.Tokens.Json.JsonWebKeySerializer 77.3% 85%
Microsoft.IdentityModel.Tokens.Json.JsonWebKeySetSerializer 77.4% 82.1%
Microsoft.IdentityModel.Tokens.JsonWebKey 93.7% 92.1%
Microsoft.IdentityModel.Tokens.JsonWebKeyConverter 80.5% 67.5%
Microsoft.IdentityModel.Tokens.JsonWebKeyParameterUtf8Bytes 100%
Microsoft.IdentityModel.Tokens.JsonWebKeySet 97.2% 91.6%
Microsoft.IdentityModel.Tokens.KeyWrapProvider 100%
Microsoft.IdentityModel.Tokens.LifetimeValidationError 100% 100%
Microsoft.IdentityModel.Tokens.LogDetail 0%
Microsoft.IdentityModel.Tokens.LRUCacheItem`2 89.4% 60%
Microsoft.IdentityModel.Tokens.MessageDetail 100% 100%
Microsoft.IdentityModel.Tokens.RSACryptoServiceProviderProxy 0% 0%
Microsoft.IdentityModel.Tokens.RsaKeyWrapProvider 96.2% 90.9%
Microsoft.IdentityModel.Tokens.RsaSecurityKey 77.1% 63.3%
Microsoft.IdentityModel.Tokens.SafeAlgorithmHandle 0%
Microsoft.IdentityModel.Tokens.SafeBCryptHandle 100%
Microsoft.IdentityModel.Tokens.SafeKeyHandle 29.4% 50%
Microsoft.IdentityModel.Tokens.SecurityKey 95.3% 87.5%
Microsoft.IdentityModel.Tokens.SecurityToken 0%
Microsoft.IdentityModel.Tokens.SecurityTokenArgumentException 75%
Microsoft.IdentityModel.Tokens.SecurityTokenArgumentNullException 67.7% 83.3%
Microsoft.IdentityModel.Tokens.SecurityTokenCompressionFailedException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenDecompressionFailedException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenDecryptionFailedException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor 100% 100%
Microsoft.IdentityModel.Tokens.SecurityTokenEncryptionFailedException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenEncryptionKeyNotFoundException 25%
Microsoft.IdentityModel.Tokens.SecurityTokenException 78.9% 75%
Microsoft.IdentityModel.Tokens.SecurityTokenExpiredException 40% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenHandler 12%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidAlgorithmException 38.4% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidAudienceException 38.4% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidCloudInstanceException 16.1% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidIssuerException 38.4% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidLifetimeException 35.4% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException 75%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSigningKeyException 76.9%
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidTypeException 38.4% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenKeyWrapException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenMalformedException 75%
Microsoft.IdentityModel.Tokens.SecurityTokenNoExpirationException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenNotYetValidException 40% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenReplayAddFailedException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenReplayDetectedException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException 50%
Microsoft.IdentityModel.Tokens.SecurityTokenUnableToValidateException 13.7% 0%
Microsoft.IdentityModel.Tokens.SecurityTokenValidationException 75%
Microsoft.IdentityModel.Tokens.SignatureProvider 95.7% 100%
Microsoft.IdentityModel.Tokens.SigningCredentials 96.9% 70%
Microsoft.IdentityModel.Tokens.SupportedAlgorithms 90.4% 80.5%
Microsoft.IdentityModel.Tokens.SymmetricKeyWrapProvider 93.2% 87.5%
Microsoft.IdentityModel.Tokens.SymmetricSecurityKey 96.1% 83.3%
Microsoft.IdentityModel.Tokens.SymmetricSignatureProvider 73.9% 67.5%
Microsoft.IdentityModel.Tokens.TokenContext 0%
Microsoft.IdentityModel.Tokens.TokenHandler 83.7% 75%
Microsoft.IdentityModel.Tokens.TokenTypeValidationError 92.8% 50%
Microsoft.IdentityModel.Tokens.TokenUtilities 58.4% 55.7%
Microsoft.IdentityModel.Tokens.TokenValidationParameters 96.5% 69.2%
Microsoft.IdentityModel.Tokens.TokenValidationResult 76.6% 87.5%
Microsoft.IdentityModel.Tokens.UniqueId 17.1% 0%
Microsoft.IdentityModel.Tokens.Utility 76.9% 66.6%
Microsoft.IdentityModel.Tokens.ValidatedIssuer 100%
Microsoft.IdentityModel.Tokens.ValidatedLifetime 100%
Microsoft.IdentityModel.Tokens.ValidatedSigningKeyLifetime 100%
Microsoft.IdentityModel.Tokens.ValidatedToken 76.8% 66.6%
Microsoft.IdentityModel.Tokens.ValidatedTokenType 100%
Microsoft.IdentityModel.Tokens.ValidationError 71.5% 56.6%
Microsoft.IdentityModel.Tokens.ValidationFailureType 100%
Microsoft.IdentityModel.Tokens.ValidationParameters 52.7% 57.6%
Microsoft.IdentityModel.Tokens.ValidationResult`1 27.2% 16.6%
Microsoft.IdentityModel.Tokens.Validators 94.3% 91.9%
Microsoft.IdentityModel.Tokens.ValidatorUtilities 95.6% 72.7%
Microsoft.IdentityModel.Tokens.X509EncryptingCredentials 100%
Microsoft.IdentityModel.Tokens.X509SecurityKey 94.2% 85%
Microsoft.IdentityModel.Tokens.X509SigningCredentials 100%
Microsoft.IdentityModel.Tokens.Saml - 71.1%
Name Line Branch
Microsoft.IdentityModel.Tokens.Saml 71.1% 59.5%
Microsoft.IdentityModel.Tokens.Saml.AuthenticationInformation 0% 0%
Microsoft.IdentityModel.Tokens.Saml.SamlAction 95.4% 66.6%
Microsoft.IdentityModel.Tokens.Saml.SamlAdvice 100% 100%
Microsoft.IdentityModel.Tokens.Saml.SamlAssertion 92.5% 58.3%
Microsoft.IdentityModel.Tokens.Saml.SamlAttribute 87.5% 61.1%
Microsoft.IdentityModel.Tokens.Saml.SamlAttributeKeyComparer 90% 50%
Microsoft.IdentityModel.Tokens.Saml.SamlAttributeStatement 100% 50%
Microsoft.IdentityModel.Tokens.Saml.SamlAudienceRestrictionCondition 100% 50%
Microsoft.IdentityModel.Tokens.Saml.SamlAuthenticationStatement 96.7% 66.6%
Microsoft.IdentityModel.Tokens.Saml.SamlAuthorityBinding 75.8% 50%
Microsoft.IdentityModel.Tokens.Saml.SamlAuthorizationDecisionStatement 87.2% 71.4%
Microsoft.IdentityModel.Tokens.Saml.SamlConditions 100% 100%
Microsoft.IdentityModel.Tokens.Saml.SamlConstants 100%
Microsoft.IdentityModel.Tokens.Saml.SamlDoNotCacheCondition 0%
Microsoft.IdentityModel.Tokens.Saml.SamlEvidence 95% 87.5%
Microsoft.IdentityModel.Tokens.Saml.SamlSecurityToken 100% 50%
Microsoft.IdentityModel.Tokens.Saml.SamlSecurityTokenException 50%
Microsoft.IdentityModel.Tokens.Saml.SamlSecurityTokenHandler 73.6% 67.2%
Microsoft.IdentityModel.Tokens.Saml.SamlSecurityTokenReadException 50%
Microsoft.IdentityModel.Tokens.Saml.SamlSecurityTokenWriteException 50%
Microsoft.IdentityModel.Tokens.Saml.SamlSerializer 74.3% 65.2%
Microsoft.IdentityModel.Tokens.Saml.SamlSubject 64.2% 14.2%
Microsoft.IdentityModel.Tokens.Saml.SamlSubjectEqualityComparer 74.4% 58.3%
Microsoft.IdentityModel.Tokens.Saml.SamlSubjectStatement 100% 50%
Microsoft.IdentityModel.Tokens.Saml.SamlTokenUtilities 84% 77.4%
Microsoft.IdentityModel.Tokens.Saml2.AbsoluteUriCollection 40% 25%
Microsoft.IdentityModel.Tokens.Saml2.AuthenticationInformation 0% 0%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Action 86.6% 100%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Advice 100%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Assertion 94.6% 60%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Attribute 96.8% 70%
Microsoft.IdentityModel.Tokens.Saml2.Saml2AttributeKeyComparer 91.6% 62.5%
Microsoft.IdentityModel.Tokens.Saml2.Saml2AttributeStatement 58.8% 25%
Microsoft.IdentityModel.Tokens.Saml2.Saml2AudienceRestriction 84.6% 50%
Microsoft.IdentityModel.Tokens.Saml2.Saml2AuthenticationContext 100% 100%
Microsoft.IdentityModel.Tokens.Saml2.Saml2AuthenticationStatement 100% 50%
Microsoft.IdentityModel.Tokens.Saml2.Saml2AuthorizationDecisionStatement 75.8% 71.4%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Conditions 60% 25%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Constants 96.8%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Evidence 33.3% 0%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Id 73.3% 50%
Microsoft.IdentityModel.Tokens.Saml2.Saml2NameIdentifier 92.5% 83.3%
Microsoft.IdentityModel.Tokens.Saml2.Saml2ProxyRestriction 42.8% 0%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityToken 100% 50%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenException 50%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler 78.6% 70.2%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenReadException 50%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenWriteException 25%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Serializer 52.5% 43.5%
Microsoft.IdentityModel.Tokens.Saml2.Saml2Subject 57.1% 0%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SubjectConfirmation 73% 50%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SubjectConfirmationData 90% 83.3%
Microsoft.IdentityModel.Tokens.Saml2.Saml2SubjectLocality 0%
Microsoft.IdentityModel.Tokens.Tests - 4.6%
Name Line Branch
Microsoft.IdentityModel.Tokens.Tests 4.6% 4.2%
AutoGeneratedProgram 0%
Microsoft.IdentityModel.TestUtils.CustomAsymmetricSignatureProvider 0% 0%
Microsoft.IdentityModel.TestUtils.CustomCryptoProvider 55.5% 46.1%
Microsoft.IdentityModel.TestUtils.CustomCryptoProviderFactory 62.6% 47%
Microsoft.IdentityModel.TestUtils.CustomHashAlgorithm 0%
Microsoft.IdentityModel.TestUtils.CustomKeyedHashAlgorithm 0% 0%
Microsoft.IdentityModel.TestUtils.CustomRsaSecurityKey 0%
Microsoft.IdentityModel.TestUtils.CustomSignatureProvider 68.7% 25%
Microsoft.IdentityModel.TestUtils.CustomSymmetricSignatureProvider 0% 0%
Microsoft.IdentityModel.TestUtils.IdentityComparerTests 0% 0%
Microsoft.IdentityModel.Tokens.Json.Tests.DataSets 58.6%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonData 100%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonSerializerPrimitivesTests 0% 0%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonUtilities 45.3% 50%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonWebKeySerializationTests 0% 0%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonWebKeySetSerializationTests 0% 0%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonWebKeySetTests 0% 0%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonWebKeySetTheoryData 0%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonWebKeyTests 0% 0%
Microsoft.IdentityModel.Tokens.Json.Tests.JsonWebKeyTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.AbstractVirtualsTests 0%
Microsoft.IdentityModel.Tokens.Tests.AsymmetricAdapterTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.AsymmetricSignatureProviderTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.AsymmetricSignatureTestData 0% 0%
Microsoft.IdentityModel.Tokens.Tests.AsymmetricSignatureTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.AuthenticatedEncryptionProviderExtensi
bilityTests
0%
Microsoft.IdentityModel.Tokens.Tests.AuthenticatedEncryptionProviderTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.AuthenticatedEncryptionTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.BaseConfigurationComparerTests 0%
Microsoft.IdentityModel.Tokens.Tests.BaseConfigurationComparerTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.CallContextTests 0%
Microsoft.IdentityModel.Tokens.Tests.CaseSensitiveClaimsIdentityTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.ClaimsIdentityFactoryTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.CreateEcdhEsTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.CrossTokenTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.CrossTokenTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.CryptoExtensibilityTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.CryptoProviderCacheTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.CryptoProviderCacheTheoryData 0% 0%
Microsoft.IdentityModel.Tokens.Tests.CryptoProviderFactoryTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.CryptoProviderFactoryTheoryData 0% 0%
Microsoft.IdentityModel.Tokens.Tests.DerivedBaseConfigurationManager 0%
Microsoft.IdentityModel.Tokens.Tests.DerivedSignatureProvider 0%
Microsoft.IdentityModel.Tokens.Tests.EcdhEsTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.ECDsaAdapterTests 0%
Microsoft.IdentityModel.Tokens.Tests.ECDsaSecurityKeyTests 0%
Microsoft.IdentityModel.Tokens.Tests.EncryptingCredentialsTests 0%
Microsoft.IdentityModel.Tokens.Tests.EncryptingCredentialsTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.EventBasedLRUCacheTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.ExceptionSerializationBinder 0% 0%
Microsoft.IdentityModel.Tokens.Tests.InMemoryCryptoProviderCachePublic 0%
Microsoft.IdentityModel.Tokens.Tests.JsonSerializerTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.JsonWebKeyConverterTest 0% 0%
Microsoft.IdentityModel.Tokens.Tests.JsonWebKeyConverterTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.JweUsingEcdhEsTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.KeyVaultVerify 0% 0%
Microsoft.IdentityModel.Tokens.Tests.KeyWrapProviderTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.KeyWrapTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.MultiThreadingTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.MultiThreadingTokenTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.ReferenceTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.RsaCryptoServiceProviderProxyTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.RSACryptoServiceProviderProxyTheoryDat
a
0%
Microsoft.IdentityModel.Tokens.Tests.RsaKeyWrapProviderTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.RsaSecurityKeyTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SecurityKeyTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SecurityTokenExceptionTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SecurityTokenExceptionTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.SignatureProvider2K 0%
Microsoft.IdentityModel.Tokens.Tests.SignatureProviderForTestingCache 0%
Microsoft.IdentityModel.Tokens.Tests.SignatureProviderTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SignatureProviderTheoryData 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SignTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.Static.CompressionProviderFactoryTheor
yData
0%
Microsoft.IdentityModel.Tokens.Tests.Static.CustomCompressionProviderFactor
y
0%
Microsoft.IdentityModel.Tokens.Tests.Static.StaticCryptoProviderTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SupportedAlgorithmTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SupportedAlgorithmTheoryData 0% 0%
Microsoft.IdentityModel.Tokens.Tests.SymmetricSecurityKeyTests 0%
Microsoft.IdentityModel.Tokens.Tests.SymmetricSignatureProviderTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.TamperedTokenTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.TokenHandlerTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.TokenValidationParametersTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.TokenValidationResultTests 0% 0%
Microsoft.IdentityModel.Tokens.Tests.ValidateTokenTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.ValidationErrorTests 0%
Microsoft.IdentityModel.Tokens.Tests.ValidatorsTests 0%
Microsoft.IdentityModel.Tokens.Tests.X509EncryptingCredentialsTests 0%
Microsoft.IdentityModel.Tokens.Tests.X509EncryptingCredentialsTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.X509SecurityKeyTests 0%
Microsoft.IdentityModel.Tokens.Tests.X509SecurityKeyTheoryData 0%
Microsoft.IdentityModel.Tokens.Tests.X509SigningCredentialsTests 0% 0%
Microsoft.IdentityModel.Tokens.UrlEncoding.Tests.Base64UrlEncoderTests 0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.AlgorithmValidationResultTe
sts
0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.AudienceValidationResultTes
ts
0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.IssuerValidationResultsTheo
ryData
0%
Microsoft.IdentityModel.Tokens.Validation.Tests.IssuerValidationResultTests 0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.LifetimeValidationResultTes
ts
0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.ReplayValidationResultTests 0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.SigningKeyValidationResultT
ests
0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.SigningKeyValidationTheoryD
ata
0%
Microsoft.IdentityModel.Tokens.Validation.Tests.TokenReplayTheoryData 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.TokenTypeValidationResultTe
sts
0% 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.ValidateLifetimeTheoryData 0%
Microsoft.IdentityModel.Tokens.Validation.Tests.ValidationParametersTests 0%
Microsoft.IdentityModel.Validators - 95.8%
Name Line Branch
Microsoft.IdentityModel.Validators 95.8% 88.9%
Microsoft.IdentityModel.Validators.AadIssuerValidator 96.8% 91.4%
Microsoft.IdentityModel.Validators.AadTokenValidationParametersExtension 94.6% 88.8%
Microsoft.IdentityModel.Validators.IssuerLastKnownGood 88.8% 50%
Microsoft.IdentityModel.Xml - 79.3%
Name Line Branch
Microsoft.IdentityModel.Xml 79.3% 68.9%
Microsoft.IdentityModel.Xml.CanonicalizingTransfrom 100%
Microsoft.IdentityModel.Xml.DelegatingXmlDictionaryReader 48.5% 30%
Microsoft.IdentityModel.Xml.DelegatingXmlDictionaryWriter 44% 24%
Microsoft.IdentityModel.Xml.DSigElement 100%
Microsoft.IdentityModel.Xml.DSigSerializer 87.6% 74.5%
Microsoft.IdentityModel.Xml.EnvelopedSignatureReader 100% 94.1%
Microsoft.IdentityModel.Xml.EnvelopedSignatureTransform 90% 50%
Microsoft.IdentityModel.Xml.EnvelopedSignatureWriter 79.6% 60.5%
Microsoft.IdentityModel.Xml.ExclusiveCanonicalizationTransform 100% 100%
Microsoft.IdentityModel.Xml.IssuerSerial 100% 100%
Microsoft.IdentityModel.Xml.KeyInfo 89.5% 80.3%
Microsoft.IdentityModel.Xml.Reference 86.8% 72.2%
Microsoft.IdentityModel.Xml.RSAKeyValue 100% 100%
Microsoft.IdentityModel.Xml.Signature 78.1% 80%
Microsoft.IdentityModel.Xml.SignedInfo 87.1% 66.6%
Microsoft.IdentityModel.Xml.TransformFactory 92.3% 83.3%
Microsoft.IdentityModel.Xml.X509Data 93% 88.8%
Microsoft.IdentityModel.Xml.XmlException 50%
Microsoft.IdentityModel.Xml.XmlReadException 50%
Microsoft.IdentityModel.Xml.XmlToken 100% 100%
Microsoft.IdentityModel.Xml.XmlTokenStream 87% 50%
Microsoft.IdentityModel.Xml.XmlTokenStreamReader 90.9% 77.7%
Microsoft.IdentityModel.Xml.XmlTokenStreamWriter 87.5% 86.1%
Microsoft.IdentityModel.Xml.XmlUtil 57.6% 56.9%
Microsoft.IdentityModel.Xml.XmlValidationError 63.6% 50%
Microsoft.IdentityModel.Xml.XmlValidationException 38.7% 33.3%
Microsoft.IdentityModel.Xml.XmlWriteException 50%
System.IdentityModel.Tokens.Jwt - 83.8%
Name Line Branch
System.IdentityModel.Tokens.Jwt 83.8% 78.3%
System.IdentityModel.Tokens.Jwt.JwtHeader 89.6% 79%
System.IdentityModel.Tokens.Jwt.JwtPayload 84% 82.2%
System.IdentityModel.Tokens.Jwt.JwtSecurityToken 91% 79.7%
System.IdentityModel.Tokens.Jwt.JwtSecurityTokenConverter 92.3% 83.3%
System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler 80.9% 76%
System.IdentityModel.Tokens.Jwt.Tests - 20.1%
Name Line Branch
System.IdentityModel.Tokens.Jwt.Tests 20.1% 0.7%
AutoGeneratedProgram 0%
System.IdentityModel.Tokens.Jwt.Tests.AESKeyWrap_AES_128_CBC_HMAC_SHA_256 0%
System.IdentityModel.Tokens.Jwt.Tests.AudienceValidationTests 0%
System.IdentityModel.Tokens.Jwt.Tests.CreateAndValidateTokens 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.CreateTokenTheoryData 0%
System.IdentityModel.Tokens.Jwt.Tests.DerivedJwtSecurityToken 0%
System.IdentityModel.Tokens.Jwt.Tests.DerivedJwtSecurityTokenHandler 0%
System.IdentityModel.Tokens.Jwt.Tests.EncodedJwts 54.8%
System.IdentityModel.Tokens.Jwt.Tests.ExtensibilityTests 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JsonClaims 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtHeaderTests 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtHeaderTheoryData 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtPayloadTestData 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtPayloadTests 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtReferenceTests 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtSecurityTokenConverterTests 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtSecurityTokenHandlerCustom 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtSecurityTokenHandlerExtensibilityT
ests
0%
System.IdentityModel.Tokens.Jwt.Tests.JwtSecurityTokenHandlerTests 4.4% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtSecurityTokenTests 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtSecurityTokenTestVariation 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtTestData 65.6%
System.IdentityModel.Tokens.Jwt.Tests.JwtTestDatasets 99.6% 50%
System.IdentityModel.Tokens.Jwt.Tests.JwtTestUtilities 0% 0%
System.IdentityModel.Tokens.Jwt.Tests.JwtTheoryData 68.7%
System.IdentityModel.Tokens.Jwt.Tests.ParametersCheckTheoryData 0%
System.IdentityModel.Tokens.Jwt.Tests.PublicJwtSecurityTokenHandler 0%
System.IdentityModel.Tokens.Jwt.Tests.RFC7520References 0%
System.IdentityModel.Tokens.Jwt.Tests.Saml2SignedTokens 0%

@pmaytak
Copy link
Contributor

pmaytak commented Nov 8, 2024

Just dropping links for related reading:
https://stackoverflow.com/questions/9666/is-accessing-a-variable-in-c-sharp-an-atomic-operation
https://www.ecma-international.org/wp-content/uploads/ECMA-335_6th_edition_june_2012.pdf

@brentschmaltz brentschmaltz force-pushed the brentsch/SyncAfter branch 3 times, most recently from d1d31c6 to 54b2cfb Compare November 22, 2024 04:03
private TimeSpan _lastKnownGoodLifetime = DefaultLastKnownGoodConfigurationLifetime;
private BaseConfiguration _lastKnownGoodConfiguration;
private DateTime? _lastKnownGoodConfigFirstUse;
internal Random _random = new();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be private and static?

Comment on lines +29 to +30
internal int _timeInSecondsWhenLastRefreshOccurred;
internal int _timeInSecondsWhenLastRequestRefreshWasRequested;
Copy link
Contributor

Choose a reason for hiding this comment

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

Internal variables should be cased as TimeInSecondsWhenLastRefreshOccurred, TimeInSecondsWhenLastRequestRefreshWasRequested.

Comment on lines +19 to +22
internal double _automaticRefreshIntervalInSeconds = DefaultAutomaticRefreshInterval.TotalSeconds;
internal double _maxJitter = DefaultAutomaticRefreshInterval.TotalSeconds / 20;
private TimeSpan _refreshInterval = DefaultRefreshInterval;
internal double _requestRefreshIntervalInSeconds = DefaultRefreshInterval.TotalSeconds;
Copy link
Contributor

Choose a reason for hiding this comment

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

Internal variables should be cased as AutomaticRefreshIntervalInSeconds, MaxJitter, RequestRefreshIntervalInSeconds.

private TimeSpan _lastKnownGoodLifetime = DefaultLastKnownGoodConfigurationLifetime;
private BaseConfiguration _lastKnownGoodConfiguration;
private DateTime? _lastKnownGoodConfigFirstUse;
internal Random _random = new();

// Seconds since the BaseConfigurationManager was created when the last refresh occurred with a %5 random jitter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Seconds since the BaseConfigurationManager was created when the last refresh occurred with a %5 random jitter.
// Seconds since the BaseConfigurationManager was created when the last refresh occurred with a 5% random jitter.

}

/// <summary>
/// Incremented each time <see cref="RequestRefresh"/> results in a http request.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Incremented each time <see cref="RequestRefresh"/> results in a http request.
/// Incremented each time <see cref="RequestRefresh"/> results in a HTTP request.

internal DateTimeOffset StartupTime { get; set; } = DateTimeOffset.UtcNow;

/// <summary>
/// Incremented each time <see cref="GetBaseConfigurationAsync(CancellationToken)"/> results in a http request.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Incremented each time <see cref="GetBaseConfigurationAsync(CancellationToken)"/> results in a http request.
/// Incremented each time <see cref="GetBaseConfigurationAsync(CancellationToken)"/> results in a HTTP request.

/// <summary>
/// Incremented each time <see cref="GetBaseConfigurationAsync(CancellationToken)"/> results in a http request.
/// </summary>
internal long _numberOfTimesAutomaticRefreshRequested;
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently we have to remember to use Interlocked when incrementing the variable. Can this be made private and another method be added to increment this? Something like

internal void IncrementNumberOfTimesAutomaticRefreshRequested() => Interlocked.Increment(ref NumberOfTimesAutomaticRefreshRequested);`

This way we for sure will use Interlocked when incrementing and it won't be possible to set this variable to some other value.

Same comment for _numberOfTimesRequestRefreshRequested.

Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise, can we expose methods/properties for accessing these values externally? Something like this (variables are probably wrong but this general idea):

public long NumberOfTimesAutomaticRefreshRequested => Interlocked.Read(ref _numberOfTimesAutomaticRefreshRequested);

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.

[Bug] Race condition on ConfigurationManager._syncAfter
5 participants