Require org_slug on POST /v1/apps (match real Fly) — v0.3.1#53
Merged
Conversation
Real Fly rejects app creation without org_slug with HTTP 400
("authorization: request doesn't contain org_slug"). mudflaps only
checked app_name and returned 201, letting a plan that would fail
against Fly pass offline. Enforce org_slug in the createApp handler
with the exact real-Fly error string.
Tests: add OrgSlug to every CreateAppRequest HTTP call site and a
negative test asserting 400 + an org_slug error body.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <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.
Fidelity fix found by testing chant's fly lexicon against real Fly:
POST /v1/appson real Fly rejects a request withoutorg_slug(HTTP 400"authorization: request doesn't contain org_slug"), but mudflaps accepted it (201). That let a plan which would fail on real Fly pass offline — false confidence.Fix
createAppnow returns 400 with the exact real-Fly error whenorg_slugis empty. Updated the 8 test call sites that created apps without an org, and added a negative test (TestCreateAppRequiresOrgSlug).Verify
go build/vet/test/-racegreen; golangci-lint v2.12.2 0 issues. Live:POST /v1/apps {"app_name":"x"}→ 400 (org_slug error); withorg_slug→ 201.Cuts as v0.3.1.
🤖 Generated with Claude Code