Sha256: e701a796da16b6c55c9f01da06f6b500d492fc9faf95a1d64f4fecddb68ed3ff

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

require 'aws/pws'
require 'aws/pws/credential_provider'

module Omnivault
  class PWS < AbstractVault
    attr_accessor :client

    def entries
      @client ||= AWS::PWS::Client.new
      Hash[@client.raw_data.map { |k, v| [k, v[:password]] }]
    end

    def fetch(key)
      entries[key]
    end

    def store(key, value)
      @client ||= AWS::PWS::Client.new
      @client.cli.add(key, value)
    end

    def configure_aws!
      provider = AWS::PWS::CredentialProvider.new
      AWS.config(credential_provider: provider)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omnivault-0.1.2 lib/omnivault/pws.rb
omnivault-0.1.1 lib/omnivault/pws.rb
omnivault-0.1.0 lib/omnivault/pws.rb