Sha256: efe93200f0758c528f97a5fe9002126632a034765fe0ad762d514f8c5f98fc52
Contents?: true
Size: 1.08 KB
Versions: 3
Compression:
Stored size: 1.08 KB
Contents
require 'keratin/client' require 'net/http' module Keratin::AuthN class Issuer < Keratin::Client def lock(account_id) patch(path: "/accounts/#{account_id}/lock").result end def unlock(account_id) patch(path: "/accounts/#{account_id}/unlock").result end def archive(account_id) delete(path: "/accounts/#{account_id}").result end # returns account_id or raises exception def import(username:, password:, locked: false) post(path: '/accounts/import', body: { username: username, password: password, locked: locked }).result['id'] end def expire_password(account_id) patch(path: "/accounts/#{account_id}/expire_password") end def signing_key(kid) keys.find{|k| k['use'] == 'sig' && (kid.blank? || kid == k['kid']) } end private def configuration @configuration ||= get(path: '/configuration').data end private def keys JSON::JWK::Set.new( JSON.parse( Net::HTTP.get(URI.parse(configuration['jwks_uri'])) ) ) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
keratin-authn-0.5.1 | lib/keratin/authn/issuer.rb |
keratin-authn-0.5.0 | lib/keratin/authn/issuer.rb |
keratin-authn-0.4.1 | lib/keratin/authn/issuer.rb |