-
Notifications
You must be signed in to change notification settings - Fork 27
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
Update ns key discovery to follow openid-style lookups #583
Conversation
ff41f86
to
ecd6073
Compare
Closes #111 |
faba057
to
8b8eed7
Compare
I'm holding off reviewing this PR as there are major changes of registry API done in #613 which will cause significant merge conflict with this PR, and with #613 merged in, you might need also to downgrade the API version to be compatible, but I like the idea to have a conformed way to do the look up. Let's talk about how to proceed @jhiemstrawisc |
@haoming29, sounds good. Let's focus on getting #613 in, and then I can revisit this to see what still makes sense. |
Hey @jhiemstrawisc How are we doing here? It feels like there are lots of related work done to the registry that causes considerable amount of merge conflict to this PR, and I thought it'd be beneficial to have it closed soon. |
3374afa
to
fd92230
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Only concern from me is about backward compatibility. I'm taking extra caution because it bit us before, but let me know how you think about it and if Brian has some idea.
Previously, namespace keys were fetched by hardcoding the issuer jwks relative to the namespace. Now we follow openid-style lookups by fetching the JSON located at <registry url>/api/v2.0/registry/metadata/<namespace>/.well-known/namespace-configuration and following the URL associated with the `jwks_uri` key. Currently this is still the same key path in all instances that I'm aware of, but in theory this could be expanded to point to other locations. The architecture of this PR is that a GET request to the namespace-configuration url mentioned above should dynamically generate the `jwks_uri` key with associated value. The value is used throughout and assigned the issuer URL in various places where we need to create a token on behalf of the namespace.
Previously I wasn't using the term "issuer" correctly -- really, we should be thinking about the issuer as the endpoint against which we perform openID-configuration lookup to find the issuer key. That is, for registry.com and ns prefix /foo/bar, the issuer is registry.com/api/v1.0/registry/foo/bar. We take that endpoint and grab the JSON hosted at registry.com/api/v1.0/registry/foo/bar/.well-known/openid-configuration. From there, most Pelican services will point to the key hosted at registry.com/api/v1.0/registry/foo/bar/.well-known/issuer.jwks.
22b79fe
to
3ae6ae6
Compare
Previously, namespace keys were fetched by hardcoding the issuer jwks relative to the namespace.
Now we conform to openid-style lookups by fetching the JSON located at
/api/v2.0/registry/metadata//.well-known/namespace-configuration
and following the URL associated with the
jwks_uri
key. Currently this is still the same key pathin all instances that I'm aware of, but in theory this could be expanded to point to other locations.
We can also expand this namespace-configuration JSON to include additional information as needed.
The architecture of this PR is that a GET request to the namespace-configuration url mentioned above
should dynamically generate the JSON with
jwks_uri
key and associated value. The value is used throughoutand assigned the issuer URL in various places where we need to create a token on behalf of themnamespace.