Reference
GitHub (API Key)
Connect GitHub to Alter Vault using a personal access token for secure API access
Overview
Section titled “Overview”Use GitHub credentials to make authenticated API calls through Alter Vault without exposing API keys in code.
| Property | Value |
|---|---|
| Provider ID | github |
| Category | Developer Tools |
| Credential Type | Bearer Token |
Step 1: Get Credentials
Section titled “Step 1: Get Credentials”Log in to GitHub
Log in to your GitHub account at github.com.
Go to Developer Settings → Personal access tokens
Choose token type
Choose ‘Fine-grained tokens’ (recommended) or ‘Tokens (classic)’.
Generate a new token
Click ‘Generate new token’ and configure scopes.
Copy your token
Copy the generated token (it won’t be shown again).
Step 2: Add to Alter Vault
Section titled “Step 2: Add to Alter Vault”Open the Developer Portal
Go to portal.alterauth.com and navigate to the application.
Add GitHub
Go to Managed Secrets > Add Provider > GitHub.
Enter credentials
Paste your Personal Access Token into the credential field.
Save
Click Save. You’ll receive a grant_id to use with the SDK.
Using in Code
Section titled “Using in Code”response = await alter_app.request( HttpMethod.GET, "https://api.github.com/user/repos", grant_id="YOUR_GRANT_ID",)Policy-cataloged operations
Section titled “Policy-cataloged operations”Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.
| Operation ID | Families | Method | Provider path |
|---|---|---|---|
repos/get | read | GET | /repos/{owner}/{repo} |
repos/list-for-authenticated-user | read | GET | /user/repos |
repos/list-for-org | read | GET | /orgs/{org}/repos |
repos/create-for-authenticated-user | write | POST | /user/repos |
repos/update | admin | PATCH | /repos/{owner}/{repo} |
repos/delete | delete | DELETE | /repos/{owner}/{repo} |
issues/list-for-repo | read | GET | /repos/{owner}/{repo}/issues |
issues/get | read | GET | /repos/{owner}/{repo}/issues/{issue_number} |
issues/create | write | POST | /repos/{owner}/{repo}/issues |
issues/update | write | PATCH | /repos/{owner}/{repo}/issues/{issue_number} |
issues/create-comment | write | POST | /repos/{owner}/{repo}/issues/{issue_number}/comments |
issues/add-labels | write | POST | /repos/{owner}/{repo}/issues/{issue_number}/labels |
reactions/create-for-issue | write | POST | /repos/{owner}/{repo}/issues/{issue_number}/reactions |
pulls/list | read | GET | /repos/{owner}/{repo}/pulls |
pulls/get | read | GET | /repos/{owner}/{repo}/pulls/{pull_number} |
pulls/create | write | POST | /repos/{owner}/{repo}/pulls |
pulls/update | write | PATCH | /repos/{owner}/{repo}/pulls/{pull_number} |
pulls/merge | write | PUT | /repos/{owner}/{repo}/pulls/{pull_number}/merge |
pulls/create-review | write | POST | /repos/{owner}/{repo}/pulls/{pull_number}/reviews |
repos/get-content | read | GET | /repos/{owner}/{repo}/contents/{path} |
repos/create-or-update-file-contents | write | PUT | /repos/{owner}/{repo}/contents/{path} |
repos/delete-file | delete | DELETE | /repos/{owner}/{repo}/contents/{path} |
repos/list-branches | read | GET | /repos/{owner}/{repo}/branches |
repos/list-commits | read | GET | /repos/{owner}/{repo}/commits |
repos/get-commit | read | GET | /repos/{owner}/{repo}/commits/{ref} |
git/create-ref | write | POST | /repos/{owner}/{repo}/git/refs |
git/delete-ref | delete | DELETE | /repos/{owner}/{repo}/git/refs/{ref} |
repos/list-releases | read | GET | /repos/{owner}/{repo}/releases |
repos/create-release | write | POST | /repos/{owner}/{repo}/releases |
gists/create | write | POST | /gists |
actions/list-workflow-runs-for-repo | read | GET | /repos/{owner}/{repo}/actions/runs |
actions/create-workflow-dispatch | write | POST | /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches |
repos/list-collaborators | read | GET | /repos/{owner}/{repo}/collaborators |
repos/add-collaborator | admin | PUT | /repos/{owner}/{repo}/collaborators/{username} |
repos/remove-collaborator | admin | DELETE | /repos/{owner}/{repo}/collaborators/{username} |
repos/list-webhooks | read | GET | /repos/{owner}/{repo}/hooks |
repos/create-webhook | admin | POST | /repos/{owner}/{repo}/hooks |
repos/delete-webhook | admin, delete | DELETE | /repos/{owner}/{repo}/hooks/{hook_id} |
search/repos | read | GET | /search/repositories |
search/code | read | GET | /search/code |
search/issues-and-pull-requests | read | GET | /search/issues |
users/get-authenticated | read | GET | /user |
orgs/get | read | GET | /orgs/{org} |
orgs/list-members | read | GET | /orgs/{org}/members |
teams/list | read | GET | /orgs/{org}/teams |