Skip to content

Fix secrets command not showing error message#108

Merged
davidallendj merged 1 commit into
mainfrom
fix-secrets-cmd
Jul 9, 2025
Merged

Fix secrets command not showing error message#108
davidallendj merged 1 commit into
mainfrom
fix-secrets-cmd

Conversation

@davidallendj

@davidallendj davidallendj commented Jul 9, 2025

Copy link
Copy Markdown
Collaborator

Addresses #94.

Running the following should produce an error since there is no add sub-command:

magellan secrets add host user:pass

@bmcdonald3

Copy link
Copy Markdown
Member

I don't think I'm seeing an error thrown here:

# magellan secrets add host user:pass

works just fine for me...

@davidallendj

davidallendj commented Jul 9, 2025

Copy link
Copy Markdown
Collaborator Author

Yeah, it actually should be a help message. Do you see that? If not, you might be on a different branch.

@synackd

synackd commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

Yeah, it actually should be a help message. Do you see that? If not, you might be on a different branch.

I am seeing it:

$ ./magellan secrets add host user:pass
Manage credentials for BMC nodes to for querying information through redfish. This requires generating a key and setting the 'MASTER_KEY' environment variable for the secrets store.

Usage:
  magellan secrets [command]

Examples:

  // generate new key and set environment variable
  export MASTER_KEY=$(magellan secrets generatekey)

  // store specific BMC node creds for collect and crawl in default secrets store (--file/-f flag not set)
  magellan secrets store $bmc_host $bmc_creds

  // retrieve creds from secrets store
  magellan secrets retrieve $bmc_host -f nodes.json

  // list creds from specific secrets
  magellan secrets list -f nodes.json

Available Commands:
  generatekey Generates a new 32-byte master key (in hex).
  list        Lists all the secret IDs and their values.
  remove      Remove secrets by IDs from secret store.
  retrieve    
  store       Stores the given string value under secretID.

Flags:
  -f, --file string   Set the secrets file with BMC credentials. (default "secrets.json")
  -h, --help          help for secrets

Global Flags:
      --access-token string   Set the access token
      --cache string          Set the scanning result cache path (default "/tmp/admin/magellan/assets.db")
  -j, --concurrency int       Set the number of concurrent processes (default -1)
  -c, --config string         Set the config file path
      --debug                 Set to enable/disable debug messages
  -t, --timeout int           Set the timeout for requests in seconds (default 5)
  -v, --verbose               Set to enable/disable verbose output

Use "magellan secrets [command] --help" for more information about a command.

@davidallendj davidallendj linked an issue Jul 9, 2025 that may be closed by this pull request
@bmcdonald3

Copy link
Copy Markdown
Member

Whoops, yeah, I was running my bin executable, not the one built off this branch, it is working for me too:

# ./magellan secrets add host user:pass
Manage credentials for BMC nodes to for querying information through redfish. This requires generating a key and setting the 'MASTER_KEY' environment variable for the secrets store.

Usage:
  magellan secrets [command]

Examples:

  // generate new key and set environment variable
  export MASTER_KEY=$(magellan secrets generatekey)

  // store specific BMC node creds for collect and crawl in default secrets store (--file/-f flag not set)
  magellan secrets store $bmc_host $bmc_creds

  // retrieve creds from secrets store
  magellan secrets retrieve $bmc_host -f nodes.json

  // list creds from specific secrets
  magellan secrets list -f nodes.json

Available Commands:
  generatekey Generates a new 32-byte master key (in hex).
  list        Lists all the secret IDs and their values.
  remove      Remove secrets by IDs from secret store.
  retrieve
  store       Stores the given string value under secretID.

Flags:
  -f, --file string   Set the secrets file with BMC credentials. (default "secrets.json")
  -h, --help          help for secrets

Global Flags:
      --access-token string   Set the access token
      --cache string          Set the scanning result cache path (default "/tmp/root/magellan/assets.db")
  -j, --concurrency int       Set the number of concurrent processes (default -1)
  -c, --config string         Set the config file path
      --debug                 Set to enable/disable debug messages
  -t, --timeout int           Set the timeout for requests in seconds (default 5)
  -v, --verbose               Set to enable/disable verbose output

Use "magellan secrets [command] --help" for more information about a command.

@davidallendj
davidallendj merged commit 376dfc6 into main Jul 9, 2025
7 checks passed
@davidallendj
davidallendj deleted the fix-secrets-cmd branch July 9, 2025 17:01
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.

[BUG] Non-existent secrets sub-commands returns no output/error

3 participants