Skip to content

Add cryptography as dependency (for app-based auth) #2441

@jodelasur

Description

@jodelasur

Using the new app-based auth results to the error below when cryptography is not installed. It should be added as a dependency of this.

Traceback (most recent call last):
  File "***", line 60, in ***
    github = Github(
  File "/usr/local/lib/python3.9/site-packages/github/MainClass.py", line 122, in __init__
    self.__requester = Requester(
  File "/usr/local/lib/python3.9/site-packages/github/Requester.py", line 332, in __init__
    self._refresh_token()
  File "/usr/local/lib/python3.9/site-packages/github/Requester.py", line 396, in _refresh_token
    self.__installation_authorization = self._get_installation_authorization()
  File "/usr/local/lib/python3.9/site-packages/github/Requester.py", line 377, in _get_installation_authorization
    integration = GithubIntegration.GithubIntegration(
  File "/usr/local/lib/python3.9/site-packages/github/GithubIntegration.py", line 52, in __init__
    jwt=self.create_jwt(),
  File "/usr/local/lib/python3.9/site-packages/github/GithubIntegration.py", line 106, in create_jwt
    encrypted = jwt.encode(payload, key=self.private_key, algorithm="RS256")
  File "/usr/local/lib/python3.9/site-packages/jwt/api_jwt.py", line 67, in encode
    return api_jws.encode(json_payload, key, algorithm, headers, json_encoder)
  File "/usr/local/lib/python3.9/site-packages/jwt/api_jws.py", line 152, in encode
    alg_obj = self.get_algorithm_by_name(algorithm_)
  File "/usr/local/lib/python3.9/site-packages/jwt/api_jws.py", line 91, in get_algorithm_by_name
    raise NotImplementedError(
NotImplementedError: Algorithm 'RS256' could not be found. Do you have cryptography installed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions