Skip to content

Add GitHub App credentials configuration via admin UI#328

Open
manana2520 wants to merge 1 commit intoAIDotNet:mainfrom
keboola:upstream/github-app-ui-config
Open

Add GitHub App credentials configuration via admin UI#328
manana2520 wants to merge 1 commit intoAIDotNet:mainfrom
keboola:upstream/github-app-ui-config

Conversation

@manana2520
Copy link
Contributor

Summary

Adds a complete admin UI for managing GitHub App credentials without needing SSH/environment variable access to the server.

  • Configuration form in /admin/github-import for entering App ID, App Name, and Private Key (with PEM file upload)
  • Credential validation against GitHub API before saving (generates JWT, calls GET /app)
  • Database storage via SystemSettings table with in-memory cache (GitHubAppCredentialCache singleton)
  • Credential priority chain: DB cache -> IConfiguration -> env vars (backward compatible)
  • Connect/disconnect organizations with soft-delete support
  • Reset configuration to clear stored credentials and start fresh
  • Repository browser with search, language filter, pagination, and batch import
  • Full i18n (en, zh, ko, ja)

Backend changes

  • GitHubAppCredentialCache -- thread-safe singleton loaded from DB at startup
  • GitHubAppService -- JWT generation, GitHub API calls, installation token management
  • AdminGitHubImportService -- config CRUD, validation, org management, batch import
  • API endpoints: GET/POST/DELETE /api/admin/github/config, POST/DELETE /installations, GET /install-url, GET /installations/{id}/repos, POST /batch-import
  • Soft-delete aware upserts to prevent UNIQUE constraint violations on reconnect/re-save

Frontend changes

  • Admin page at /admin/github-import with configuration form, org list, and repo browser
  • Config form with PEM file upload button (reads .pem file into textarea)
  • Disconnect button per organization, reset configuration button
  • Config form hidden when already configured (shows repo list instead)

Test plan

  • Visit /admin/github-import without credentials configured -- config form and setup guide should appear
  • Enter valid App ID, App Name, upload PEM private key -- save should validate and succeed
  • Enter invalid credentials -- should show error message from GitHub API
  • After saving, page transitions to configured state with "Connect New Organization" button
  • Connect an org via GitHub App installation flow
  • Browse repos, search/filter, batch import to a department
  • Disconnect an org -- should soft-delete, disappear from list
  • Reconnect the same org -- should re-activate without errors
  • Reset configuration -- should clear credentials, show config form again
  • Re-save after reset -- should work without UNIQUE constraint errors

Adds a complete admin UI for configuring GitHub App credentials
(App ID, Private Key, App Name) without needing SSH access to
the server. Credentials are stored in the database and validated
against the GitHub API before saving.

Features:
- Configuration form with PEM file upload support
- In-memory credential cache (GitHubAppCredentialCache singleton)
  loaded from DB at startup, checked before env var fallback
- Credential validation via GitHub API (JWT + GET /app)
- Connect/disconnect GitHub organizations
- Reset configuration to start fresh
- Soft-delete aware upserts to prevent UNIQUE constraint violations
- Full i18n support (en, zh, ko, ja)

Backend:
- GitHubAppCredentialCache: thread-safe singleton for DB-backed creds
- GitHubAppService: JWT generation, installation token management
- AdminGitHubImportService: config CRUD, org management, batch import
- API endpoints: GET/POST/DELETE /config, POST/DELETE /installations,
  GET /install-url, GET /installations/{id}/repos, POST /batch-import

Frontend:
- Admin page at /admin/github-import
- Config form shown only when not configured
- Connected orgs list with disconnect button
- Repository browser with search, filter, pagination
- Batch import with department/language selection
@239573049
Copy link
Member

image This needs to be sorted out here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants