An open API service indexing awesome lists of open source software.

https://github.com/ananace/ruby-passwordstate

Ruby module for communicating with a Passwordstate instance
https://github.com/ananace/ruby-passwordstate

passwordstate ruby

Last synced: over 1 year ago
JSON representation

Ruby module for communicating with a Passwordstate instance

Awesome Lists containing this project

README

          

# Passwordstate

A Ruby gem for communicating with a [Passwordstate](https://clickstudios.com.au/passwordstate.aspx) instance

The documentation for the development version can be found at https://iti.gitlab-pages.liu.se/ruby-passwordstate

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'passwordstate'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install passwordstate

## Usage example

```ruby
require 'passwordstate'
client = Passwordstate::Client.new 'https://passwordstate.example.com', username: 'user', password: 'password'
# Passwordstate::Client.new 'https://passwordstate.example.com', apikey: 'key'
# #"application/json", "user-agent"=>"RubyPasswordstate/0.1.0"},
# @server_url=#,
# @timeout=15,
# @validate_certificate=true>

client.folders
# [#,
# #]

client.password_lists.get(7).passwords
# [#,
# #,
# #]

pw = client.password_lists.first.passwords.create title: 'example', user_name: 'someone', generate_password: true
# #

pw.password
# "millionfE2rMrcb2LngBTHnDyxdpsGSmK3"

pw.delete
# true
```

A larger - and much more convoluted - example can be found at https://github.com/ananace/foreman_passwordstate/

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ananace/ruby-passwordstate
The project lives at https://gitlab.liu.se/ITI/ruby-passwordstate

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).