Skip to content

Commit

Permalink
Revert "broker: Allow colons in journal names and label values"
Browse files Browse the repository at this point in the history
This reverts commit f28f519.

The downstream requirement has gone away, and there's no current known
reason to expand the set of allowed tokens.
  • Loading branch information
jgraettinger committed Jun 19, 2024
1 parent b79f27a commit e7425ff
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion broker/protocol/journal_spec_extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func (s *JournalSuite) TestJournalValidationCases(c *gc.C) {
expect string
}{
{"a/valid/path/to/a/journal", ""}, // Success.
{"a/valid/path/to/a:journal", ""}, // Success.
{"/leading/slash", `cannot begin with '/' \(/leading/slash\)`},
{"trailing/slash/", `must be a clean path \(trailing/slash/\)`},
{"extra-middle//slash", `must be a clean path \(extra-middle//slash\)`},
Expand Down
2 changes: 0 additions & 2 deletions broker/protocol/label_extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ func (s *LabelSuite) TestLabelValidationCases(c *gc.C) {
}{
{"a-label", "a-value", ""}, // Success.
{"a/label", "a%20value", ""}, // Success.
{"a-label", "a:value", ""}, // Success
{"a|label", "a-value", `Name: not a valid token \(a|label\)`},
{"a-label", "a|value", `Value: not a valid token \(a|value\)`},
{"a:label", "a-value", `Name: not a valid token \(a:label\)`},
{"a", "a-value", `Name: invalid length \(1; expected 2 <= length <= 64\)`},
{strings.Repeat("a", maxLabelLen+1), "a-value", `Name: invalid length \(65; expected .*`},
{"a-label", "", ""}, // Success
Expand Down
4 changes: 2 additions & 2 deletions broker/protocol/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ const (
// The alphabet leads with '-' to facilitate escaping in |reToken|.
TokenSymbols = "-_+/."
// pathSymbols is allowed runes of strings which form path components.
// It extends TokenSymbols with the '=', '%', and ':' runes.
pathSymbols = TokenSymbols + "=%:"
// It extends TokenSymbols with the '=' and '%' runes.
pathSymbols = TokenSymbols + "=%"
)

0 comments on commit e7425ff

Please sign in to comment.