Github user mcgilman commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2177#discussion_r141157943
--- Diff:
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
---
@@ -886,18 +893,70 @@ public String getOidcPreferredJwsAlgorithm() {
}
/**
+ * Returns whether Knox SSO is enabled.
+ *
+ * @return whether Knox SSO is enabled
+ */
+ public boolean isKnoxSsoEnabled() {
+ return !StringUtils.isBlank(getKnoxUrl());
+ }
+
+ /**
+ * Returns the Knox URL.
+ *
+ * @return Knox URL
+ */
+ public String getKnoxUrl() {
+ return getProperty(SECURITY_USER_KNOX_URL);
+ }
+
+ /**
+ * Gets the configured Knox Audiences.
+ *
+ * @return Knox audiences
+ */
+ public Set<String> getKnoxAudiences() {
+ final String rawAudiences =
getProperty(SECURITY_USER_KNOX_AUDIENCES);
+ if (StringUtils.isBlank(rawAudiences)) {
+ return null;
--- End diff --
While it's not possible to realize the distinction when configuring the
properties file and using isBlank, I typically use null for unset while an
empty Set would indicate the value is configured with no values. I'm happy to
make this change if you want me to.
---