-
Notifications
You must be signed in to change notification settings - Fork 0
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
Require JWTs for write/delete operations on the "unsecured" route #16
base: main
Are you sure you want to change the base?
Conversation
I can build this on my system, but am not in a position to properly test my changes — that requires access to a functioning OPAAL instance, without which the code doesn't get to the point of adding the newly-created secondary router which enforces JWT validation. Any chance @travisbcotton or @davidallendj could help with this? |
I can have a look at it tomorrow at some point. Do you have a guide or instructions to test? |
The only material change is that POST/PUT/DELETE requests on the unsecured route should now require a JWT (GETs, of course, still do not). E.g. attempting to add cloud-init data without a JWT should fail |
I built a new container image and tried running it in an existing OpenCHAMI environment.
|
I don't think you can
|
Were these meant to be the same endpoint but different routers or maybe just a typo? |
This is what I get with a locally built cloud-in container without the Initializing JWKS from URL:
JWKS initialization failed: failed to fetch "": Get "": unsupported protocol scheme "" Should this be an error saying that the JWKS URL is required or am I doing something wrong? Adding the |
Ah, that'd make sense. Okay, time to dig back into how routers work, then. Currently, we add JWT validation middleware to an entire router, which clearly has to change.
Okay, yes, good catch. Forgot that the Dockerfile overrides defaults in the Go program itself; that's an easy fix. |
I was having a little trouble understanding the intent of the subrouters so I followed what I thought the intent was and added comments to make it clearer. We should review this at the next standup. |
This PR implements JWT validation for sensitive (i.e. writing and deleting) operations on the "unsecured" route, i.e. the one that doesn't require auth for basic data retrieval. This requires a little bit of weirdness with multiple routers, but should generally make sense.
Resolves #14