First of all, thanks for creating and maintaining this library!
The current PyJWKSet API is pretty thin: it wraps a list of PyJWK and provides basic deserialization, but nothing else.
I'd like to propose adding PyJWKSet.__getitem__, which would allow a user to index the PyJWKSet by key ID and return the corresponding PyJWK (or KeyError if not present). This saves users from having to write their own search over the PyJWKSet, and doesn't significantly complicate the current API.
With __getitem__, the use pattern would be:
jwks = PyJWKSet(keys)
jwk = jwks["somelonghexkeyid"]
Would this functionality be welcome? If so, I am happy to contribute it.
First of all, thanks for creating and maintaining this library!
The current
PyJWKSetAPI is pretty thin: it wraps a list ofPyJWKand provides basic deserialization, but nothing else.I'd like to propose adding
PyJWKSet.__getitem__, which would allow a user to index thePyJWKSetby key ID and return the correspondingPyJWK(orKeyErrorif not present). This saves users from having to write their own search over thePyJWKSet, and doesn't significantly complicate the current API.With
__getitem__, the use pattern would be:Would this functionality be welcome? If so, I am happy to contribute it.