Totvs::PasswordVault
This gem is responsible for connecting to Totvs password vault and save keys, important information.
Installation
Add this line to your application's Gemfile:
gem "totvs_password_vault"
And then execute:
$ bundle
Or install it yourself as:
$ gem install totvs_password_vault
Usage
Connection config
Currently this gem only supports a pre configured token keys. Please, set these env vars:
- VAULT_CONSUMER_KEY
- VAULT_CONSUMER_SECRET
- VAULT_BASE_URL
- VAULT_ACCESS_TOKEN
- VAULT_ACCESS_TOKEN_SECRET
Totvs::PasswordVault::Key
This class is responsible for handling keys (mainly ssh keys, but could be anything).
key = Totvs::PasswordVault::Key.new
key.save(id: "keyid", public_key: "public key", private_key: "private key", hostname: "hostname", ip: "0.0.0.0")
key.retrieve(id: "keyid") #=> { public_key: "public key", private_key: "private key" }
Totvs::PasswordVault::Information
This class is responsible for handling any important information you need to store.
info = Totvs::PasswordVault::Information.new
info.save(id: "keyid", content: { "some" => "value" })
info.retrieve(id: "keyid") #=> { "some" => "value" }
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/diegoaltheman/totvs_password_vault.
TODO
- Access token should be fetched (validated) and not env var configured
- Work with the api response
License
The gem is available as open source under the terms of the MIT License.