Skip to content
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

Merged
merged 3 commits into from
Oct 30, 2017

Conversation

briankassouf
Copy link
Contributor

fixes #3230

"root/*",
}
if StrListContainsGlob(haystack, "tubez") {
t.Fatalf("Bad")
Copy link
Contributor

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
Copy link
Contributor

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 /?

Copy link
Contributor Author

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.

@jefferai
Copy link
Member

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 jefferai added this to the 0.8.4 milestone Sep 27, 2017
@briankassouf
Copy link
Contributor Author

@jefferai I was thinking of restricting to prefix checking, but could make it more flexible with that library if we want

@jefferai
Copy link
Member

LGTM

@briankassouf briankassouf merged commit 4121791 into master Oct 30, 2017
@briankassouf briankassouf deleted the database-allowed-role-glob branch October 30, 2017 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Nested / Wildcard path for database roles
4 participants