authlib
authlib copied to clipboard
header kwarg removed from 1.0.0, present in 0.15.5
Describe the bug
In 0.15.5, the initializer and sign method for class ClientSecretJWT looked like this:
def __init__(self, token_endpoint=None, claims=None, header=None):
self.token_endpoint = token_endpoint
self.claims = claims
self.header = header
def sign(self, auth, token_endpoint):
return client_secret_jwt_sign(
auth.client_secret,
client_id=auth.client_id,
token_endpoint=token_endpoint,
claims=self.claims,
header=self.header,
alg=self.alg,
)
See here: https://github.com/lepture/authlib/blob/v0.15.5/authlib/oauth2/rfc7523/auth.py#L30
In 1.0.0+, the same looks like this:
def __init__(self, token_endpoint=None, claims=None, alg=None):
self.token_endpoint = token_endpoint
self.claims = claims
if alg is not None:
self.alg = alg
def sign(self, auth, token_endpoint):
return client_secret_jwt_sign(
auth.client_secret,
client_id=auth.client_id,
token_endpoint=token_endpoint,
claims=self.claims,
alg=self.alg,
)
See here: https://github.com/lepture/authlib/blob/v1.0.1/authlib/oauth2/rfc7523/auth.py#30
The header
kwarg has disappeared. I was using that for my application, and now it's no longer possible to use that.
Are the 1.0.0 and 0.15.x trees unrelated? They don't look like the share the same history. Is there documentation on what happened here?
Error Stacks
"__init__() got an unexpected keyword argument 'header'"
To Reproduce
N/A
Expected behavior
I expected the class ClientSecretJWT to retain the header kwarg and have it be possible to use it.
Environment:
- OS: Ubuntu 20.04.4 LTS
- Python Version: 3.9
- Authlib Version: 1.0.1