NIFI-11690 - include extension info for SupportsSensitiveDynamicPrope… (#7379)

* NIFI-11690 - include extension info for SupportsSensitiveDynamicProperties in C2 manifest
* NIFI-11690 - include extension info for SupportsSensitiveDynamicProperties in C2 manifest
* NIFI-11690 - include extension info for SupportsSensitiveDynamicProperties in C2 manifest
This commit is contained in:
greyp9 2023-06-15 11:27:51 -04:00 committed by Bryan Bende
parent c21c0e27eb
commit b6d4099a14
No known key found for this signature in database
GPG Key ID: A0DDA9ED50711C39
5 changed files with 31 additions and 0 deletions

View File

@ -34,6 +34,10 @@ public interface ConfigurableComponentDefinition {
void setSupportsDynamicProperties(boolean supportsDynamicProperties);
boolean getSupportsSensitiveDynamicProperties();
void setSupportsSensitiveDynamicProperties(boolean supportsSensitiveDynamicProperties);
List<DynamicProperty> getDynamicProperties();
void setDynamicProperties(List<DynamicProperty> dynamicProperties);

View File

@ -28,6 +28,8 @@ public abstract class ConfigurableExtensionDefinition extends ExtensionComponent
private Map<String, PropertyDescriptor> propertyDescriptors;
private boolean supportsDynamicProperties;
private boolean supportsSensitiveDynamicProperties;
private List<DynamicProperty> dynamicProperties;
@Override
@ -52,6 +54,17 @@ public abstract class ConfigurableExtensionDefinition extends ExtensionComponent
this.supportsDynamicProperties = supportsDynamicProperties;
}
@Override
@ApiModelProperty("Whether or not this component makes use of sensitive dynamic (user-set) properties.")
public boolean getSupportsSensitiveDynamicProperties() {
return supportsSensitiveDynamicProperties;
}
@Override
public void setSupportsSensitiveDynamicProperties(boolean supportsSensitiveDynamicProperties) {
this.supportsSensitiveDynamicProperties = supportsSensitiveDynamicProperties;
}
@Override
@ApiModelProperty("Describes the dynamic properties supported by this component")
public List<DynamicProperty> getDynamicProperties() {

View File

@ -51,6 +51,8 @@ public class Extension {
@XmlElement(name = "property")
private List<Property> properties;
private boolean supportsSensitiveDynamicProperties;
@XmlElementWrapper
@XmlElement(name = "dynamicProperty")
private List<DynamicProperty> dynamicProperties;
@ -154,6 +156,14 @@ public class Extension {
this.properties = properties;
}
public boolean getSupportsSensitiveDynamicProperties() {
return supportsSensitiveDynamicProperties;
}
public void setSupportsSensitiveDynamicProperties(boolean supportsSensitiveDynamicProperties) {
this.supportsSensitiveDynamicProperties = supportsSensitiveDynamicProperties;
}
@ApiModelProperty(value = "The dynamic properties of the extension")
public List<DynamicProperty> getDynamicProperties() {
return dynamicProperties;

View File

@ -504,6 +504,7 @@ public class StandardRuntimeManifestBuilder implements RuntimeManifestBuilder {
final List<DynamicProperty> dynamicProperties = extension.getDynamicProperties();
if (isNotEmpty(dynamicProperties)) {
configurableComponentDefinition.setSupportsDynamicProperties(true);
configurableComponentDefinition.setSupportsSensitiveDynamicProperties(extension.getSupportsSensitiveDynamicProperties());
configurableComponentDefinition.setDynamicProperties(
dynamicProperties.stream()
.map(this::getDynamicProperty)

View File

@ -105,6 +105,7 @@ class TestRuntimeManifest {
assertFalse(listHdfsDefinition.getSideEffectFree());
assertFalse(listHdfsDefinition.getTriggerWhenAnyDestinationAvailable());
assertFalse(listHdfsDefinition.getSupportsDynamicProperties());
assertFalse(listHdfsDefinition.getSupportsSensitiveDynamicProperties());
assertNull(listHdfsDefinition.getDynamicProperties());
assertFalse(listHdfsDefinition.getSupportsDynamicRelationships());
assertNull(listHdfsDefinition.getDynamicRelationship());
@ -251,6 +252,7 @@ class TestRuntimeManifest {
assertFalse(executeSqlDef.getReadsAttributes().isEmpty());
assertNotNull(executeSqlDef.getReadsAttributes().get(0).getName());
assertNotNull(executeSqlDef.getReadsAttributes().get(0).getDescription());
assertTrue(executeSqlDef.getSupportsSensitiveDynamicProperties());
// Verify RouteOnAttribute dynamic relationships and dynamic properties
final ProcessorDefinition routeOnAttributeDef = getProcessorDefinition(bundles, "nifi-standard-nar",
@ -262,6 +264,7 @@ class TestRuntimeManifest {
assertNotNull(routeOnAttributeDef.getDynamicRelationship().getDescription());
assertTrue(routeOnAttributeDef.getSupportsDynamicProperties());
assertFalse(routeOnAttributeDef.getSupportsSensitiveDynamicProperties());
assertNotNull(routeOnAttributeDef.getDynamicProperties());
assertFalse(routeOnAttributeDef.getDynamicProperties().isEmpty());
assertNotNull(routeOnAttributeDef.getDynamicProperties().get(0).getName());