Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-5489: Add expression language support to AMQP processors HOST, V… #2936

Conversation

danieljimenez
Copy link
Contributor

@danieljimenez danieljimenez commented Aug 4, 2018

…HOST and USER Fields.

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:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • 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.

  • Has your PR been rebased against the latest commit within the target branch (typically master)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • 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?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • 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.

@danieljimenez
Copy link
Contributor Author

No idea what the travis failures are, they are definitely not related to this change.

@danieljimenez danieljimenez force-pushed the NIFI-5489-amqp-attribute-expression-support branch from 1a9c9d5 to 7913865 Compare August 6, 2018 14:25
@danieljimenez
Copy link
Contributor Author

After rerunning the Travis failures are gone.

Copy link
Contributor

@zenfenan zenfenan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will do a quick build and if everything works fine, I'll merge it.

@danieljimenez
Copy link
Contributor Author

Awesome, thanks! That would mean it's targeted for 1.8.0, correct?

@danieljimenez danieljimenez force-pushed the NIFI-5489-amqp-attribute-expression-support branch from 7913865 to b93d5fe Compare August 7, 2018 16:24
@danieljimenez
Copy link
Contributor Author

Missed a spot evaluating the attribute expressions. Fixed.

@alopresto
Copy link
Contributor

@danieljimenez correct, PRs merged now will be included in the next release. Because our bug fix releases (x.x.1) do not include feature work, this will be in the next minor release, which is 1.8.0.

@mosermw
Copy link
Member

mosermw commented Aug 7, 2018

If you are using VARIABLE_REGISTRY to dynamically evaluate the Host, shouldn't you also allow it for Port?

@danieljimenez
Copy link
Contributor Author

@mosermw I can, I just enabled the fields most likely to be variables for most use cases. If you'd like me to add that to this PR, I certainly can.

@mosermw
Copy link
Member

mosermw commented Aug 7, 2018

Please do add Port to your PR, if you can, then I think this will also cover NIFI-4723. It looks like PORT_VALIDATOR already supports expression language, so you are good there.

@danieljimenez danieljimenez force-pushed the NIFI-5489-amqp-attribute-expression-support branch from b93d5fe to 01782bf Compare August 7, 2018 18:41
@danieljimenez
Copy link
Contributor Author

@mosermw Port added sir. :)

@mosermw
Copy link
Member

mosermw commented Aug 8, 2018

+1 from me, though I didn't test this against a real RabbitMQ server. @zenfenan did you want to take another look?

@danieljimenez
Copy link
Contributor Author

FWIW I am currently using a SNAPSHOT from 01782bf on a real RabbitMQ server.

@asfgit asfgit closed this in 3731cc8 Aug 9, 2018
Copy link
Contributor

@zenfenan zenfenan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @danieljimenez for the changes. Thanks @mosermw and @alopresto for the review. Built it with contrib-check profile enabled and ran a sample flow. Everything checks out as expected. Merged to the master.

@danieljimenez danieljimenez deleted the NIFI-5489-amqp-attribute-expression-support branch August 9, 2018 17:32
snagafritz pushed a commit to Snagajob/nifi that referenced this pull request Aug 23, 2018
…HOST and USER Fields.

This closes apache#2936

Signed-off-by: zenfenan <zenfenan@apache.org>
@lukepfarrar
Copy link

Is there a reason why USER supports el but PASSWORD does not?

@alopresto
Copy link
Contributor

Hi @lukepfarrar , we have a policy of not evaluating EL in password fields. Here is an example of that review process and the reasoning behind it on another PR.

Our policy so far has been that passwords do not support expression language, for a couple reasons:

  1. How to evaluate if a password abc${def} should be interpreted as abc + the value of(def) or the literal string abc${def}
  2. The variable registry is not designed to store sensitive values securely, so if a password is stored here, it can be accessed by an unauthorized user

@lukepfarrar
Copy link

lukepfarrar commented Oct 1, 2018

I wondered if that was the case but it did not seem consistent with the DB pooling, which does/did allow EL in the password, although I notice that the scope has been tightened in recent versions.
Thanks :)

@alopresto
Copy link
Contributor

There are definitely inconsistencies throughout the project as this wasn't always a firm policy and there are many different contributors to the project. As you noted, we have tried to tighten the reviews and catch this where we can, and hopefully with the completion of NIFI-5627, we will have a foundation to move forward on enabling EL in passwords for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants