Skip to content

v3.21.0: GitHub App sign-in for backfill

Choose a tag to compare

@kitfunso kitfunso released this 30 Nov 01:39
· 26 commits to master since this release
a1742cb

Added

  • hippo github backfill can sign in as a GitHub App. Set GITHUB_APP_ID and GITHUB_APP_PRIVATE_KEY_FILE, and optionally GITHUB_APP_INSTALLATION_ID. Hippo mints a one-hour installation token limited to the repository and replaces it before it expires, so a long run no longer stops at the hour mark. The key is read from the file only and never from env. A fully set App wins over GITHUB_TOKEN. Outer whitespace on GITHUB_TOKEN is trimmed.
  • The GitHub webhook route and hippo github dlq replay make no GitHub API call, so they need no token.

Changed

  • A reply that is not JSON no longer carries the parser's message. That message can quote part of the reply, so an error or a log line could show a secret the server echoed.
  • GITHUB_TOKEN must use only the GitHub token characters. Those are letters, digits, _, . and -; any other character exits 2 with a fixed text that does not repeat the value.
  • A GitHub error or broken reply that echoes the token shows [token] in place of any 8-character piece of it, and its cause keeps no reply bytes. A next-page link that holds a piece of the token is refused before it is followed, and the error names only the request's own host and path.

Fixed

  • A connector write whose event is already logged answers duplicate when it is held for review too. A resend of a held write with the same event and memory id answers duplicate and stores nothing, as the store port promises.
  • git runs from its PATH location. hippo finds git's full path once for each PATH value, from the absolute folders on PATH (in PATHEXT order on Windows), and starts that file for every git call, including the calls hippo_learn and hippo_context make. With PATH unset on Linux and macOS, it searches /usr/bin and /bin, as the system does. hippo watch and the process-tree kill start a program they find on PATH by its full path on every platform, and a bare name that is not on PATH fails as not found. On Windows a bare name matches only .com, .exe, .bat and .cmd files, and the .cmd shim runner starts cmd.exe from the System32 folder, or fails as not found when SystemRoot is not a full path with a drive letter or a server name. With no git on PATH, hippo reports git as missing.
  • A GitHub delivery hippo does not handle or cannot use parks in the tenant it routes to. On a server with route rows, an unhandled event type, a body with no delivery id, or JSON that is not a webhook envelope now parks in the tenant its installation or repository routes to, so that tenant can list and replay it. One that routes nowhere, or a body that is not JSON, parks with no tenant, unless GITHUB_ALLOW_UNKNOWN_INSTALLATION_FALLBACK is set; list those with HIPPO_TENANT=__unroutable__ hippo github dlq list. An install with no route rows parks them in the host tenant. A host_mismatch body that is not an envelope, and a Slack body that is not an event envelope but names a team, route the same way; list Slack rows with no tenant with HIPPO_TENANT=__unroutable__ hippo slack dlq list.
  • hippo slack backfill reads each channel's privacy from Slack and honours --since. The backfill asks conversations.info and files private channels, DMs and group DMs under slack:private, and public channels under slack:public. It exits 3 and imports nothing when conversations.info does not answer. --since is the lower bound on every page; the backfill starts at the later of --since and the saved cursor, and saves --since as the cursor when it is later. An unreadable, impossible or future --since exits 1. The token needs channels:read and channels:history (groups:read and groups:history for a private channel, im:read and im:history for a DM, mpim:read and mpim:history for a group DM).

Security

  • The project write gate compares a row's stored project as an opaque string. A stored origin never passed the caller-project name check, so a gate must match it exactly as stored.