This repository was archived by the owner on May 22, 2021. It is now read-only.
File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -200,3 +200,5 @@ Contributors
200
200
- Andrew Hayworth (@ahayworth)
201
201
202
202
- Dmitry Kiselev (@dmitrykiselev27)
203
+
204
+ - Adeodato Simó (@dato)
Original file line number Diff line number Diff line change 22
22
from . import pulls
23
23
from .repos import repo
24
24
from . import search
25
+ from . import session
25
26
from . import structs
26
27
from . import users
27
28
from . import utils
@@ -1399,14 +1400,15 @@ def login_as_app_installation(
1399
1400
# NOTE(sigmavirus24): This JWT token does not need to last very long.
1400
1401
# Instead of allowing it to stick around for 10 minutes, let's limit
1401
1402
# it to 30 seconds.
1402
- headers = apps .create_jwt_headers (
1403
- private_key_pem , app_id , expire_in = 30
1404
- )
1403
+ jwt_token = apps .create_token (private_key_pem , app_id , expire_in = 30 )
1404
+ bearer_auth = session .AppBearerTokenAuth (jwt_token , 30 )
1405
1405
url = self ._build_url (
1406
1406
"app" , "installations" , str (installation_id ), "access_tokens"
1407
1407
)
1408
1408
with self .session .no_auth ():
1409
- response = self .session .post (url , headers = headers )
1409
+ response = self .session .post (
1410
+ url , auth = bearer_auth , headers = apps .APP_PREVIEW_HEADERS
1411
+ )
1410
1412
json = self ._json (response , 201 )
1411
1413
1412
1414
self .session .app_installation_token_auth (json )
You can’t perform that action at this time.
0 commit comments