Skip to content

feat: Show available secrets in status command #6

Description

@joelhooks

Summary

Enhance secrets status to show available secret names for lease suggestions.

Context

File: cmd/secrets/status.go:64

// TODO: Get actual secret names from daemon to suggest specific leases

Problem

Currently secrets status shows active leases but doesn't show what secrets are available to lease. This makes the HATEOAS actions generic rather than specific.

Current behavior

{
  "actions": [
    {"command": "secrets lease <name>"}  // generic
  ]
}

Desired behavior

{
  "data": {
    "available_secrets": ["github_token", "anthropic_key", "stripe_key"],
    "active_leases": [...]
  },
  "actions": [
    {"command": "secrets lease github_token"},
    {"command": "secrets lease anthropic_key"},
    {"command": "secrets lease stripe_key"}
  ]
}

Implementation

  1. Add ListSecrets method to daemon protocol
  2. Call from status command
  3. Use output.ActionsForSecrets(names) (already exists!)

Daemon changes

// internal/daemon/handlers.go
func (d *Daemon) handleList(req *Request) *Response {
    names, err := d.store.List()
    // return names
}

Status command

names, _ := rpcCall("list", nil)
actions := output.ActionsForSecrets(names)

Acceptance

  • secrets status shows available secret names
  • HATEOAS actions include specific lease commands
  • Works when store is empty (shows add actions instead)

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions