-
Notifications
You must be signed in to change notification settings - Fork 174
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
Remove constraints on secret name #1541
Conversation
@ashley-cui @vrothberg PTAL |
I think we still need a restriction on not allowing |
@ashley-cui @vrothberg @nalind PTAL |
pkg/secrets/secrets_test.go
Outdated
require.Error(t, err) | ||
_, err = manager.Store("a.", []byte("mydata"), drivertype, storeOpts) | ||
_, err = manager.Store("file/path", []byte("mydata"), drivertype, storeOpts) |
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.
Non-blocking nit: this test should be turned into a table-driven one.
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.
Ah, probably worth doing the work after all in this PR. We should also test for an error on an empty string and test > 253.
pkg/secrets/secrets.go
Outdated
if !secretNameRegexp.MatchString(name) || len(name) > 253 || strings.HasSuffix(name, "-") || strings.HasSuffix(name, ".") { | ||
return fmt.Errorf("only 253 [a-zA-Z0-9-_.] characters allowed, and the start and end character must be [a-zA-Z0-9]: %s: %w", name, errInvalidSecretName) | ||
if len(name) == 0 || !secretNameRegexp.MatchString(name) { | ||
return fmt.Errorf("secret name %q can not include '=' or '/' and must be at least one character: %w", name, errInvalidSecretName) |
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.
Can we also mention the null character?
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.
LGTM
CI barks
|
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM at best I can tell. I'll defer to others for final merge. |
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.
Late to review but LGTM
No description provided.