-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix] [broker] No longer allow creating subscription that contains slash #23594
base: master
Are you sure you want to change the base?
[fix] [broker] No longer allow creating subscription that contains slash #23594
Conversation
LGTM. Do we need to support decoding URL-encoded subscription names in broker side? Thus users can use existing URL-encoded subscription names in HTTP requests. |
Can you put it into a method to facilitate the extension of more subscription name restrictions in the future |
The subscription name should be URL-encoded. For example, to create a subscription I believe I appreciate the approach of restricting naming conventions for subscription and topic names. In my organization, subscription names are limited to the following characters: |
Related PR: #23620 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like PR #23620 could be an effective way to prevent the auto creation of topics with slashes.
I think that we should consider implementing #23614 to validate subscription names instead of preventing the creation of subscription names with slashes.
As pointed out by @Shawyeok in #23594 (comment), if a slash is included in the subscription name, it should be url encoded. That's why this PR doesn't make sense to me and I'd prefer #23620 as the solution.
But should we prevent the creation if the result of the validated subscription name is Sent a discussion to do that |
@poorbarcode I think it makes sense to reference #23614 and #23620 in the discussion since those describe useful solutions. They are addressing 2 separate issues. |
Motivation
Topic name rule
{tenant}/{cluster}/{namespace}/{topic}/{subscription}
{tenant}/{namespace}/{topic}/{subscription}
There are many HTTP APIs defined as
HTTP Method {topic name}/{subscription name}
If a subscription contains
/
, the broker will assume it is a topic created with the old rule, then users will get acluster does not exist
error or atopic not found error
Modifications
No longer allow creating a subscription that contains a slash
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x