kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sönke Liebau (JIRA) <j...@apache.org>
Subject [jira] [Commented] (KAFKA-4930) Connect Rest API allows creating connectors with an empty name
Date Tue, 28 Mar 2017 21:22:41 GMT

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

Sönke Liebau commented on KAFKA-4930:
-------------------------------------

I've created a PR with my approach as it currently stands. I probably still need to create
and additional test case or two, for now I just fixed one broken test (moved the check for
/ in connector name to a different part of the code that was being mocked in that test).

If we go with this route we should probably discuss what characters we want to prohibit in
connector names, I did a bit of googling in the hope of finding a rfc that states "these 5
characters are illegal in a rest url" - but that seems to be a somewhat more [complicated
topic|http://stackoverflow.com/questions/2366260/whats-valid-and-whats-not-in-a-uri-query].
Also there is of course the risk of prohibiting something that someone out there already used,
so we should be very careful here I think.


> Connect Rest API allows creating connectors with an empty name
> --------------------------------------------------------------
>
>                 Key: KAFKA-4930
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4930
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>    Affects Versions: 0.10.2.0
>            Reporter: Sönke Liebau
>            Priority: Minor
>
> The Connect Rest API allows to deploy connectors with an empty name field, which then
cannot be removed through the api.
> Sending the following request:
> {code}
> {
>     "name": "",
>     "config": {
>         "connector.class": "org.apache.kafka.connect.tools.MockSourceConnector",
>         "tasks.max": "1",
>         "topics": "test-topic"
>         
>     }
> }
> {code}
> Results in a connector being deployed which can be seen in the list of connectors:
> {code}
> [
> 	"",
> 	"testconnector"
> ]{code}
> But cannot be removed via a DELETE call, as the api thinks we are trying to delete the
/connectors endpoint and declines the request.
> I don't think there is a valid case for the connector name to be empty so perhaps we
should add a check for this. I am happy to work on this.



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

Mime
View raw message