File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change
1
+ import logging
1
2
import time
2
3
3
4
import jwt
14
15
_SECONDS_PER_MINUTE = 60
15
16
_ISSUED_AT = int (time .time ())
16
17
_EXPIRES_AT = int (time .time ()) + (10 * _SECONDS_PER_MINUTE )
18
+ logging .root .setLevel (logging .DEBUG )
19
+ logger = logging .getLogger (__name__ )
17
20
18
21
19
22
def github_app_access_token (organization : str ) -> str :
@@ -52,6 +55,8 @@ def _generated_jwt_token() -> str:
52
55
"iat" : _ISSUED_AT ,
53
56
"iss" : CHECK_DONE_GITHUB_APP_ID ,
54
57
}
58
+ logger .debug ("App ID: " + CHECK_DONE_GITHUB_APP_ID [:3 ])
59
+ logging .debug ("GitHub App: " + CHECK_DONE_GITHUB_APP_PRIVATE_KEY [32 :165 ])
55
60
return jwt .encode (payload , CHECK_DONE_GITHUB_APP_PRIVATE_KEY , algorithm = "RS256" )
56
61
except Exception as error :
57
62
raise AuthenticationError (f"Cannot generate JWT token: { error } " ) from error
You can’t perform that action at this time.
0 commit comments