Skip to content

Epic: Core refactor — reference strings, batch grants, and injection overhaul #39

@helixclaw

Description

@helixclaw

Summary

Refactor core features based on design feedback to improve developer ergonomics and security:

  1. Human-readable reference strings — Add a ref field to secrets (e.g., perplexity-api-key) that serves as an alternative lookup key alongside UUIDs.
  2. Batch grants — Allow multiple secrets to be requested in a single approval, producing a grant that unlocks all of them.
  3. Injection overhaul — Scan env vars for 2k://{ref} or 2k://{uuid} placeholders and replace with secret values, support multiple --grant flags, and redact secret values from subprocess stdout/stderr.

Design Decisions

  • The existing name field on SecretEntry becomes ref — a unique, URL-safe slug used for both display and lookup.
  • Batch grants introduce secretUuids: string[] on AccessRequest and AccessGrant, replacing the singular secretUuid.
  • Placeholder injection (2k://) is a new injection mode complementing the existing --env approach.
  • Redaction wraps subprocess stdout/stderr streams, replacing any occurrence of a secret value with [REDACTED].

Scope

All changes are in the core library (src/core/), CLI (src/cli/), types (src/core/types.ts), and tests (src/__tests__/). No server API changes in this epic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions