-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add the ability to glob allowed roles in the Database Backend #3387
Conversation
helper/strutil/strutil_test.go
Outdated
"root/*", | ||
} | ||
if StrListContainsGlob(haystack, "tubez") { | ||
t.Fatalf("Bad") |
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.
Perhaps change these to more descriptive messages
@@ -609,6 +609,40 @@ func TestBackend_allowedRoles(t *testing.T) { | |||
t.Fatalf("expected error to be:%s got:%#v\n", logical.ErrPermissionDenied, err) | |||
} | |||
|
|||
// update connection with glob allowed roles connection |
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 add a test that has a role name containing a /
, with a corresponding allowed_role
having a glob after the /
?
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.
I tested with a /*
in the strutil package, but role names actually are not able to have /
s in them. This is because they use the name regex in the path.
Somewhere -- maybe ACLs, maybe in the PKI backend -- we use @ryanuber's https://github.com/ryanuber/go-glob -- would that be a better fit here or do you want to place more restrictions around where/how globbing can be performed? |
@jefferai I was thinking of restricting to prefix checking, but could make it more flexible with that library if we want |
LGTM |
fixes #3230