You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by ijokarumawak <gi...@git.apache.org> on 2018/04/24 07:20:01 UTC
[GitHub] nifi pull request #2652: NIFI-5114: Added Basic auth support to WebSocket co...
GitHub user ijokarumawak opened a pull request:
https://github.com/apache/nifi/pull/2652
NIFI-5114: Added Basic auth support to WebSocket components
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?
- [x] 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](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] 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?
- [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/ijokarumawak/nifi nifi-5114
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/2652.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 #2652
----
commit 65a86f55cb35cff9e5bfa3943e5d6629156d6d73
Author: Koji Kawamura <ij...@...>
Date: 2018-04-23T02:38:20Z
NIFI-5114: Added Basic auth support to WebSocket components
----
---
[GitHub] nifi pull request #2652: NIFI-5114: Added Basic auth support to WebSocket co...
Posted by ijokarumawak <gi...@git.apache.org>.
Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2652#discussion_r186341332
--- Diff: nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketClient.java ---
@@ -103,6 +107,35 @@
.defaultValue("10 sec")
.build();
+ public static final PropertyDescriptor USER_NAME = new PropertyDescriptor.Builder()
+ .name("user-name")
+ .displayName("User Name")
+ .description("The user name for Basic Authentication.")
+ .required(false)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor USER_PASSWORD = new PropertyDescriptor.Builder()
+ .name("user-password")
+ .displayName("User Password")
+ .description("The user password for Basic Authentication.")
+ .required(false)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .sensitive(true)
+ .build();
+
+ public static final PropertyDescriptor AUTH_CHARSET = new PropertyDescriptor.Builder()
+ .name("authentication-charset")
+ .displayName("Authentication Header Charset")
+ .description("The charset for Basic Authentication header base64 string.")
+ .required(true)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .defaultValue("US-ASCII")
--- End diff --
I chose 'US-ASCII' from following spec.
> User-ids or passwords containing characters outside the US-ASCII character repertoire will cause interoperability issues, unless both communication partners agree on what character encoding scheme is to be used. Servers can use the new 'charset' parameter (Section 2.1) to indicate a preference of "UTF-8", increasing the probability that clients will switch to that encoding.
https://tools.ietf.org/html/rfc7617
Since UTF-8 is a superset of US-ASCII, UTF-8 can be more preferable default if we assume most server implementations uses UTF-8. However, when I looked at Jetty server side, it uses ISO_8859_1.
So, I prefer using US-ASCII as default. It make people to consider which charset they need to use to match with the server's expectation, in case their username/password need to support characters out of US-ASCII range. Making UTF-8 as default would make people think such characters are supported by default.
---
[GitHub] nifi pull request #2652: NIFI-5114: Added Basic auth support to WebSocket co...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/nifi/pull/2652
---
[GitHub] nifi pull request #2652: NIFI-5114: Added Basic auth support to WebSocket co...
Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2652#discussion_r186381143
--- Diff: nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketClient.java ---
@@ -103,6 +107,35 @@
.defaultValue("10 sec")
.build();
+ public static final PropertyDescriptor USER_NAME = new PropertyDescriptor.Builder()
+ .name("user-name")
+ .displayName("User Name")
+ .description("The user name for Basic Authentication.")
+ .required(false)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor USER_PASSWORD = new PropertyDescriptor.Builder()
+ .name("user-password")
+ .displayName("User Password")
+ .description("The user password for Basic Authentication.")
+ .required(false)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .sensitive(true)
+ .build();
+
+ public static final PropertyDescriptor AUTH_CHARSET = new PropertyDescriptor.Builder()
+ .name("authentication-charset")
+ .displayName("Authentication Header Charset")
+ .description("The charset for Basic Authentication header base64 string.")
+ .required(true)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .defaultValue("US-ASCII")
--- End diff --
That would be a pretty good reason to not go UTF-8.
---
[GitHub] nifi pull request #2652: NIFI-5114: Added Basic auth support to WebSocket co...
Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2652#discussion_r186227509
--- Diff: nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketClient.java ---
@@ -103,6 +107,35 @@
.defaultValue("10 sec")
.build();
+ public static final PropertyDescriptor USER_NAME = new PropertyDescriptor.Builder()
+ .name("user-name")
+ .displayName("User Name")
+ .description("The user name for Basic Authentication.")
+ .required(false)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor USER_PASSWORD = new PropertyDescriptor.Builder()
+ .name("user-password")
+ .displayName("User Password")
+ .description("The user password for Basic Authentication.")
+ .required(false)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .sensitive(true)
+ .build();
+
+ public static final PropertyDescriptor AUTH_CHARSET = new PropertyDescriptor.Builder()
+ .name("authentication-charset")
+ .displayName("Authentication Header Charset")
+ .description("The charset for Basic Authentication header base64 string.")
+ .required(true)
+ .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+ .defaultValue("US-ASCII")
--- End diff --
Why not UTF-8?
---