Skip to content

Add coyote revoke and coyote certs CLI commands#12

Merged
bashgeek merged 3 commits into
mainfrom
add-revoke-certs-commands
May 9, 2026
Merged

Add coyote revoke and coyote certs CLI commands#12
bashgeek merged 3 commits into
mainfrom
add-revoke-certs-commands

Conversation

@bashgeek

@bashgeek bashgeek commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • coyote revoke — revokes a stored certificate by calling the issuing CA's ACME revocation endpoint. Accepts --identifier, --provider (must match the issuing CA), --storage, --key-type, --reason (all 9 RFC 5280 reasons), and EAB options for ZeroSSL/GTS/SSL.com. Uses a protected performRevoke() hook (same pattern as IssueCommand::performIssue()) for clean test stubbing.
  • coyote certs — lists all certificates in a filesystem storage directory, sorted by expiry date. Shows domain(s), key type, status, and expiry date with the same colour coding as coyote status.
  • README — replaced the "no revoke command" placeholder and shell-tooling workaround with full docs for both new commands (options tables, revocation reasons table, --help entries). Also removed three em-dashes.

Test plan

  • RevokeCommandTest — 25 tests: input validation (missing identifier/provider, unknown provider/key-type/reason, missing EAB), cert-not-found, success output (reason name, provider name, key type), AuthException and AcmeException handling, dataset covering all 9 reason strings
  • ListCommandTest — 16 tests: missing directory, empty storage, single/multiple certs with count, multi-domain display, all four status labels, all four key type labels, sort order (soonest-expiring first)
  • ApplicationTest — updated to assert certs and revoke are registered and appear in --help output
  • PHPStan level 8: no errors
  • PHP CS Fixer: no violations
  • 827 unit tests passing

@codecov-commenter

codecov-commenter commented May 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

bashgeek added 3 commits May 9, 2026 21:40
- Add `coyote revoke` command: revokes a stored certificate via the CA
  that issued it. Accepts --identifier, --provider, --storage, --key-type,
  --reason (all 9 RFC 5280 reasons), and EAB options for ZeroSSL/GTS/SSL.com.
  Uses a protected performRevoke() hook (same pattern as IssueCommand) so
  the stub test approach works cleanly.

- Add `coyote certs` command: lists all certificates in a filesystem storage
  directory, sorted by expiry date. Shows domain(s), key type, status, and
  expiry date with the same colour coding as `coyote status`.

- Register both commands in Application.php.

- Fix three em-dashes in README.md (two introduced in this session, one
  pre-existing in the provider slug docs section).

- Update CLI docs in README: replace the shell-tooling workaround and the
  "no revoke command" placeholder with proper documentation for both new
  commands, including options tables and the revocation reasons table.

- Add RevokeCommandTest (25 tests), ListCommandTest (16 tests), and update
  ApplicationTest to cover the two new commands.
Cover the three previously-missing lines in resolveKeyType() (ec384 and
rsa4096 arms) via a dataset test across all four key types. Cover
performRevoke() by running the real RevokeCommand against a fake-PEM
certificate, which triggers AcmeException('Could not parse the
certificate.') inside Certificate::revoke() before any network call.

Cover the ListCommand continue branch (unrecognised key type in filename)
with a test that writes a bare example.com.cert.json file.
@bashgeek bashgeek force-pushed the add-revoke-certs-commands branch from 681ae91 to e370a97 Compare May 9, 2026 13:40
@bashgeek bashgeek merged commit cc2c2e3 into main May 9, 2026
10 checks passed
@bashgeek bashgeek deleted the add-revoke-certs-commands branch May 9, 2026 13:41
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.

2 participants