From 8c09a5c8d269a0bff7e6635581dc7ed316170f8c Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 19 Apr 2016 09:23:15 -0400 Subject: [PATCH] NIFI-1783: - Addressing mistake in exmample XML. - Ensuring the configured Authorizer is loaded correctly. This closes #363. Signed-off-by: Bryan Bende --- .../nifi-framework-bundle/nifi-framework-nar/pom.xml | 4 ++++ .../nifi-framework/nifi-file-authorizer/pom.xml | 5 ++--- .../org/apache/nifi/authorization/FileAuthorizer.java | 8 ++++---- .../src/main/resources/conf/authorizers.xml | 4 ++-- nifi-nar-bundles/nifi-framework-bundle/pom.xml | 5 +++++ 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml index bd8272a2f6..104aa10d8f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework-nar/pom.xml @@ -31,6 +31,10 @@ org.apache.nifi nifi-jetty + + org.apache.nifi + nifi-file-authorizer + diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/pom.xml index 53f35f412a..0673b97795 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/pom.xml @@ -41,7 +41,7 @@ xjc - org.apache.nifi.authorization.generated + org.apache.nifi.authorization.file.generated @@ -53,10 +53,9 @@ org.apache.maven.plugins maven-checkstyle-plugin - **/authorization/generated/*.java + **/authorization/file/generated/*.java - diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAuthorizer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAuthorizer.java index 8529caf149..a9236ff06a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAuthorizer.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAuthorizer.java @@ -20,9 +20,9 @@ import org.apache.commons.lang3.StringUtils; import org.apache.nifi.authorization.annotation.AuthorizerContext; import org.apache.nifi.authorization.exception.AuthorizationAccessException; import org.apache.nifi.authorization.exception.AuthorizerCreationException; -import org.apache.nifi.authorization.generated.Authorization; -import org.apache.nifi.authorization.generated.Resource; -import org.apache.nifi.authorization.generated.Resources; +import org.apache.nifi.authorization.file.generated.Authorization; +import org.apache.nifi.authorization.file.generated.Resources; +import org.apache.nifi.authorization.file.generated.Resource; import org.apache.nifi.components.PropertyValue; import org.apache.nifi.util.NiFiProperties; import org.apache.nifi.util.file.FileUtils; @@ -62,7 +62,7 @@ public class FileAuthorizer implements Authorizer { private static final String READ_CODE = "R"; private static final String WRITE_CODE = "W"; private static final String USERS_XSD = "/authorizations.xsd"; - private static final String JAXB_GENERATED_PATH = "org.apache.nifi.authorization.generated"; + private static final String JAXB_GENERATED_PATH = "org.apache.nifi.authorization.file.generated"; private static final JAXBContext JAXB_CONTEXT = initializeJaxbContext(); /** diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml index 01ccd9c92a..2332b5e9a3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/authorizers.xml @@ -19,10 +19,10 @@ must be specified in the nifi.properties file. --> - + file-provider org.apache.nifi.authorization.FileAuthorizer ./conf/authorizations.xml 30 secs - + \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-framework-bundle/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/pom.xml index 9edf1f6c7e..c1bdb0814b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/pom.xml @@ -113,6 +113,11 @@ nifi-documentation 1.0.0-SNAPSHOT + + org.apache.nifi + nifi-file-authorizer + 1.0.0-SNAPSHOT +