Repository navigation
Connections: say when Slack, Linear or GitHub is missing permissions; install ids for admins only - #1899
Merged
Conversation
… install ids for admins only (Code API 1.30) The Slack, Linear and GitHub status reads now each may carry reapprove (one plain sentence), missing (the permissions lacked, in plain words) and reapproveUrl. GitHub always gives reapproveUrl with reapprove. GitHub: GITHUB_APP_PERMISSIONS is the one list of what the App needs (the manifest is built from it). The installation's granted permissions are kept as a snapshot on its binding row, written at a claim (the App client's installation read, JWT, best effort) and by the signed installation created / new_permissions_accepted webhook; the read compares the snapshot and makes no GitHub call. Slack: Slack's x-oauth-scopes header on bot calls (the broker's transport and the channel plugin) updates the install record's scopes, at most one write per install in ten minutes, so reapprove appears or clears without a reconnect. missing names every scope Rovara asks for that the workspace lacks. Linear gets missing too. G1205-203: the GitHub read gives installation ids and operator records, and the permission fields, to a company owner or admin only; a member sees account name and status. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…backfill, no false banner
- Slack scopes refresh ran in six Lambdas, four of which (Slack intake, channel API, task notifier, sign-in function) had no State write, so the fire-and-forget UpdateItem was refused silently. Each now holds exactly UpdateItem on ORG#org_<20>#SLACK_INSTALL by LeadingKeys with the Null guard (SlackCompanyWorkspaces.grantObservedScopes); the write is never awaited, and a refused or failed write is logged (event, company, team, error name; never a token or the header).
- Existing GitHub installs had no permission snapshot until a claim or webhook. The reconciler now runs a bounded daily refresh (github-permissions-sweep.ts): a marker row holds the scan cursor or the next pass time, each active installation without a snapshot younger than 20 hours is read with the App's own JWT and kept (with its account type when the binding lacked it, so reapproveUrl is right for organizations). The reconciler gets the App's settings and a read of the App's private-key secret. A failed or empty read keeps unknown unknown.
- Unknown never says "needs permissions": a GitHub answer whose entry for a permission the App needs is unreadable, or with more than 100 entries, is no snapshot.
- missing names use GitHub's own words ("Pull requests: Read and write").
- A claim whose snapshot read fails now logs the error class.
- Tests: role-covers-writes test over the synthesized policies of every function that builds the wiring, sweep tests, observer logging tests; template pins, snapshots and the inventory move for exactly these changes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… next version) Versions keep increasing: the version file, the pins, the goldens and the comments move from 1.30 to 1.32. The contract surface digest is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…for admins, read-only GitHub sweep
- Slack scopes UpdateItem grant: only pk, sk, teamId, status, scopes and scopesAt may be
named (dynamodb:Attributes, Null-guarded), ReturnValues NONE only; the role-covers-writes
test now checks the attributes the real write names.
- Slack status read: scopes, reapprove and missing go to company owners and admins only
(live role, as GitHub and Linear); README and inventory updated.
- GitHub sweep: no new GitHub read once the run's time is spent (checked per installation,
not per page); three failures in a row end the run (outage or rate limit).
- Sweep GitHub access is read-only: its fetch passes only GET /app/installations/{id}
(App JWT) and refuses installation tokens, repository and write calls; the App key is
read per run and not kept. Tests for both.
- The reconciler's sweep reads env via reconcilerFromEnvironment (settings lint), and the
infrastructure and unwaited-task tests pin the one-secret GetSecretValue grant.
- Template digests re-pinned for the tightened grant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/code-api/src/version.ts # tests/contract/admin-health.test.ts # tests/contract/admin-read-contracts.test.ts # tests/contract/code-api-version.test.ts # tests/contract/developer-contracts.test.ts # tests/contract/developer-identity-server.test.ts # tests/contract/developer-share-contracts.test.ts # tests/contract/developer-task-shapes.test.ts # tests/fixtures/signin-company-goldens/configuration.json
…ine merge The merge moved failureFields out of slack-direct-front.ts (this branch) under mainline's new REPLY marker rows, so both rows sit eight lines higher: 130:17 and 149:19. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chet is unchanged The GitHub permission sweep wiring takes the reconciler's log line, and the Slack company wiring takes an optional log from each caller that already owns a sink (broker, developer identity, notifier, reconciler, Slack ingress). The channel API Lambda has no sink and passes none. company-log-sites.json is not edited. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The banner can now say whenever any connected app (Slack, Linear or GitHub) is missing a permission Rovara needs.
company.github.read,company.slack.read,company.linear.read) now name themselves and may carryreapprove(one plain sentence),missing(permissions lacked, e.g. "Pull requests: write") andreapproveUrl. GitHub always givesreapproveUrlwithreapprove, at the top and on each installation. All optional and read tolerantly.GITHUB_APP_PERMISSIONSis the single list of what the App needs; the App manifest is built from it. The installation's granted permissions are a stored snapshot on its binding row, written at a claim (the App client's installation read with the App JWT, best effort) and by the signedinstallationcreated/new_permissions_acceptedwebhook. The status read compares the snapshot and makes no GitHub call.reapproveUrlis the installation's GitHub settings page (organization or user form).x-oauth-scopesheader on bot calls (the broker's transport and the channel plugin) updates the install record's scopes, at most one write per install in ten minutes (in memory and in the record's condition).reapprovenow appears or clears without a manual reinstall.missingnames every scope Rovara asks for that the workspace lacks. Linear getsmissingtoo.Notes for review
installationevent, and say nothing until then (nothing is guessed).reapproveUrlcarries the installation id.installationIdas optional.Tests
New and updated: missing-permission computation for each provider, header capture and throttle, owner/admin-only install ids, webhook refresh, API version digest and goldens (1.30), company-inventory. typecheck:all, eslint, complexity:check, tests/contract, tests/journeys and the inventory and pin tests pass; vitest on every test file importing a changed source.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.