Skip to content

Commit

Permalink
Add token repositories to auth example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Mar 9, 2024
1 parent 9b6a640 commit 80407cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/examples/Authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ expiration timeout. The access token is refreshed automatically.

.. code-block:: python
>>> auth = Auth.AppAuth(123456, private_key).get_installation_auth(installation_id, token_permissions)
>>> g = Github(auth=auth)
>>> app_auth = Auth.AppAuth(123456, private_key)
>>> inst_auth = app_auth.get_installation_auth(installation_id, token_permissions, token_repositories)
>>> g = Github(auth=inst_auth)
>>> g.get_repo("user/repo").name
'repo'
Expand All @@ -103,7 +104,7 @@ Alternatively, the `github.Github` instance can be retrieved via `github.GithubI
>>> auth = Auth.AppAuth(123456, private_key)
>>> gi = GithubIntegration(auth=auth)
>>> g = gi.get_github_for_installation(installation_id, token_permissions)
>>> g = gi.get_github_for_installation(installation_id, token_permissions, token_repositories)
>>> g.get_repo("user/repo").name
'repo'
Expand Down

0 comments on commit 80407cc

Please sign in to comment.