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

ClientID regex is too restrictive. #2697

Closed
alexhein opened this issue Oct 31, 2023 · 2 comments · Fixed by #2706
Closed

ClientID regex is too restrictive. #2697

alexhein opened this issue Oct 31, 2023 · 2 comments · Fixed by #2706

Comments

@alexhein
Copy link

alexhein commented Oct 31, 2023

Description

The sarama client allows to set the client.id in the (producer) configuration. It is not uncommon to use symbols like '|' in the client ID string. The regex does not allow this, however. See

var validID = regexp.MustCompile(`\A[A-Za-z0-9._-]+\z`)

@dnwe
Copy link
Collaborator

dnwe commented Oct 31, 2023

@alexhein yes that's interesting, I have seen for example mirror connectors use | in their generated clientIDs these days here

I believe the original validation regex was based on the one that existed in the Java clients pre-1.0.0 but KIP-190 removed the client-side validation because instead the brokers were updated to be able to cope with any clientID and sanitize it before using it in metrics

@alexhein
Copy link
Author

@dnwe Thank you for pointing me to the KIP, I was not aware of that.

dnwe added a commit that referenced this issue Nov 3, 2023
The original validation regex was based on the one that existed in the
Java clients pre-1.0.0 but KIP-190 removed the client-side validation
because instead the brokers were updated to be able to cope with any
clientID and sanitize it before using it in metrics etc.

We can do similar in Sarama and only do client-side validation when the
user has specified a version number older than 1.0.0

Fixes #2697

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
dnwe added a commit that referenced this issue Nov 4, 2023
The original validation regex was based on the one that existed in the
Java clients pre-1.0.0 but KIP-190 removed the client-side validation
because instead the brokers were updated to be able to cope with any
clientID and sanitize it before using it in metrics etc.

We can do similar in Sarama and only do client-side validation when the
user has specified a version number older than 1.0.0

Fixes #2697

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
dnwe added a commit that referenced this issue Nov 4, 2023
The original validation regex was based on the one that existed in the
Java clients pre-1.0.0 but KIP-190 removed the client-side validation
because instead the brokers were updated to be able to cope with any
clientID and sanitize it before using it in metrics etc.

We can do similar in Sarama and only do client-side validation when the
user has specified a version number older than 1.0.0

Fixes #2697

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
dnwe added a commit that referenced this issue Nov 7, 2023
The original validation regex was based on the one that existed in the
Java clients pre-1.0.0 but KIP-190 removed the client-side validation
because instead the brokers were updated to be able to cope with any
clientID and sanitize it before using it in metrics etc.

We can do similar in Sarama and only do client-side validation when the
user has specified a version number older than 1.0.0

Fixes #2697

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
@dnwe dnwe closed this as completed in #2706 Nov 7, 2023
dnwe added a commit that referenced this issue Nov 7, 2023
The original validation regex was based on the one that existed in the
Java clients pre-1.0.0 but KIP-190 removed the client-side validation
because instead the brokers were updated to be able to cope with any
clientID and sanitize it before using it in metrics etc.

We can do similar in Sarama and only do client-side validation when the
user has specified a version number older than 1.0.0

Fixes #2697

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants