-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bug: Normalize both url path and capability substring for endpoint authorization #170
Comments
The responsibility falls on the creators of the capabilities used in the authorization input to use proper regular expressions to contain word boundaries so that this doesn't happen. |
@johnabass I don't think we provide a way for a user to configure the regex for comparing these two strings. bascule/basculechecks/endpointchecks.go Lines 100 to 106 in ef08626
If I'm not missing it and we're actually not supporting that functionality atm, then I can add it. |
It's not the regex a user would configure. It's that custom validators can be written to take advantage of what |
closed by #173 |
bascule checks wether or not one of the sat token capabilities matches the request url. This works by checking 1) the capabilities like
hooks
is a subset match of the request url and 2) that match starts at index 0:where
re
is the regex forhooks
capability andurlToMatch
should start withhooks
bascule/basculechecks/endpointchecks.go
Lines 105 to 110 in ef08626
The issue at hand is that go's
net
lib may include a leading/
in its url path. SourlToMatch
would point to/hooks
instead ofhooks
and thus failing the endpoint authorization.The solution is to normalize both
re
andurlToMatch
to contain a leading/
such that the currently logic works.The text was updated successfully, but these errors were encountered: