Skip to content
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

header kwarg removed from 1.0.0, present in 0.15.5 #457

Closed
Atheuz opened this issue May 12, 2022 · 0 comments
Closed

header kwarg removed from 1.0.0, present in 0.15.5 #457

Atheuz opened this issue May 12, 2022 · 0 comments
Assignees
Labels

Comments

@Atheuz
Copy link

Atheuz commented May 12, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants