[
https://issues.apache.org/jira/browse/NIFI-5054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16512567#comment-16512567
]
ASF GitHub Bot commented on NIFI-5054:
--------------------------------------
Github user mcgilman commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2750#discussion_r195449260
--- Diff:
nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/AbstractCouchbaseProcessor.java
---
@@ -39,54 +38,32 @@
import com.couchbase.client.core.CouchbaseException;
import com.couchbase.client.java.Bucket;
+import static
org.apache.nifi.couchbase.CouchbaseConfigurationProperties.BUCKET_NAME;
+import static
org.apache.nifi.couchbase.CouchbaseConfigurationProperties.COUCHBASE_CLUSTER_SERVICE;
+
/**
- * Provides common functionalities for Couchbase processors.
+ * Provides common functionality for Couchbase processors.
*/
public abstract class AbstractCouchbaseProcessor extends AbstractProcessor
{
- public static final PropertyDescriptor DOCUMENT_TYPE = new
PropertyDescriptor.Builder().name("Document Type")
- .description("The type of contents.")
- .required(true)
- .allowableValues(DocumentType.values())
- .defaultValue(DocumentType.Json.toString())
- .build();
-
- public static final PropertyDescriptor DOC_ID = new
PropertyDescriptor.Builder().name("Document Id")
+ public static final PropertyDescriptor DOC_ID = new
PropertyDescriptor.Builder()
+ .name("document-id")
+ .displayName("Document Id")
.description("A static, fixed Couchbase document id, or an
expression to construct the Couchbase document id.")
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.build();
- public static final Relationship REL_SUCCESS = new
Relationship.Builder()
- .name("success")
- .description("All FlowFiles that are written to Couchbase Server
are routed to this relationship.")
- .build();
- public static final Relationship REL_ORIGINAL = new
Relationship.Builder()
- .name("original")
- .description("The original input file will be routed to this
destination when it has been successfully processed.")
- .build();
- public static final Relationship REL_RETRY = new Relationship.Builder()
- .name("retry")
- .description("All FlowFiles that cannot written to Couchbase
Server but can be retried are routed to this relationship.")
- .build();
- public static final Relationship REL_FAILURE = new
Relationship.Builder()
- .name("failure")
- .description("All FlowFiles that cannot written to Couchbase
Server and can't be retried are routed to this relationship.")
- .build();
-
- public static final PropertyDescriptor COUCHBASE_CLUSTER_SERVICE = new
PropertyDescriptor.Builder().name("Couchbase Cluster Controller Service")
- .description("A Couchbase Cluster Controller Service which manages
connections to a Couchbase cluster.")
- .required(true)
-
.identifiesControllerService(CouchbaseClusterControllerService.class)
- .build();
+ public static final Relationship.Builder RELB_SUCCESS = new
Relationship.Builder().name("success");
+ public static final Relationship.Builder RELB_ORIGINAL = new
Relationship.Builder().name("original");
+ public static final Relationship.Builder RELB_RETRY = new
Relationship.Builder().name("retry");
+ public static final Relationship.Builder RELB_FAILURE = new
Relationship.Builder().name("failure");
- public static final PropertyDescriptor BUCKET_NAME = new
PropertyDescriptor.Builder().name("Bucket Name")
- .description("The name of bucket to access.")
- .required(true)
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
- .defaultValue("default")
- .build();
+ public static final Relationship REL_ORIGINAL = RELB_ORIGINAL.build();
+ public static final Relationship REL_SUCCESS = RELB_SUCCESS.build();
+ public static final Relationship REL_RETRY = RELB_RETRY.build();
+ public static final Relationship REL_FAILURE = RELB_FAILURE.build();
--- End diff --
While the issue does not surface due to the way `getRelationships` is
invoked, as `static` fields I believe these `Relationship` and
`Relationship.Builder` variables are shared across any implementations of an
`AbstractCouchbaseProcessor`. Because they are shared, when one implementation
set's a description it would be reflected in any other implementation. With an
approach like this, it probably makes sense to have these be not `static`.
> Nifi Couchbase Processors does not support User Authentication
> --------------------------------------------------------------
>
> Key: NIFI-5054
> URL: https://issues.apache.org/jira/browse/NIFI-5054
> Project: Apache NiFi
> Issue Type: Improvement
> Affects Versions: 1.5.0, 1.6.0
> Reporter: Shagun Jaju
> Assignee: Koji Kawamura
> Priority: Major
> Labels: authentication, security
>
> Issue Description: Nifi Couchbase processors don't work with new couchbase
> versions 5.0 and 5.1.
> New Couchbase Version 5.x has introduced *Role Based Access Control (RBAC),*
> a ** new security feature.
> # All buckets must now be accessed by a *user*/*password* combination that
> has a *role with access rights* to the bucket.
> # Buckets no longer use bucket-level passwords
> # There is no default bucket and no sample buckets with blank passwords.
> # You cannot create a user without a password.
> *(Ref:*
> https://developer.couchbase.com/documentation/server/5.0/introduction/whats-new.html
> [https://blog.couchbase.com/new-sdk-authentication/] )
>
> nifi-couchbase-processors : GetCouchbaseKey and PutCouchbaseKey using
> Controller Service still uses old authentication mechanism.
> * org.apache.nifi.processors.couchbase.GetCouchbaseKey
> * org.apache.nifi.processors.couchbase.PutCouchbaseKey
> Ref:
> [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/couchbase/CouchbaseClusterService.java#L116]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)