You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by trixpan <gi...@git.apache.org> on 2017/07/18 11:08:32 UTC

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

GitHub user trixpan opened a pull request:

    https://github.com/apache/nifi/pull/2018

    NIFI-4175 - Add HTTP proxy support to *SFTP processors

    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [X] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [X] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [X] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [X] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [X] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [] Have you written or updated unit tests to verify your changes?
    - [X] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [X] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [X] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [X] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [X] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/trixpan/nifi NIFI-4175

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/2018.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2018
    
----
commit fc93aefd3351c939b06e83db77c89ce0957d025f
Author: Andre F de Miranda <tr...@users.noreply.github.com>
Date:   2017-07-18T11:04:48Z

    NIFI-4175 - Add HTTP proxy support to *SFTP processors

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/2018


---

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2018#discussion_r128101394
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java ---
    @@ -92,6 +93,39 @@
             .defaultValue("true")
             .required(true)
             .build();
    +    public static final PropertyDescriptor PROXY_HOST = new PropertyDescriptor.Builder()
    --- End diff --
    
    I'm wondering if, since FileTransfer is only used for FTP and SFTP, it would make sens to move the proxy-related properties to FileTransfer instead of duplicating code. I believe, as far as I can see, that we could use the existing properties in FTPTransfer for SFTPTransfer as well with HTTP Proxy and SOCK proxy. Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #2018: NIFI-4175 - Add HTTP proxy support to *SFTP processors

Posted by ijokarumawak <gi...@git.apache.org>.
Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/2018
  
    @trixpan Since this PR is really close to get merged, but got inactive, and I have another PR tackling the same theme, I have merged your commit into my PR in #2704. SOCKS proxy support is also added there. When #2704 is merged successfully after being reviewed, this PR will be closed, too.
    
    I hope continuing work at #2704 would be fine for you. Please let me know if not the case.
    
    @trixpan @pvillard31 @jugi92 would you please take a look on #2704 and post any feedback there, thanks!


---

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

Posted by jugi92 <gi...@git.apache.org>.
Github user jugi92 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2018#discussion_r145136408
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java ---
    @@ -92,6 +93,39 @@
             .defaultValue("true")
             .required(true)
             .build();
    +    public static final PropertyDescriptor PROXY_HOST = new PropertyDescriptor.Builder()
    --- End diff --
    
    Hi,
    We would really like to see that the development goes into the direction that SOCKS Proxy with authentication will also be available.
    In many bigger companies it is a basic requirement and for us it is not possible to provide those parameters through the -D Options as mentioned in this comment: https://community.hortonworks.com/questions/30339/how-to-configure-proxy-server-details-with-user-an.html
    As JSCH offers all the possibilities and a reference implementation it should be possible to integrate it and broaden the functionality of Nifi and thus make it more attractive to companies.
    Please feel free to discuss my opinion.
    Best regards


---

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2018#discussion_r128152991
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java ---
    @@ -92,6 +93,39 @@
             .defaultValue("true")
             .required(true)
             .build();
    +    public static final PropertyDescriptor PROXY_HOST = new PropertyDescriptor.Builder()
    --- End diff --
    
    @pvillard31 I saw that and considered it but ended up adopting the current approach due to my view that I prefer not supporting SOCKS ... Don't get me wrong, I appreciate the reason why SOCKS exists but most processors are only able to support HTTP so I rather provide... consistency (I know I have been sounding repetitive lately... 😄 )
    
    Since FTP already supports SOCKS I reckon we can leave it there, but for SFTP I rather not add it at all.
    
    Let me know if you agree and I will adjust accordingly. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2018#discussion_r128100302
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java ---
    @@ -401,6 +435,18 @@ private ChannelSftp getChannel(final FlowFile flowFile) throws IOException {
                     ctx.getProperty(HOSTNAME).evaluateAttributeExpressions(flowFile).getValue(),
                     ctx.getProperty(PORT).evaluateAttributeExpressions(flowFile).asInteger().intValue());
     
    +            if (ctx.getProperty(PROXY_HOST).evaluateAttributeExpressions(flowFile).isSet()) {
    +                final ProxyHTTP proxy = new ProxyHTTP(
    +                        ctx.getProperty(PROXY_HOST).evaluateAttributeExpressions(flowFile).getValue(),
    +                        ctx.getProperty(PROXY_PORT).evaluateAttributeExpressions(flowFile).asInteger()
    +                );
    +                // Check if Username is set and populate the proxy accordingly
    +                if (ctx.getProperty(PROXY_USERNAME).evaluateAttributeExpressions(flowFile).isSet()) {
    +                    proxy.setUserPasswd(ctx.getProperty(PROXY_USERNAME).evaluateAttributeExpressions(flowFile).getValue(), ctx.getProperty(PROXY_PASSWORD).evaluateAttributeExpressions(flowFile).getValue());
    --- End diff --
    
    ````
    [WARNING] src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java[445] (sizes) LineLength: Line is longer than 200 characters (found 206).
    ````


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2018#discussion_r128152995
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java ---
    @@ -401,6 +435,18 @@ private ChannelSftp getChannel(final FlowFile flowFile) throws IOException {
                     ctx.getProperty(HOSTNAME).evaluateAttributeExpressions(flowFile).getValue(),
                     ctx.getProperty(PORT).evaluateAttributeExpressions(flowFile).asInteger().intValue());
     
    +            if (ctx.getProperty(PROXY_HOST).evaluateAttributeExpressions(flowFile).isSet()) {
    +                final ProxyHTTP proxy = new ProxyHTTP(
    +                        ctx.getProperty(PROXY_HOST).evaluateAttributeExpressions(flowFile).getValue(),
    +                        ctx.getProperty(PROXY_PORT).evaluateAttributeExpressions(flowFile).asInteger()
    +                );
    +                // Check if Username is set and populate the proxy accordingly
    +                if (ctx.getProperty(PROXY_USERNAME).evaluateAttributeExpressions(flowFile).isSet()) {
    +                    proxy.setUserPasswd(ctx.getProperty(PROXY_USERNAME).evaluateAttributeExpressions(flowFile).getValue(), ctx.getProperty(PROXY_PASSWORD).evaluateAttributeExpressions(flowFile).getValue());
    --- End diff --
    
    Hmmm... missed that one. Will fix.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #2018: NIFI-4175 - Add HTTP proxy support to *SFTP process...

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2018#discussion_r128277226
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java ---
    @@ -92,6 +93,39 @@
             .defaultValue("true")
             .required(true)
             .build();
    +    public static final PropertyDescriptor PROXY_HOST = new PropertyDescriptor.Builder()
    --- End diff --
    
    I honestly don't have any opinion on this subject but I agree that if we do not add SOCKS option to SFTP processors, then it's OK to have the corresponding properties in SFTPTransfer.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---