projectcapsule / capsule-proxy

Reverse proxy for Capsule Operator.
https://github.com/projectcapsule/capsule
Apache License 2.0
44 stars 40 forks source link

feat: add support for bearer tokens in websocket protocols #533

Closed CrimsonFez closed 1 week ago

CrimsonFez commented 1 month ago

This is a simple change that enables us to extract the JWT from the WebSocket protocols as defined here https://github.com/kubernetes/kubernetes/pull/47740. This satisfies #499.

Let me know if any changes are needed.

Thank you!

oliverbaehler commented 1 month ago

HI! You need to sign off your commits and gpg sign them as well :)

CrimsonFez commented 1 month ago

Should now be correct

CrimsonFez commented 1 month ago

You have a good point. However, I believe that later parts of the code check if the token string is empty and return an error stating that we cannot authenticate anonymous users.

prometherion commented 1 month ago

@CrimsonFez you're right, touché!

Given the increased complexity it would be good if we could return an error and make it visible in the logs: we can achieve that with panic which is not ideal per se, or rather, by returning a second return such as the error.

prometherion commented 1 week ago

Ah, golangci-lint complains about minor style stuff: this should be the latest round, please @CrimsonFez, may I ask you to amend it?

You can test with golangci-lint by issuing make golint

CrimsonFez commented 1 week ago

Sure thing. I thought I got it all ;(

CrimsonFez commented 1 week ago

Thanks for cleaning that up! I don't always have a lot of time to do stuff. Very much appreciated!

prometherion commented 1 week ago

It's team work, thanks, mate!

On Thu, Nov 14, 2024, 20:19 CrimsonFez @.***> wrote:

Thanks for cleaning that up! I don't always have a lot of time to do stuff. Very much appreciated!

— Reply to this email directly, view it on GitHub https://github.com/projectcapsule/capsule-proxy/pull/533#issuecomment-2477225929, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJ7S3QWGKNQ2EID52MI3Q32ATZSTAVCNFSM6AAAAABPCMEBZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZXGIZDKOJSHE . You are receiving this because you modified the open/close state.Message ID: @.***>