itamae-secrets for mitamae
Ruby C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mrblib/mitamae-secrets
src
test
tools/mitamae-secrets
.clang-format
.gitignore
.travis.yml
LICENSE
README.md
Rakefile
build_config.rb
mrbgem.rake
run_test.rb

README.md

mitamae-secrets

Build Status

itamae-secrets for mitamae

Usage

store = MitamaeSecrets::Store.new('/path/to/secret')
# Decrypt /path/to/secret/values/secret_password with the key in /path/to/secret/keys
store.fetch('secret_password')  # => "P@ssw0rd"

# Store encrypted value with default key
store.store('secret_password', 'P@ssw0rd')

# Store encrypted value with "foobar" key
store.store('secret_password', 'P@ssw0rd', 'foobar')

CLI

% mitamae-secrets set --base /path/to/secret secret_password
secret_password: 
% mitamae-secrets get --base /path/to/secret secret_password
P@ssw0rd
% echo -e "hello\nworld" | mitamae-secrets set --base /path/to/secret greeting
% mitamae-secrets get --base /path/to/secret greeting
hello
world

% mitamae-secrets newkey --base /path/to/secret foo
% cat /path/to/secret/keys/foo
{"name":"foo","type":"aes1","key":"7RLkJdcH6pDEoMOjZIzTEjj6Ih0bTCYRxvw/zYknWrE=\n"}

Build with mitamae

% git clone --recursive https://github.com/k0kubun/mitamae
% cd mitamae
% cat > build_config.rb
MRuby::Build.new do |conf|
  toolchain :gcc

  # XXX: mitamae v1.1.2 depends on k0kubun/mruby-io and mitamae-secrets depends on iij/mruby-io.
  # Force using k0kubun/mruby-io here.
  conf.gem github: 'k0kubun/mruby-io'
  conf.gem __dir__
  conf.gem github: 'eagletmt/mitamae-secrets'
end
% rake compile

Acknowledgment

Original implementation is written by sorah. https://github.com/sorah/itamae-secrets