You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/03 20:45:42 UTC

[jira] [Commented] (KAFKA-4837) Config validation in Connector plugins need to compare against both canonical and simple class names

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

ASF GitHub Bot commented on KAFKA-4837:
---------------------------------------

GitHub user kkonstantine opened a pull request:

    https://github.com/apache/kafka/pull/2798

    KAFKA-4837: Fix class name comparison in connector-plugins REST endpoint

    

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

    $ git pull https://github.com/kkonstantine/kafka KAFKA-4837-Config-validation-in-Connector-plugins-need-to-compare-against-both-canonical-and-simple-class-names

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

    https://github.com/apache/kafka/pull/2798.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 #2798
    
----
commit 3acacb85b819e989ab0423093c900e416e1e371d
Author: Konstantine Karantasis <ko...@confluent.io>
Date:   2017-04-03T20:42:37Z

    KAFKA-4837: Fix class name comparison in connector-plugins REST endpoint

----


> Config validation in Connector plugins need to compare against both canonical and simple class names
> ----------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-4837
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4837
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>    Affects Versions: 0.10.2.0
>            Reporter: Konstantine Karantasis
>            Assignee: Konstantine Karantasis
>             Fix For: 0.10.2.1
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> A validation check in Connect's REST API that was added to validate that the connector class name in the config matches the connector class name in the request's URL is too strict by not considering both the simple and the canonical name of the connector class. For instance, the following example request: 
> {code}
> PUT /connector-plugins/FileStreamSinkConnector/config/validate/ HTTP/1.1
> Host: connect.example.com
> Accept: application/json
> {
>     "connector.class": "org.apache.kafka.connect.file.FileStreamSinkConnector",
>     "tasks.max": "1",
>     "topics": "test-topic"
> }
> {code}
> returns a "Bad Request" response with error code "400".
> Currently the reasonable workaround is to exactly match the connector class name in both places. The following will work: 
> {code}
> PUT /connector-plugins/"org.apache.kafka.connect.file.FileStreamSinkConnector/config/validate/ HTTP/1.1
> Host: connect.example.com
> Accept: application/json
> {
>     "connector.class": "org.apache.kafka.connect.file.FileStreamSinkConnector",
>     "tasks.max": "1",
>     "topics": "test-topic"
> }
> {code}
> However, this is not flexible enough and also breaks several examples in documentation. Validation should take into account both simple and canonical class names. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)