Skip to content

cli: whitespace-normalized API-key names cannot be reused verbatim #77

Description

@sweetcornna

What happened

API-key creation trims surrounding whitespace during request parsing, but CLI disable, enable, and revoke resolve later name arguments using an unnormalized exact comparison.

Reproduction:

dor apikey create '  incident key  '
dor apikey disable '  incident key  '
dor apikey ls
dor apikey disable 'incident key'

Repeat with revoke in place of disable to reproduce the irreversible-command path.

Expected: The same accepted name spelling used at creation should resolve the resulting key, or creation should reject non-canonical input.

Actual: Creation stores incident key. Verbatim disable reports no such key, and verbatim revoke reports that nothing was revoked while the credential remains active. The trimmed spelling succeeds.

Impact: Scripts or operators reusing the original operand can fail to disable or revoke a credential, leaving it active until they use the normalized spelling.

dor doctor output

Not applicable — the normalization mismatch was reproduced through schemas, validation, SDK, CLI command functions, and an in-memory database and does not depend on host readiness. dor doctor was not run.

Environment

  • Reproduction mode: Focused-source reproduction
  • Dormice commit: 4417ae14938273f5d937c476cf7cdc57e22e53a5
  • Verification: Verified through the current shared schema, Fastify validation, SDK, CLI command functions, and in-memory database at 4417ae14938273f5d937c476cf7cdc57e22e53a5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions