-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prefix support for AWS secrets fetch (#154)
* Add prefix support for AWS secrets fetch * Use @EnabledIfEnvironmentVariable annotation. Use AWS_SECRET* env variable instead of RO_AWS_SECRET* to allow correct initialization of default AWS secret manager. * Add test for map secrets with both prefix and tag filtering * changelog
- Loading branch information
1 parent
728557a
commit 6ac5165
Showing
6 changed files
with
418 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
keystorage/aws/src/test/java/tech/pegasys/signers/aws/AwsSecret.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2022 ConsenSys AG. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package tech.pegasys.signers.aws; | ||
|
||
import java.util.Objects; | ||
|
||
public class AwsSecret { | ||
private final String secretValue; | ||
private final String tagKey; | ||
private final String tagValue; | ||
|
||
public AwsSecret(final String secretValue, final String tagKey, final String tagValue) { | ||
this.secretValue = secretValue; | ||
this.tagKey = tagKey; | ||
this.tagValue = tagValue; | ||
} | ||
|
||
public String getSecretValue() { | ||
return secretValue; | ||
} | ||
|
||
public String getTagKey() { | ||
return tagKey; | ||
} | ||
|
||
public String getTagValue() { | ||
return tagValue; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
AwsSecret that = (AwsSecret) o; | ||
return secretValue.equals(that.secretValue) | ||
&& tagKey.equals(that.tagKey) | ||
&& tagValue.equals(that.tagValue); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(secretValue, tagKey, tagValue); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.