-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathICachedSecretProvider.cs
More file actions
52 lines (47 loc) · 3.1 KB
/
ICachedSecretProvider.cs
File metadata and controls
52 lines (47 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Threading.Tasks;
using Arcus.Security.Core.Caching.Configuration;
namespace Arcus.Security.Core.Caching
{
/// <summary>
/// <see cref="ICachedSecretProvider"/> allows developers to build specific Secret key providers with caching.
/// </summary>
[Obsolete("Will be removed in v3.0 as caching will happen on the secret store itself", DiagnosticId = ObsoleteDefaults.DiagnosticId)]
public interface ICachedSecretProvider : ISecretProvider
{
/// <summary>
/// Gets the cache-configuration for this instance.
/// </summary>
[Obsolete("Will be removed in v3.0 as caching will happen on the secret store itself", DiagnosticId = ObsoleteDefaults.DiagnosticId)]
ICacheConfiguration Configuration { get; }
/// <summary>
/// Retrieves the secret value, based on the given name
/// </summary>
/// <param name="secretName">The name of the secret key</param>
/// <param name="ignoreCache">Indicates if the cache should be used or skipped</param>
/// <returns>Returns a <see cref="Task{TResult}"/> that contains the secret key</returns>
/// <exception cref="ArgumentException">The name must not be empty</exception>
/// <exception cref="ArgumentNullException">The name must not be null</exception>
/// <exception cref="SecretNotFoundException">The secret was not found, using the given name</exception>
[Obsolete("Will be removed in v3 in favor of solely using " + nameof(GetSecretAsync) + " instead", DiagnosticId = ObsoleteDefaults.DiagnosticId)]
Task<string> GetRawSecretAsync(string secretName, bool ignoreCache);
/// <summary>
/// Retrieves the secret value, based on the given name
/// </summary>
/// <param name="secretName">The name of the secret key</param>
/// <param name="ignoreCache">Indicates if the cache should be used or skipped</param>
/// <returns>Returns a <see cref="Task{TResult}"/> that contains the secret key</returns>
/// <exception cref="ArgumentException">The name must not be empty</exception>
/// <exception cref="ArgumentNullException">The name must not be null</exception>
/// <exception cref="SecretNotFoundException">The secret was not found, using the given name</exception>
[Obsolete("Will be removed in v3.0 as caching will happen on the secret store itself", DiagnosticId = ObsoleteDefaults.DiagnosticId)]
Task<Secret> GetSecretAsync(string secretName, bool ignoreCache);
/// <summary>
/// Removes the secret with the given <paramref name="secretName"/> from the cache;
/// so the next time <see cref="CachedSecretProvider.GetSecretAsync(string)"/> is called, a new version of the secret will be added back to the cache.
/// </summary>
/// <param name="secretName">The name of the secret that should be removed from the cache.</param>
[Obsolete("Will be removed in v3.0 as caching will happen on the secret store itself", DiagnosticId = ObsoleteDefaults.DiagnosticId)]
Task InvalidateSecretAsync(string secretName);
}
}