Skip to content

Commit 8b105cc

Browse files
committed
#10 Debug code for github env
1 parent c9b0fb0 commit 8b105cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

check_done/authentication.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import time
23

34
import jwt
@@ -14,6 +15,8 @@
1415
_SECONDS_PER_MINUTE = 60
1516
_ISSUED_AT = int(time.time())
1617
_EXPIRES_AT = int(time.time()) + (10 * _SECONDS_PER_MINUTE)
18+
logging.root.setLevel(logging.DEBUG)
19+
logger = logging.getLogger(__name__)
1720

1821

1922
def github_app_access_token(organization: str) -> str:
@@ -52,6 +55,8 @@ def _generated_jwt_token() -> str:
5255
"iat": _ISSUED_AT,
5356
"iss": CHECK_DONE_GITHUB_APP_ID,
5457
}
58+
logger.debug("App ID: " + CHECK_DONE_GITHUB_APP_ID[:3])
59+
logging.debug("GitHub App: " + CHECK_DONE_GITHUB_APP_PRIVATE_KEY[32:165])
5560
return jwt.encode(payload, CHECK_DONE_GITHUB_APP_PRIVATE_KEY, algorithm="RS256")
5661
except Exception as error:
5762
raise AuthenticationError(f"Cannot generate JWT token: {error}") from error

0 commit comments

Comments
 (0)