kleides

Demo · M0

Discover

verified in CI · 2026-11-20 · c06551c

The transcript below is recorded by a test that runs the real command-line tool against a local test setup. Identifiers, times and ports are replaced with numbered placeholders so the transcript is stable from run to run.

## A mock issuer has two keys; one is deployed to a local file and to a GitHub Actions secret.
## Discover runs under the read-only client: any write would fail before leaving the process.
$ rotor discover --providers mockvendor,file,github-actions --scope file.dir=<dir>/secrets --scope github-actions.repos=acme/billing > draft.yaml
discover: 2 key(s), 3 deployed secret(s), 1 proposed credential(s), 1 orphan(s), 1 dead key(s); 0 writes
$ cat draft.yaml
note: 'Draft from rotor discover. Every proposed deployment is a guess (see why); set a tier, review, then: rotor adopt <this file> <id>'
tenant: default
credentials:
    - id: billing
      guess: true
      tier: ""
      mode: observe
      rotator: mockvendor
      key:
        id: <key-id-1>
        name: billing-initial
        created: "<time>"
        last_used: never
        status: active
      targets:
        - id: file-1
          system: file
          ref: <dir>/secrets/BILLING_KEY
          why: key name matches the secret name; value has the known prefix mv_
        - id: gha-2
          system: github-actions
          ref: acme/billing/BILLING_KEY
          why: key name matches the secret name; same name in several places
orphans:
    - system: github-actions
      ref: acme/billing/DEPLOY_TOKEN
      why: no issuer key could be matched
dead_keys:
    - vendor: mockvendor
      key: <key-id-2>
      why: not found deployed anywhere discovered; never used
## Adopt one entry. It starts in observe mode: plans and drift only.
$ rotor adopt draft.yaml billing --tier medium --yes
adopting billing (tier medium, observe mode), key <key-id-1>
  deployment file-1 file <dir>/secrets/BILLING_KEY: present
  deployment gha-2 github-actions acme/billing/BILLING_KEY: present
adopted billing in observe mode with 2 deployment(s)
$ rotor deployments billing
deployments for billing (current key <key-id-1>, version 0)
  file-1 file             <dir>/secrets/BILLING_KEY
         key <key-id-1> via adoption (adopted)
         drift: in sync; detection: fingerprint compare, exact
  gha-2  github-actions   acme/billing/BILLING_KEY
         key <key-id-1> via adoption (adopted)
         drift: in sync (best-effort); detection: updated_at compare, best-effort, 1s
$ rotor rotate billing
rotor: refused: billing is in observe mode (plans and drift only); change mode to managed to rotate it
## vendor writes during discover and adopt: 0

Back to the roadmap