OnePassword, LastPass + Bitwarden adapters
This commit is contained in:
@@ -2,9 +2,12 @@ class Kamal::Cli::Secrets < Kamal::Cli::Base
|
||||
desc "fetch [ITEM] [FIELDS...]", "Fetch secrets from a vault"
|
||||
option :adapter, type: :string, aliases: "-a", required: true, desc: "Which vault adapter to use"
|
||||
option :account, type: :string, aliases: "-a", required: true, desc: "The account identifier or username"
|
||||
def fetch(item, *fields)
|
||||
option :location, type: :string, aliases: "-a", required: false, desc: "A vault or folder to fetch the secrets from"
|
||||
def fetch(*secrets)
|
||||
ENV["KAMAL_SECRETS_KILL_PARENT"] = "1"
|
||||
puts JSON.dump(adapter(options[:adapter]).fetch(item, fields, account: options[:account])).shellescape
|
||||
|
||||
results = adapter(options[:adapter]).fetch(secrets, **options.slice(:account, :location).symbolize_keys)
|
||||
puts JSON.dump(results).shellescape
|
||||
end
|
||||
|
||||
desc "extract", "Extract a single secret from the results of a fetch call"
|
||||
|
||||
Reference in New Issue
Block a user