roachpb,sql: limit the syntax of tenant names#93269
roachpb,sql: limit the syntax of tenant names#93269craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
|
cc @adityamaru |
8c031f9 to
da2765f
Compare
da2765f to
7d66012
Compare
ecwall
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @knz, and @stevendanna)
pkg/roachpb/tenant.go line 153 at r1 (raw file):
// to a database name in connection strings. However there cannot // be a hyphen at the end. var tenantNameRe = regexp.MustCompile(`^[a-z0-9]([a-z0-9---]{0,98}[a-z0-9])?$`)
What does the --- do in [a-z0-9---]? Is it different from just [a-z0-9-]?
A standalone By writing |
ecwall
left a comment
There was a problem hiding this comment.
Looks good, just a request for some more test cases.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @knz, and @stevendanna)
pkg/sql/logictest/testdata/logic_test/tenant line 16 at r1 (raw file):
CREATE TENANT "two" statement error invalid tenant name
Can you add test cases for length boundaries
0 -> invalid
1 -> valid
100 -> valid
101 -> valid
ecwall
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @knz, and @stevendanna)
pkg/sql/logictest/testdata/logic_test/tenant line 16 at r1 (raw file):
Previously, ecwall (Evan Wall) wrote…
Can you add test cases for length boundaries
0 -> invalid
1 -> valid
100 -> valid
101 -> valid
- 101 -> invalid
This commit limits the lexicographical structure of tenant names to be that of DNS hostnames: start with a letter or digit, followed by a combination of letters, digits or hyphens. In particular periods and underscores are not allowed. There is a minimum length of 1 character and a maximum of 100, like in CC serverless. Release note: None
7d66012 to
d6c3d5d
Compare
knz
left a comment
There was a problem hiding this comment.
TFYR!
bors r=ecwall
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @ecwall, and @stevendanna)
pkg/sql/logictest/testdata/logic_test/tenant line 16 at r1 (raw file):
Previously, ecwall (Evan Wall) wrote…
- 101 -> invalid
Done.
|
Build failed (retrying...): |
|
Build succeeded: |
Fixes #92613.
This commit limits the lexicographical structure of tenant names to be that of DNS hostnames: start with a letter, followed by a combination of letters, digits or hyphens. In particular periods and underscores are not allowed.
Release note: None