kubeclient icon indicating copy to clipboard operation
kubeclient copied to clipboard

use openid_connect gem's jwks caching feature

Open nov opened this issue 2 years ago • 4 comments

same with https://github.com/omniauth/omniauth_openid_connect/pull/124

when passing OpenIDConnect::Discovery::Provider::Config::Response instance to OpenIDConnect::ResponseObject::IdToken.decode, it fetches JWK Set using JSON::JWK::Set::Fetcher.

JSON::JWK::Set::Fetcher tries to cache JWKS by given kid when JSON::JWK::Set::Fetcher.cache is setup like below.

JSON::JWK::Set::Fetcher.cache = Rails.cache

nov avatar Sep 23 '22 05:09 nov

@rhysm @benlangfeld you know more than me about OIDC, could you review?

@nov Does this deserve any additions to README? Or is it "if you've set up a JWK cache it'll automagically do the obvious Right Thing, and if not you don't care about this?"

cben avatar Sep 23 '22 14:09 cben

If OIDC login flow is executed very often, it deserve to be added to README too.

nov avatar Sep 23 '22 23:09 nov

OK, I don't know how to review this myself, but I shouldn't have blocked this either. Superficially, makes sense :+1:
[I'm just getting too little time for kubeclient, so trying to outsource... nagging is welcome!]

@nov please add at least a CHANGELOG.md entry (as I'm not sure how to explain this change well), and I'll merge.

cben avatar Jan 15 '23 10:01 cben

@nov friendly ping — the only thing blocking merge is I don't know how to explain this change in CHANGELOG.md, please add an entry there :pray:

FYI, #606 is looking to auto-renew credentials, and intends to call OIDCAuthProvider.token on every kubeclient request. We need more eyes on that.

[EDIT: all this time I haven't realized you're are the author of openid_connect :flushed: :clap: Still, I don't know enough about this area, and I need someone to explain the implications at least to the users...]

cben avatar Mar 20 '23 09:03 cben