Class: Keratin::AuthN::API

Inherits:
Client
  • Object
show all
Defined in:
lib/keratin/authn/api.rb

Instance Attribute Summary

Attributes inherited from Client

#base

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from Keratin::Client

Instance Method Details

#archive(account_id) ⇒ Object



24
25
26
# File 'lib/keratin/authn/api.rb', line 24

def archive()
  delete(path: "/accounts/#{}").result
end

#expire_password(account_id) ⇒ Object



37
38
39
# File 'lib/keratin/authn/api.rb', line 37

def expire_password()
  patch(path: "/accounts/#{}/expire_password")
end

#get(account_id) ⇒ Object



6
7
8
# File 'lib/keratin/authn/api.rb', line 6

def get()
  super(path: "/accounts/#{}")
end

#import(username:, password:, locked: false) ⇒ Object

returns account_id or raises exception



29
30
31
32
33
34
35
# File 'lib/keratin/authn/api.rb', line 29

def import(username:, password:, locked: false)
  post(path: '/accounts/import', body: {
    username: username,
    password: password,
    locked: locked
  }).result['id']
end

#lock(account_id) ⇒ Object



16
17
18
# File 'lib/keratin/authn/api.rb', line 16

def lock()
  patch(path: "/accounts/#{}/lock").result
end

#unlock(account_id) ⇒ Object



20
21
22
# File 'lib/keratin/authn/api.rb', line 20

def unlock()
  patch(path: "/accounts/#{}/unlock").result
end

#update(account_id, username:) ⇒ Object



10
11
12
13
14
# File 'lib/keratin/authn/api.rb', line 10

def update(, username:)
  patch(path: "/accounts/#{}", body: {
    username: username
  }).result
end