Skip to content

Commit

Permalink
#10 Debug code for github env
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsken committed Oct 23, 2024
1 parent c9b0fb0 commit 8b105cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions check_done/authentication.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import time

import jwt
Expand All @@ -14,6 +15,8 @@
_SECONDS_PER_MINUTE = 60
_ISSUED_AT = int(time.time())
_EXPIRES_AT = int(time.time()) + (10 * _SECONDS_PER_MINUTE)
logging.root.setLevel(logging.DEBUG)
logger = logging.getLogger(__name__)


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

0 comments on commit 8b105cc

Please sign in to comment.