Skip to content

fix: harden GitHub App provisioning callbacks and inputs - #1924

Merged
gerchowl merged 2 commits into
devfrom
bugfix/1919-gh-app-provision-hardening
Oct 27, 2026
Merged

gerchowl merged 2 commits into
devfrom
bugfix/1919-gh-app-provision-hardening

Conversation

@gerchowl

@gerchowl gerchowl commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

A browser reload or concurrent callback could repeat the single-use manifest exchange and replace a successful result with an error. Claim the callback before processing so subsequent requests return a fixed HTTP 200 page without changing state.

Type of Change

  • fix -- Bug fix
  • test -- Adding or updating tests
  • feat -- New feature
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Guard callback replay and overlapping requests with a lock and a claimed flag.
  • Require an HTTP(S) scheme and host for --base-url; make it mutually exclusive with explicit --host.
  • Pin sanitized exchange timeout and malformed JSON errors, checking terminal and callback output for secret values.
  • Check the chosen secret prefix in the skill before provisioning; document callback and CLI behavior and remove the resolved known limits.

Changelog Entry

Fixed

  • Harden GitHub App provisioning callbacks and inputs (#1919)
    • Accept callbacks only once, including concurrent requests, and preserve the original result on replay
    • Validate reverse-proxy URLs and reject combining --host with --base-url; cover exchange timeout and malformed JSON errors without exposing secrets
    • Check the chosen secret prefix before the provisioning skill creates another App

Testing

  • Tests pass locally (just test) -- full suite reserved for CI per task instructions.
  • Manual testing performed (describe below)
  • RED: uv run --with pytest-xdist pytest packages/vig-utils/tests/test_gh_app_provision.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1919 -- exit 1, 9 failed / 36 passed before implementation. Existing sanitized timeout/JSON behavior already passed.
  • RED: uv run --with pytest-xdist pytest tests/test_devkit_plugin.py -k app_provision_checks -n 4 --basetemp=$HOME/.cache/devkit-pytest/1919 -- exit 1, 1 failed before implementation.
  • GREEN: uv run --with pytest-xdist pytest packages/vig-utils/tests/test_gh_app_provision.py tests/test_devkit_plugin.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1919 -- exit 0, 263 passed, including lookup-before-dispatch coverage.
  • GREEN (exact acceptance command): uv run --with pytest-xdist pytest packages/vig-utils/tests/test_gh_app_provision.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1919 -- exit 0, 45 passed before the final rebase; the combined 263-test suite passed again after the final rebase.
  • Commits run inside nix develop with repository hooks enabled.

Manual Testing Details

Self-reviewed the diff and callback claim ordering. No live App was created; network and secret writes are mocked in tests.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (standalone guide and skill; no template changes needed)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

All 16 checks passed on 04232c8d94b145244871c88bae170c369efc6bb3; CI run 40476885094 completed successfully, including the final Test Summary gate.

Timeout and malformed JSON errors retain the existing generic sanitized message. Explicit --host with --base-url now exits 2 rather than silently ignoring --host.

Refs: #1919

@gerchowl
gerchowl force-pushed the bugfix/1919-gh-app-provision-hardening branch from a6209aa to 04232c8 Compare October 27, 2026 08:55
@gerchowl
gerchowl merged commit 80b4449 into dev Oct 27, 2026
16 checks passed
@gerchowl
gerchowl deleted the bugfix/1919-gh-app-provision-hardening branch October 27, 2026 09:04
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.

1 participant