[ 
https://issues.apache.org/jira/browse/NIFI-4708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16316797#comment-16316797
 ] 

ASF GitHub Bot commented on NIFI-4708:
--------------------------------------

Github user alopresto commented on the issue:

    https://github.com/apache/nifi/pull/2376
  
    Ran `contrib-check` and all tests pass. 
    
    Ran a few scenarios using the tool. Everything looks good. The only slight 
issue was when I intentionally ran with the wrong arguments and it looks like 
the error message contains the whole option object and stacktrace in addition 
to the flag, but it's clear enough for a user to understand the issue. 
    
    ```
    
hw12203:...assembly/target/nifi-toolkit-1.5.0-SNAPSHOT-bin/nifi-toolkit-1.5.0-SNAPSHOT
 (pr2376) alopresto
    🔓 271505s @ 11:01:23 $ ./bin/encrypt-config.sh --nifiRegistry -b 
/Users/alopresto/Workspace/registry/nifi-registry-assembly/target/nifi-registry-0.0.1-SNAPSHOT-bin/nifi-registry-0.0.1-SNAPSHOT/conf/bootstrap.conf
 -r 
/Users/alopresto/Workspace/registry/nifi-registry-assembly/target/nifi-registry-0.0.1-SNAPSHOT-bin/nifi-registry-0.0.1-SNAPSHOT/conf/nifi-registry.properties
 -R 
/Users/alopresto/Workspace/registry/nifi-registry-assembly/target/nifi-registry-0.0.1-SNAPSHOT-bin/nifi-registry-0.0.1-SNAPSHOT/conf/nifi-registry-encrypted.properties
 -v --decrypt
    2018-01-08 11:01:40 DEBUG EncryptConfigLogger: Verbose mode is enabled 
(goes to stderr by default).
    2018-01-08 11:01:40 ERROR NiFiRegistryDecryptMode: Encountered an error: 
Invalid options: --decrypt cannot be used with [[ option: R 
outputNifiRegistryProperties  [ARG] :: The destination nifi-registry.properties 
file containing protected config values. :: class java.lang.String ]]. It 
should only be used with -r and one of [-p, -k, -b].
    java.lang.RuntimeException: Invalid options: --decrypt cannot be used with 
[[ option: R outputNifiRegistryProperties  [ARG] :: The destination 
nifi-registry.properties file containing protected config values. :: class 
java.lang.String ]]. It should only be used with -r and one of [-p, -k, -b].
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at 
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
        at 
org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:74)
        at 
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
        at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
        at 
org.apache.nifi.toolkit.encryptconfig.NiFiRegistryDecryptMode.run(NiFiRegistryDecryptMode.groovy:63)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169)
        at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
        at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at 
org.apache.nifi.toolkit.encryptconfig.EncryptConfigMain.main(EncryptConfigMain.groovy:109)
    Invalid options: --decrypt cannot be used with [[ option: R 
outputNifiRegistryProperties  [ARG] :: The destination nifi-registry.properties 
file containing protected config values. :: class java.lang.String ]]. It 
should only be used with -r and one of [-p, -k, -b].
    ```
     
    +1, merging. 


> Add support for NiFi Registry to the encrypt-config tool in NiFi Toolkit
> ------------------------------------------------------------------------
>
>                 Key: NIFI-4708
>                 URL: https://issues.apache.org/jira/browse/NIFI-4708
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Kevin Doran
>            Assignee: Kevin Doran
>             Fix For: 1.5.0
>
>
> NiFi Registry now supports loading encrypted config files (e.g., 
> nifi-registry.properties, authorizers.xml, login-identity-providers.xml). 
> These files are very difficult to encrypt by hand, and is not recommended. 
> Because NiFi Registry utilizes the same encryption algorithms supported by 
> NiFi, the easiest way to build a tool for encrypting NiFi Registry config 
> properties is to extend the the encrypt-config tool in NiFi Toolkit to 
> support NiFi Registry as well.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to