Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
connectwidgets-example: extensions/connectwidgets-example/**
plumbertableau-example: extensions/plumbertableau-example/**
fastapitableau-example: extensions/fastapitableau-example/**
github-app-tester: extensions/github-app-tester/**
portfolio-report: extensions/portfolio-report/**
script-r: extensions/script-r/**
top-5-income-share-streamlit: extensions/top-5-income-share-streamlit/**
Expand Down
43 changes: 43 additions & 0 deletions extensions/github-app-tester/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# GitHub App Integration Tester

A Shiny for Python app to test GitHub App (service account) integrations on Posit Connect.

## Features

- Automatically obtains an installation token using the posit-sdk
- Shows token information (type, prefix)
- Lists all accessible repositories with their permissions
- Displays rate limit status

## Deployment to Connect

1. Deploy this app to your Posit Connect server
2. Associate it with your GitHub App integration in the Connect UI (Settings > OAuth Integrations)
3. Run the app - it will automatically get an installation token and show accessible repositories

## How it works

When deployed on Connect with a GitHub App integration:

1. Connect provides a `CONNECT_CONTENT_SESSION_TOKEN` environment variable
2. The app uses posit-sdk to exchange this token for GitHub credentials:
```python
from posit import connect
client = connect.Client()
credentials = client.oauth.get_content_credentials(content_session_token)
```
3. The `access_token` from the credentials is a GitHub App installation token (`ghs_...`)
4. This token is used to query the GitHub API

## What this app tests

1. **Token exchange**: Can the app exchange the content session token for GitHub credentials?
2. **Token type**: Is the token a valid GitHub App installation token (`ghs_` prefix)?
3. **Repository access**: Which repositories can the token access?
4. **Permissions**: What permissions does the token have on each repository?

## Troubleshooting

- **"CONNECT_CONTENT_SESSION_TOKEN not available"**: Make sure a GitHub App integration is associated with this content
- **"No repositories accessible"**: The GitHub App may not be installed on any repositories
- **403 errors**: The GitHub App may not have the required permissions
Loading
Loading