NIFI-16100 Allow non-sensitive connector properties to reference Secrets Manager values - #11425
NIFI-16100 Allow non-sensitive connector properties to reference Secrets Manager values#11425pvillard31 wants to merge 1 commit into
Conversation
…ets Manager values
912df66 to
89e16a3
Compare
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for implementing this new feature @pvillard31. The changes look good, I noted a couple minor recommendations on the test classes. If you can address those and rebase the branch, this should be ready to go.
| import static org.mockito.Mockito.mock; | ||
| import static org.mockito.Mockito.when; | ||
|
|
||
| public class TestParameterProviderSecretProvider { |
There was a problem hiding this comment.
The public modifiers can be removed
| @Test | ||
| public void testTagValueTrueLowercaseIsUnrestricted() { | ||
| assertEquals(PropertyProtectionType.UNRESTRICTED, classify(TAG_NAME, List.of(new ParameterTag(TAG_NAME, "true")))); | ||
| } | ||
|
|
||
| @Test | ||
| public void testTagValueTrueTitlecaseIsUnrestricted() { | ||
| assertEquals(PropertyProtectionType.UNRESTRICTED, classify(TAG_NAME, List.of(new ParameterTag(TAG_NAME, "True")))); | ||
| } | ||
|
|
||
| @Test | ||
| public void testTagValueTrueUppercaseIsUnrestricted() { | ||
| assertEquals(PropertyProtectionType.UNRESTRICTED, classify(TAG_NAME, List.of(new ParameterTag(TAG_NAME, "TRUE")))); | ||
| } | ||
|
|
||
| @Test | ||
| public void testTagValueFalseIsRestricted() { | ||
| assertEquals(PropertyProtectionType.RESTRICTED, classify(TAG_NAME, List.of(new ParameterTag(TAG_NAME, "false")))); | ||
| } | ||
|
|
||
| @Test | ||
| public void testTagValueNullIsRestricted() { | ||
| assertEquals(PropertyProtectionType.RESTRICTED, classify(TAG_NAME, List.of(new ParameterTag(TAG_NAME, null)))); | ||
| } | ||
|
|
||
| @Test | ||
| public void testTagKeyMismatchIsRestricted() { | ||
| assertEquals(PropertyProtectionType.RESTRICTED, classify(TAG_NAME, List.of(new ParameterTag("other-tag", "true")))); | ||
| } |
There was a problem hiding this comment.
It looks like a number of these methods could be collapsed into a ParameterizedTest
| connectorNode.transitionStateForUpdating(); | ||
| connectorNode.prepareForUpdate(); | ||
| final Map<String, ConnectorValueReference> propertyValues = new HashMap<>(); | ||
| propertyValues.put("StringProp", new SecretReference("pid", "My Provider", "my-secret", "My Provider.my-secret")); |
There was a problem hiding this comment.
The SecretReference and some other variables can be declared once and reused across several test methods.
exceptionfactory
left a comment
There was a problem hiding this comment.
Following up on this pull request, if the feedback can be addressed, and the branch rebased, it should be close to completion
Summary
NIFI-16100 Allow non-sensitive connector properties to reference Secrets Manager values
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation