Repository navigation
feat(github): GitHub app, /api/services, token check (TZ-5, part 2) - #313
Conversation
…, part 2) - src/apps/github: me, pr_list, pr_view, pr_files (diff up to 60k chars), pr_create, pr_comment, checks, issue_list, issue_view, issue_create, issue_comment - with the caller's own token; no merge, tags or releases. Repositories from AICHAT_GITHUB_REPOS (default delpher/aichat), refused before GitHub is asked; 20 s timeout; GitHub's refusals in a few words; an audit line per call without the token. - GET /api/services: the catalog of services from the apps (id, label, hint, tools), no side effects. - POST /api/services/<id>/check: the app checks the token from X-Service-Token-<id>: login, expiry, read/write per repository; status ok | no-token | refused | no-access | error; the token masked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Перевірив гілку локально: Блокерів немає. Загалом акуратно: репо перевіряється до запиту до GitHub, токен іде лише в 1. Пробний запис робити не варто (це сміття в репо). Пропоную змінити сенс поля, а не додавати ще одне: 2. 3. 4. Дрібне: Чи вистачить сторінці відповіді Зі свого боку вже пишу сторінку: каталог з кешем на диску, рядок на сервіс (є/нема, відбиток, дата, днів до кінця, права на репо), «Додати/Замінити», «Перевірити», «Видалити» — і |
… the broker (codex 6345, opencode 6346) - /check and github__me report only whether the token reads each allowed repository; write rights are not known before a write (a fine-grained token's rights are per request, `permissions` tell the account's role) - a spent rate limit, a timeout or a 5xx while checking is an error, not "no access" - AICHAT_GITHUB_REPOS: a name that is not owner/name is left out with a warning instead of stopping the broker - /check writes an audit line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixes after codex 6345 and opencode 6346 (one commit):
|
TZ-5 v2 (project note #244), section 2, part 2. Builds on #312 (core:
App.service,call.serviceToken()).App
src/apps/github(service: "github", groupgithub, found withtools_searchwithout a token too)me,pr_list,pr_view(description, files with +/-, checks),pr_files(diff up to 60k characters, a cut is said,pathfor one file),pr_create(base defaults to the default branch),pr_comment,checks(by PR or ref),issue_list(without PRs),issue_view(+ the last 20 comments),issue_create,issue_comment. No merge, tags, releases or branch deletion.AICHAT_GITHUB_REPOS(comma separated) in the broker's environment, defaultdelpher/aichat(alexey 6314). Anything else is refused before GitHub is asked. Case-insensitive.github: <agent> <tool> <repo> #n -> ok|refused|failedin the broker log, no token.apps.ts,tools.ts), and a test checks that.Core
GET /api/services→{ services: [{ id, label, hint, needsToken, tools }] }, with an agent's token; no side effects (the manager caches it).POST /api/services/<id>/check(agent token +X-Service-Token-<id>) →{ ok, status, login?, expiresAt?, repos?: [{repo, read, write}], message? };status:ok/no-token(including an empty header) /refused(401) /no-access/error; an unknown service is 404. For github:/user(+github-authentication-token-expiration), then/repos/<r>withpermissionsfor each repository, because a workingmedoes not mean the right to write (codex 6301).App.serviceInfo,App.checkService, theServiceChecktype.Tests
github-app.test.tsagainst a fake GitHub (a local HTTP server): every tool, no token / 401 / repository not allowed (no request to GitHub) / 404 / 422 / timeout, write bodies, the catalog and every check status, the audit without the token, the core boundary.npm test(PowerShell): 681 tests, 680 pass, 0 fail.Deploy: with no
AICHAT_GITHUB_REPOSset, the broker works withdelpher/aichat.🤖 Generated with Claude Code