PR-B — enable the credential API on the crate app + real READMEs - #7
Merged
Conversation
Enable Crate's admin-token credential API and document the shipped registry/client surfaces for launch readiness. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Order the CRATE_URL export before the composer config line so a copy-paste customer setup does not configure an empty repository URL, and clarify that token:create dispatches to the environment via the Cloud CLI (or --execute to run on the environment directly). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
PR-B — enable the credential API on the crate app + real READMEs (Build step 7b)
Bumps the consumed
built-for-cloudto^0.2, turns on its HTTP credential API so a deployed Crate can issue/revoke credentials over/api/credentials, and replaces the placeholder READMEs with real, accurate docs. Final PR of step 7.What shipped (vs the plan)
built-for-cloud→^0.2incrate-server(composer.lock now pins v0.2.0), consumed as a normal published dependency — the package itself is not modified.config/built-for-cloud.phpwithcredential_api.enableddefaulting on for Crate; the provider mountsGET|POST /api/credentialsandDELETE /api/credentials/{name}, each behindEnsureAdminToken(bfc.token.admin). Verified withroute:list.tests/Feature/CredentialApiTestproves the endpoint is live and admin-gated: no token → 401; an admin-ability token (minted viaTokenRegistry::store(..., ['admin'])) → 200 onGET(list) and 201 onPOST(issue →{name, plaintext, expires_at}).crate:auth→composer requirethrough the gate; documentstoken:create --abilities=admin) and one per package (crate-contracts,crate-client,crate-server) accurate to the shipped commands/routes/APIs.Deserves attention (the security-sensitive bit)
env('BUILT_FOR_CLOUD_CREDENTIAL_API_ENABLED', true). Because every route requires a valid admin-ability bearer token (EnsureAdminToken), "enabled" without an admin token still returns 401 to everyone — so default-on is safe and product-appropriate. It can be turned off per-environment with the env flag. No token or secret is hardcoded or committed.Findings disposition
77c1912): the customer-setup snippet nowexportsCRATE_URLbefore thecomposer configline (a copy-paste would otherwise use an empty URL), and thetoken:createstep now notes it dispatches to the environment via the Cloud CLI (or--executeto run on the environment directly).Gate evidence (verified by the coordinator on committed SHA
9dcc4f1; the only later change,77c1912, is README-only)composer ready→ exit 0 (pintpassed, phpstanerrors:0, pest 35/89,composer audit: no advisories); tree clean.composer packages:check→ exit 0; all packages green.route:list --path=api/credentials→GET|POST api/credentials+DELETE api/credentials/{name}, all behindEnsureAdminToken.Risk / next
/api/credentials, and ships an issuer SDK + consumer helper (PR-A) plus accurate docs.v*release tag was pushed (Ed-authorized). Remaining roadmap item is step 8's Cloud provisioning installer (crate:install) if/when desired.🤖 Generated with Claude Code