Skip to content

Commit

Permalink
Suppressing unchecked warning, making credential strings constants
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis committed Nov 27, 2023
1 parent f345965 commit 8fdb93e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private Template processTemplateCredentials(Template template, Function<String,
for (WorkflowNode node : entry.getValue().nodes()) {
if (node.userInputs().containsKey(CREDENTIAL_FIELD)) {
// Apply the cipher funcion on all values within credential field
@SuppressWarnings("unchecked")
Map<String, String> credentials = (Map<String, String>) node.userInputs().get(CREDENTIAL_FIELD);
credentials.replaceAll((key, cred) -> cipherFunction.apply(cred));

Expand Down Expand Up @@ -170,7 +171,7 @@ private Template processTemplateCredentials(Template template, Function<String,
* @param credential the credential to encrypt
* @return the encrypted credential
*/
protected String encrypt(String credential) {
protected String encrypt(final String credential) {
initializeMasterKeyIfAbsent();
final AwsCrypto crypto = AwsCrypto.builder().withCommitmentPolicy(CommitmentPolicy.RequireEncryptRequireDecrypt).build();
byte[] bytes = Base64.getDecoder().decode(masterKey);
Expand All @@ -187,7 +188,7 @@ protected String encrypt(String credential) {
* @param encryptedCredential the credential to decrypt
* @return the decrypted credential
*/
protected String decrypt(String encryptedCredential) {
protected String decrypt(final String encryptedCredential) {
initializeMasterKeyIfAbsent();
final AwsCrypto crypto = AwsCrypto.builder().withCommitmentPolicy(CommitmentPolicy.RequireEncryptRequireDecrypt).build();

Expand Down

0 comments on commit 8fdb93e

Please sign in to comment.