https://github.com/eagletmt/mitamae-secrets
itamae-secrets for mitamae
https://github.com/eagletmt/mitamae-secrets
Last synced: about 1 year ago
JSON representation
itamae-secrets for mitamae
- Host: GitHub
- URL: https://github.com/eagletmt/mitamae-secrets
- Owner: eagletmt
- License: mit
- Created: 2016-12-09T19:47:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T15:42:17.000Z (over 9 years ago)
- Last Synced: 2025-06-28T23:37:19.871Z (about 1 year ago)
- Language: Ruby
- Size: 39.1 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mitamae-secrets
[](https://travis-ci.org/eagletmt/mitamae-secrets)
[itamae-secrets](https://github.com/sorah/itamae-secrets) for [mitamae](https://github.com/k0kubun/mitamae)
## Usage
```ruby
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