PR-B: cloud token administration (runner + commands)#2
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 — cloud token administration (CLI)
Adds the Cloud-CLI-driven token administration layer on top of the PR-A core.
What shipped (vs plan)
CloudCommandRunner— wraps the Laravel Cloud CLI via the Process facade.resolveEnvironment()(1 env → auto, many → prompt, 0 → throw; app id from config or.cloud/config.json);run()executescommand:run <env> --cmd "php artisan ..." --json --fields=output,exitCode --no-interactionand parses the JSON.Contracts\UsageReporter+NullUsageReporter(singleton-bound; consuming apps override).token:create|rotate|revoke|list|usage+fallback-token:generate, each with a driver (default) and hidden--executemode.Deserves attention
--cmd— only its sha256--hashcrosses the wire; plaintext prints locally exactly once, and only after a zero remote exit code.run()throws on a missing/non-numericexitCode;token:list/token:usagethrow on malformed/non-list remote JSON rather than rendering an empty table. Prevents a corrupt Cloud response from looking like success.escapeshellarg-quoted in the--cmdstring;token:list/token:usagenever exposetoken_hash.Findings disposition
exitCodeparsing + a missing rotate driver security test (both fixed), plus advisories — list/usage fail-closed and an envidguard folded in.--executefrom--help(only mutates the local DB; fragile to implement) and a faked multi-env prompt test.Gate evidence
composer lint:test→ passed ·composer stan(level 6) → no errors ·composer test→ 38 passed (77 assertions)Risk / next
Low risk; additive package code. After merge: tag
v0.1.0(Packagist stable), then PR-C wires the package into Matte.