Skip to content

feat: emit X-MS-Manifest-Hash from the module manifest endpoint#142

Open
I-am-nothing wants to merge 1 commit into
mainfrom
feat/manifest-hash-header
Open

feat: emit X-MS-Manifest-Hash from the module manifest endpoint#142
I-am-nothing wants to merge 1 commit into
mainfrom
feat/manifest-hash-header

Conversation

@I-am-nothing

Copy link
Copy Markdown
Contributor

feat: emit X-MS-Manifest-Hash from the module manifest endpoint

The manifest endpoint now stamps X-MS-Manifest-Hash = hex(sha256(served body))
on its response — the single source of truth for a module's Go-declared manifest
hash. The platform and CLI both READ this header (never recompute), so their
hashes can never disagree. The hash reflects the declared surface
(pages/permissions/schedules/migrations/...) and is stable across esbuild JS
rebuilds (the manifest body carries no JS).

The body is encoded exactly as before (httputil.JSON's HTML-escaping encoder +
trailing newline) and hashed over those same bytes, so the served manifest stays
byte-identical. Header-only (not in the body → no self-reference). Additive wire
change; old readers ignore it.

Part of the 3-repo manifest hash-beat (api-platform + mirrorstack-cli).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

The manifest endpoint now stamps X-MS-Manifest-Hash = hex(sha256(served body))
on its response — the single source of truth for a module's Go-declared manifest
hash. The platform and CLI both READ this header (never recompute), so their
hashes can never disagree. The hash reflects the declared surface
(pages/permissions/schedules/migrations/...) and is stable across esbuild JS
rebuilds (the manifest body carries no JS).

The body is encoded exactly as before (httputil.JSON's HTML-escaping encoder +
trailing newline) and hashed over those same bytes, so the served manifest stays
byte-identical. Header-only (not in the body → no self-reference). Additive wire
change; old readers ignore it.

Part of the 3-repo manifest hash-beat (api-platform + mirrorstack-cli).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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