Skip to main content

GitHub App Access Token Fetcher

Utility to get access tokens for a GitHub App.

Prerequisites

  • The GitHub App must be created and installed.
  • A private key must be generated (from the GitHub App settings UI) and its content should be written as binary data to an AWS Secretsmanager secret.

To set up the private key, do something like this (assuming the secret is created already):

import boto3
secret_arn = "arn:aws:secretsmanager:us-east-1:1234:secret:my-secret-name"
pem_file = "/path/to/private_key.pem"
client = boto3.client('secretsmanager', region_name=secret_arn.split(':')[3])
with open(pem_file, 'rb') as f:
    client.put_secret_value(SecretId=secret_arn, SecretBinary=f.read())

Install

pip install github-app-access-token-fetcher

Usage

get-github-app-token --help

usage: get-github-app-token [-h] --app-id APP_ID --private-key-secret-arn PRIVATE_KEY_SECRET_ARN

Get a GitHub App token

optional arguments:
  -h, --help            show this help message and exit
  --app-id APP_ID       GitHub App ID
  --private-key-secret-arn PRIVATE_KEY_SECRET_ARN
                        ARN of the secret containing the GitHub App private key

Example:

export AWS_PROFILE=...  # Something with access to the private key secret.
get-github-app-token \
    --app-id 1234 \
    --private-key-secret-arn arn:aws:secretsmanager:us-west-1:4321:secret:abc-1234

Metadata

Release files for github-app-access-token-fetcher 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for github-app-access-token-fetcher 1.0.1
File Size Uploaded
github-app-access-token-fetcher-1.0.1.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for github-app-access-token-fetcher 1.0.1
File Interpreter ABI Platform
github_app_access_token_fetcher-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.7 kB

Release files / github-app-access-token-fetcher-1.0.1.tar.gz

Download URL github-app-access-token-fetcher-1.0.1.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cd00d670e858b9526703827af338d0ec5766c1e7069a6b23f46a7bba56d4bbea
BLAKE2b-256 checksum
How to use checksums
4e4ff76e1db367984ca9f6aaeb6f588dc225479171673966b56d598999948e26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.1 Linux/5.13.0-30-generic

Release files / github_app_access_token_fetcher-1.0.1-py3-none-any.whl

Download URL github_app_access_token_fetcher-1.0.1-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7281e91b2c3b350e846a9257bc6b0f7afa13ae5a55fd7d1bf57c8c4ec1fc523c
BLAKE2b-256 checksum
How to use checksums
00bfc2635ab5300f5df18d84740895b90c7633ef98479e0af5408dbdc338b6e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.1 Linux/5.13.0-30-generic

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page