This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-api.git
The following commit(s) were added to refs/heads/main by this push:
new b377b75 NIFI-16063 Added PropertyProtectionType for Secrets used in
Connector Properties (#101)
b377b75 is described below
commit b377b75f4f5068d0c4a546f77bd4c54f2bc9b0d2
Author: Pierre Villard <[email protected]>
AuthorDate: Mon Jul 6 16:54:52 2026 +0200
NIFI-16063 Added PropertyProtectionType for Secrets used in Connector
Properties (#101)
Signed-off-by: David Handermann <[email protected]>
---
.../{Secret.java => PropertyProtectionType.java} | 33 +++++++++++-----------
.../apache/nifi/components/connector/Secret.java | 11 ++++++++
2 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/src/main/java/org/apache/nifi/components/connector/Secret.java
b/src/main/java/org/apache/nifi/components/connector/PropertyProtectionType.java
similarity index 60%
copy from src/main/java/org/apache/nifi/components/connector/Secret.java
copy to
src/main/java/org/apache/nifi/components/connector/PropertyProtectionType.java
index c11598a..a101cb3 100644
--- a/src/main/java/org/apache/nifi/components/connector/Secret.java
+++
b/src/main/java/org/apache/nifi/components/connector/PropertyProtectionType.java
@@ -17,20 +17,21 @@
package org.apache.nifi.components.connector;
-public interface Secret {
-
- String getProviderId();
-
- String getProviderName();
-
- String getGroupName();
-
- String getName();
-
- String getDescription();
-
- String getValue();
-
- String getFullyQualifiedName();
-
+/**
+ * Indicates whether a {@link Secret} may be referenced only by sensitive
properties or may also
+ * be referenced by non-sensitive properties.
+ */
+public enum PropertyProtectionType {
+
+ /**
+ * The secret may only be referenced by sensitive properties, that is,
properties declared
+ * with {@link PropertyType#SECRET}. This is the default classification.
+ */
+ RESTRICTED,
+
+ /**
+ * The owner of the secret has authorized it to be referenced by any
property, including
+ * non-sensitive properties.
+ */
+ UNRESTRICTED
}
diff --git a/src/main/java/org/apache/nifi/components/connector/Secret.java
b/src/main/java/org/apache/nifi/components/connector/Secret.java
index c11598a..58d6a44 100644
--- a/src/main/java/org/apache/nifi/components/connector/Secret.java
+++ b/src/main/java/org/apache/nifi/components/connector/Secret.java
@@ -33,4 +33,15 @@ public interface Secret {
String getFullyQualifiedName();
+ /**
+ * Indicates whether this secret may be referenced only by sensitive
properties or may also be
+ * referenced by non-sensitive properties. Defaults to {@link
PropertyProtectionType#RESTRICTED},
+ * preserving the behavior that a secret may only be referenced by
sensitive properties.
+ *
+ * @return the property protection type for this secret; never null
+ */
+ default PropertyProtectionType getPropertyProtectionType() {
+ return PropertyProtectionType.RESTRICTED;
+ }
+
}