Giter Site home page Giter Site logo

keyring's Introduction

Keyring

Store and access your passwords safely

This library provides a easy way to access the system keyring service from ruby. It can be used in any application that needs safe password storage.

The keyring services supported by this library:

  • Mac OS X Keychain: the Apple Keychain service in Mac OS X
  • GNOME 2 Keyring
  • In-memory keychain

Additional keyring services we'd like to support:

  • KDE KWallet
  • SecretServiceKeyring: for newer GNOME and KDE environments
  • Windows Credential Manager
  • Windows Credential Manager, aka Windows Vault

Installation

Add this line to your application's Gemfile:

gem 'keyring'

And then execute:

$ bundle

Or install it yourself as:

$ gem install keyring

Usage

The basic usage of keyring is simple: just call Keyring#set_password and Keyring#get_password:

require 'keyring'
keyring = Keyring.new
keyring.set_password('service', 'username', 'password')
password = keyring.get_password('service', 'username')
keyring.delete_password('service', 'username')

'service' is an arbitrary string identifying your application.

By default keyring will attempt to pick the best backend supported on your system. You can specify a particular backend:

require 'keyring'
keyring = Keyring.new(Keyring::Backend::Memory.new)

Platform notes

Gnome Keyring uses the GirFFI bindings, which requires the introspection bindings to be installed (as well as gnome-keyring). apt-get install gnome-keyring libgirepository1.0-dev for Debian/Ubuntu.

Credits

Copyright 2013-2016, Jason Heiss, wvengen, jtopper

Inspired by the keyring library for Python: https://bitbucket.org/kang/python-keyring-lib

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

keyring's People

Contributors

egbert avatar jheiss avatar jtopper avatar msabramo avatar wvengen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.