< Summary

Information
Class: ArturRios.Util.WebApi.Security.Providers.CachedAuthenticationProviderOptions
Assembly: ArturRios.Util.WebApi
File(s): D:\Repositories\dotnet-webapi-util\src\Security\Providers\CachedAuthenticationProviderOptions.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 27
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 4
Fully covered methods: 4
Total methods: 4
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Ttl()100%11100%
get_CacheMisses()100%11100%
get_CacheKeyPrefix()100%11100%
get_EmailCacheKeyPrefix()100%11100%

File(s)

D:\Repositories\dotnet-webapi-util\src\Security\Providers\CachedAuthenticationProviderOptions.cs

#LineLine coverage
 1namespace ArturRios.Util.WebApi.Security.Providers;
 2
 3/// <summary>
 4/// Options for <see cref="CachedAuthenticationProvider"/>.
 5/// </summary>
 6public class CachedAuthenticationProviderOptions
 7{
 8    /// <summary>
 9    /// How long a resolved user stays cached before the underlying provider is queried again.
 10    /// Defaults to 60 seconds. Keep it short so role changes and revocations surface quickly.
 11    /// </summary>
 1812    public TimeSpan Ttl { get; set; } = TimeSpan.FromSeconds(60);
 13
 14    /// <summary>
 15    /// When <see langword="true"/>, "user not found" results are also cached for <see cref="Ttl"/>
 16    /// (negative caching), shielding the store from repeated lookups of unknown ids. Defaults to <see langword="false"/
 17    /// </summary>
 618    public bool CacheMisses { get; set; }
 19
 20    /// <summary>
 21    /// The prefix used to build the cache key for each user id. Defaults to <c>auth:user:</c>.
 22    /// </summary>
 1923    public string CacheKeyPrefix { get; set; } = "auth:user:";
 24
 25    /// <summary>The prefix used to build the cache key for each user email. Defaults to <c>auth:email:</c>.</summary>
 1326    public string EmailCacheKeyPrefix { get; set; } = "auth:email:";
 27}