Sha256: 5e69c17b93b7448694a326f8bfc177324b3d9028b582fe105cd0d0e6c7968b81

Contents?: true

Size: 607 Bytes

Versions: 10

Compression:

Stored size: 607 Bytes

Contents

require "secret_service"

class Yakg
module Backend
module SecretService
  SS = SecretService.new

  def set acct, value, svc
    SS.collection(fix_svc_name svc).create_item(acct, value, nil, true)
  end

  def get acct, svc
    SS.collection(fix_svc_name svc).get_secret acct
  end

  def delete acct, svc
    SS.collection(fix_svc_name svc).get_item(acct).delete
  end

  def list svc
    SS.collection(fix_svc_name svc).all_items.map {|i|
      i.get_property "Label"
    }
  end

  def fix_svc_name n=nil
    (n == Yakg.DEFAULT_SERVICE_NAME) ? SecretService::DEFAULT_COLLECTION : n
  end
  
end
end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
yakg-0.1.11 lib/yakg/backend/secret_service.rb
yakg-0.1.10 lib/yakg/backend/secret_service.rb
yakg-0.1.9 lib/yakg/backend/secret_service.rb
yakg-0.1.8 lib/yakg/backend/secret_service.rb
yakg-0.1.7 lib/yakg/backend/secret_service.rb
yakg-0.1.6 lib/yakg/backend/secret_service.rb
yakg-0.1.5 lib/yakg/backend/secret_service.rb
yakg-0.1.3 lib/yakg/backend/secret_service.rb
yakg-0.0.11 lib/yakg/backend/secret_service.rb
yakg-0.0.10 lib/yakg/backend/secret_service.rb