(
installation_id: str, use_jwt: bool = False
)
| 32 | |
| 33 | |
| 34 | def build_request_headers( |
| 35 | installation_id: str, use_jwt: bool = False |
| 36 | ) -> dict[str, str]: |
| 37 | token = ( |
| 38 | generate_jwt_token(settings.GITHUB_APP_ID) |
| 39 | if use_jwt |
| 40 | else generate_token( |
| 41 | installation_id, |
| 42 | settings.GITHUB_APP_ID, |
| 43 | ) |
| 44 | ) |
| 45 | |
| 46 | return { |
| 47 | "X-GitHub-Api-Version": GITHUB_API_VERSION, |
| 48 | "Accept": "application/vnd.github.v3+json", |
| 49 | "Authorization": f"Bearer {token}", |
| 50 | } |
| 51 | |
| 52 | |
| 53 | def generate_token(installation_id: str, app_id: int) -> str: |
no test coverage detected
searching dependent graphs…