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

Allow for a list and no searching for keys #46

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Requested rename
  • Loading branch information
scott-phillips-ah committed Mar 30, 2021
commit 1c0140350ea5dd4ce5725590ce323b4b3a7399b4
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ private async Task<IReadOnlyList<SecretListEntry>> FetchAllSecretsAsync(Cancella

var result = new List<SecretListEntry>();

if (Options.DefinedSecretArns.Count > 0)
if (Options.AcceptedSecretArns.Count > 0)
{
result.AddRange(Options.DefinedSecretArns.Select(x => new SecretListEntry(){ARN = x}));
result.AddRange(Options.AcceptedSecretArns.Select(x => new SecretListEntry(){ARN = x}));
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Kralizek.Extensions.Configuration.Internal
{
public class SecretsManagerConfigurationProviderOptions
{
public List<string> DefinedSecretArns { get; set; } = new List<string>();
public List<string> AcceptedSecretArns { get; set; } = new();

public Func<SecretListEntry, bool> SecretFilter { get; set; } = _ => true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void Secrets_can_be_listed_explicitly_and_not_searched([Frozen] SecretLis
Mock.Get(secretsManager).Setup(p => p.GetSecretValueAsync(It.Is<GetSecretValueRequest>(x => x.SecretId.Equals(firstSecretArn)), It.IsAny<CancellationToken>())).ReturnsAsync(getSecretValueResponse);

options.SecretFilter = entry => true;
options.DefinedSecretArns = new List<string> {firstSecretArn};
options.AcceptedSecretArns = new List<string> {firstSecretArn};
options.KeyGenerator = (entry, key) => secretKey;

sut.Load();
Expand Down