(
self,
session,
client_id=None,
client_secret=None,
token_endpoint_auth_method=None,
revocation_endpoint_auth_method=None,
scope=None,
state=None,
redirect_uri=None,
code_challenge_method=None,
token=None,
token_placement="header",
update_token=None,
leeway=60,
**metadata,
)
| 73 | SESSION_REQUEST_PARAMS = [] |
| 74 | |
| 75 | def __init__( |
| 76 | self, |
| 77 | session, |
| 78 | client_id=None, |
| 79 | client_secret=None, |
| 80 | token_endpoint_auth_method=None, |
| 81 | revocation_endpoint_auth_method=None, |
| 82 | scope=None, |
| 83 | state=None, |
| 84 | redirect_uri=None, |
| 85 | code_challenge_method=None, |
| 86 | token=None, |
| 87 | token_placement="header", |
| 88 | update_token=None, |
| 89 | leeway=60, |
| 90 | **metadata, |
| 91 | ): |
| 92 | self.session = session |
| 93 | self.client_id = client_id |
| 94 | self.client_secret = client_secret |
| 95 | self.state = state |
| 96 | |
| 97 | if token_endpoint_auth_method is None: |
| 98 | if client_secret: |
| 99 | token_endpoint_auth_method = "client_secret_basic" |
| 100 | else: |
| 101 | token_endpoint_auth_method = "none" |
| 102 | |
| 103 | self.token_endpoint_auth_method = token_endpoint_auth_method |
| 104 | |
| 105 | if revocation_endpoint_auth_method is None: |
| 106 | if client_secret: |
| 107 | revocation_endpoint_auth_method = "client_secret_basic" |
| 108 | else: |
| 109 | revocation_endpoint_auth_method = "none" |
| 110 | |
| 111 | self.revocation_endpoint_auth_method = revocation_endpoint_auth_method |
| 112 | |
| 113 | self.scope = scope |
| 114 | self.redirect_uri = redirect_uri |
| 115 | self.code_challenge_method = code_challenge_method |
| 116 | |
| 117 | self.token_auth = self.token_auth_class(token, token_placement, self) |
| 118 | self.update_token = update_token |
| 119 | |
| 120 | token_updater = metadata.pop("token_updater", None) |
| 121 | if token_updater: |
| 122 | raise ValueError( |
| 123 | "update token has been redesigned, checkout the documentation" |
| 124 | ) |
| 125 | |
| 126 | self.metadata = metadata |
| 127 | |
| 128 | self.compliance_hook = { |
| 129 | "access_token_response": set(), |
| 130 | "refresh_token_request": set(), |
| 131 | "refresh_token_response": set(), |
| 132 | "revoke_token_request": set(), |
nothing calls this directly
no outgoing calls
no test coverage detected