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

Bearer token regex breaking ability to authenticate #194

Closed
jessecorson opened this issue Mar 1, 2022 · 4 comments · Fixed by #195
Closed

Bearer token regex breaking ability to authenticate #194

jessecorson opened this issue Mar 1, 2022 · 4 comments · Fixed by #195
Assignees
Milestone

Comments

@jessecorson
Copy link
Contributor

jessecorson commented Mar 1, 2022

In v0.2.0 and v0.2.1 the regex check that uses regexPatternForAuthHeader = "^(Bearer ([\\w-]*\\.[\\w-]*\\.[\\w-]*))$" fails because our tokens do not adhere to that regex pattern. What is the purpose of this regex check?

It could still check for Bearer and a string, why does it need to be a jwt?

Reference https://github.com/clastix/capsule-proxy/blob/d85232c51624817909af86825fbc70c32e27be0e/internal/webserver/middleware/authorization.go#L19

@prometherion
Copy link
Member

Hey, thanks for using Capsule and Capsule Proxy!

That code has been written by @mendrugory, would be better ask him directly.

At first sight, it seems we have missed the support for web tokens since they were introduced with #99.

@jessecorson
Copy link
Contributor Author

@prometherion I've added the PR above to address this

@prometherion prometherion linked a pull request Mar 4, 2022 that will close this issue
@prometherion prometherion added this to the v0.3.0 milestone Mar 4, 2022
@mendrugory
Copy link
Contributor

Hey, thanks for using Capsule and Capsule Proxy!

That code has been written by @mendrugory, would be better ask him directly.

At first sight, it seems we have missed the support for web tokens since they were introduced with #99.

Thanks @jessecorson for pointing at this issue and for the proposed #195 .
That was lost after the big refactoring and only JWT were supported.

@prometherion should capsule-proxy support other kind of tokens?

@prometherion
Copy link
Member

@prometherion should capsule-proxy support other kind of tokens?

Yes, we have, since supported by Kubernetes. We definitely lost it during refactoring!

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 a pull request may close this issue.

3 participants