Skip to content

Commit d40678b

Browse files
authored
chore: remove deprecated secret store functionality (#426)
* chore: remove deprecated secret store functionality * pr-fix: correct grouped secret store unit tests * pr-fix: add additional test assertions on get interface provider
1 parent de11c91 commit d40678b

File tree

7 files changed

+44
-252
lines changed

7 files changed

+44
-252
lines changed

src/Arcus.Security.Core/Caching/Configuration/CacheConfiguration.cs

-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ namespace Arcus.Security.Core.Caching.Configuration
88
/// </summary>
99
public class CacheConfiguration : ICacheConfiguration
1010
{
11-
/// <summary>
12-
/// Initializes a new instance of the <see cref="CacheConfiguration"/> class with default cache entry of 5 minutes.
13-
/// </summary>
14-
[Obsolete ("Use the " + nameof(Default) + " static property to retrieve a default caching configuration instance")]
15-
public CacheConfiguration() : this(TimeSpan.FromMinutes(5))
16-
{
17-
}
18-
1911
/// <summary>
2012
/// Initializes a new instance of the <see cref="CacheConfiguration"/> class.
2113
/// </summary>

src/Arcus.Security.Core/SecretStoreBuilder.cs

+4-14
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ public SecretStoreBuilder(IServiceCollection services)
3838
/// <summary>
3939
/// Gets the available secret sources currently registered to be included in the resulting root secret store.
4040
/// </summary>
41-
/// <remarks>
42-
/// The series of secret stores is directly publicly available including the operations so future (consumer) extensions can easily low-level manipulate this series during build-up.
43-
/// Though, for almost all use-cases, the <see cref="AddProvider(ISecretProvider,Func{string,string})"/> and the <see cref="AddProvider(Func{IServiceProvider,ISecretProvider},Func{string,string})"/> should be sufficient.
44-
/// </remarks>
4541
public IList<SecretStoreSource> SecretStoreSources { get; } = new List<SecretStoreSource>();
4642

4743
/// <summary>
@@ -63,17 +59,15 @@ public SecretStoreBuilder(IServiceCollection services)
6359
/// Adds an <see cref="ISecretProvider"/> implementation to the secret store of the application.
6460
/// </summary>
6561
/// <param name="secretProvider">The provider which secrets are added to the secret store.</param>
66-
/// <param name="mutateSecretName">The optional function to mutate the secret name before looking it up.</param>
6762
/// <returns>
6863
/// The extended secret store with the given <paramref name="secretProvider"/>.
6964
/// </returns>
7065
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="secretProvider"/> is <c>null</c>.</exception>
71-
[Obsolete("Consider using the " + nameof(AddProvider) + " overload with the " + nameof(SecretProviderOptions.MutateSecretName) + " instead")]
72-
public SecretStoreBuilder AddProvider(ISecretProvider secretProvider, Func<string, string> mutateSecretName = null)
66+
public SecretStoreBuilder AddProvider(ISecretProvider secretProvider)
7367
{
7468
Guard.NotNull(secretProvider, nameof(secretProvider), "Requires a secret provider to add to the secret store");
7569

76-
return AddProvider(secretProvider, options => options.MutateSecretName = mutateSecretName);
70+
return AddProvider(secretProvider, configureOptions: null);
7771
}
7872

7973
/// <summary>
@@ -111,19 +105,15 @@ public SecretStoreBuilder AddProvider(
111105
/// Adds an <see cref="ISecretProvider"/> implementation to the secret store of the application.
112106
/// </summary>
113107
/// <param name="createSecretProvider">The function to create a provider which secrets are added to the secret store.</param>
114-
/// <param name="mutateSecretName">The optional function to mutate the secret name before looking it up.</param>
115108
/// <returns>
116109
/// The extended secret store with the given <paramref name="createSecretProvider"/> as lazy initialization.
117110
/// </returns>
118111
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="createSecretProvider"/> is <c>null</c>.</exception>
119-
[Obsolete("Consider using the " + nameof(AddProvider) + " overload with the " + nameof(SecretProviderOptions.MutateSecretName) + " instead")]
120-
public SecretStoreBuilder AddProvider(
121-
Func<IServiceProvider, ISecretProvider> createSecretProvider,
122-
Func<string, string> mutateSecretName = null)
112+
public SecretStoreBuilder AddProvider(Func<IServiceProvider, ISecretProvider> createSecretProvider)
123113
{
124114
Guard.NotNull(createSecretProvider, nameof(createSecretProvider), "Requires a function to create a secret provider to add to the secret store");
125115

126-
return AddProvider(createSecretProvider, options => options.MutateSecretName = mutateSecretName);
116+
return AddProvider(createSecretProvider, configureOptions: null);
127117
}
128118

129119
/// <summary>

src/Arcus.Security.Core/SecretStoreSource.cs

-42
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@ public class SecretStoreSource
1717

1818
private ISecretProvider _secretProvider;
1919

20-
/// <summary>
21-
/// Initializes a new instance of the <see cref="SecretStoreSource"/> class.
22-
/// </summary>
23-
/// <param name="createSecretProvider">The function to create a secret provider to add to the secret store.</param>
24-
/// <param name="mutateSecretName">The optional mutation function to transform secret names.</param>
25-
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="createSecretProvider"/> is <c>null</c>.</exception>
26-
[Obsolete("Use the other constructor overload with the " + nameof(SecretProviderOptions) + " instead")]
27-
public SecretStoreSource(
28-
Func<IServiceProvider, ISecretProvider> createSecretProvider,
29-
Func<string, string> mutateSecretName = null)
30-
: this(createSecretProvider, new SecretProviderOptions { MutateSecretName = mutateSecretName })
31-
{
32-
}
33-
3420
/// <summary>
3521
/// Initializes a new instance of the <see cref="SecretStoreSource"/> class.
3622
/// </summary>
@@ -48,18 +34,6 @@ public SecretStoreSource(
4834
Options = options ?? new SecretProviderOptions();
4935
}
5036

51-
/// <summary>
52-
/// Initializes a new instance of the <see cref="SecretStoreSource"/> class.
53-
/// </summary>
54-
/// <param name="secretProvider">The secret provider to add to the secret store.</param>
55-
/// <param name="mutateSecretName">The optional mutation function to transform secret names.</param>
56-
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="secretProvider"/> is <c>null</c>.</exception>
57-
[Obsolete("Use the other constructor overload with the " + nameof(SecretProviderOptions) + " instead")]
58-
public SecretStoreSource(ISecretProvider secretProvider, Func<string, string> mutateSecretName = null)
59-
: this(secretProvider, new SecretProviderOptions { MutateSecretName = mutateSecretName})
60-
{
61-
}
62-
6337
/// <summary>
6438
/// Initializes a new instance of the <see cref="SecretStoreSource"/> class.
6539
/// </summary>
@@ -78,10 +52,6 @@ public SecretStoreSource(ISecretProvider secretProvider, SecretProviderOptions o
7852
/// Gets the provider for this secret store.
7953
/// </summary>
8054
/// <exception cref="InvalidOperationException">Thrown when the <see cref="EnsureSecretProviderCreated"/> was not yet called after creating a lazy secret provider source.</exception>
81-
/// <remarks>
82-
/// When this secret provider source registration was initialized with the <see cref="SecretStoreSource(Func{IServiceProvider,ISecretProvider},Func{string,string})"/>
83-
/// than the <see cref="EnsureSecretProviderCreated"/> method has to be called first to initialized the lazy created <see cref="ISecretProvider"/>.
84-
/// </remarks>
8555
public ISecretProvider SecretProvider
8656
{
8757
get
@@ -100,28 +70,16 @@ public ISecretProvider SecretProvider
10070
/// <summary>
10171
/// Gets the versioned provider for this secret provider registration, if the <see cref="SecretProvider"/> is a <see cref="IVersionedSecretProvider"/> implementation.
10272
/// </summary>
103-
/// <remarks>
104-
/// When this secret provider source registration was initialized with the <see cref="SecretStoreSource(Func{IServiceProvider,ISecretProvider},Func{string,string})"/>
105-
/// than the <see cref="EnsureSecretProviderCreated"/> method has to be called first to initialized the lazy created <see cref="IVersionedSecretProvider"/>.
106-
/// </remarks>
10773
public IVersionedSecretProvider VersionedSecretProvider { get; private set; }
10874

10975
/// <summary>
11076
/// Gets the synchronous variant of this secret provider registration, if the <see cref="SecretProvider"/> is a <see cref="ISyncSecretProvider"/> implementation.
11177
/// </summary>
112-
/// <remarks>
113-
/// When this secret provider source registration was initialized with the <see cref="SecretStoreSource(Func{IServiceProvider,ISecretProvider},Func{string,string})"/>
114-
/// than the <see cref="EnsureSecretProviderCreated"/> method has to be called first to initialized the lazy created <see cref="ISyncSecretProvider"/>.
115-
/// </remarks>
11678
public ISyncSecretProvider SyncSecretProvider { get; private set; }
11779

11880
/// <summary>
11981
/// Gets the cached provider for this secret provider registration, if the <see cref="SecretProvider"/> is a <see cref="ICachedSecretProvider"/> implementation.
12082
/// </summary>
121-
/// <remarks>
122-
/// When this secret provider source registration was initialized with the <see cref="SecretStoreSource(Func{IServiceProvider,ISecretProvider},Func{string,string})"/>
123-
/// than the <see cref="EnsureSecretProviderCreated"/> method has to be called first to initialized the lazy created <see cref="ICachedSecretProvider"/>.
124-
/// </remarks>
12583
public ICachedSecretProvider CachedSecretProvider { get; private set; }
12684

12785
/// <summary>

0 commit comments

Comments
 (0)