Class: EasyType::Rbac

Inherits:
PuppetService show all
Defined in:
lib/easy_type/rbac.rb

Instance Method Summary collapse

Methods inherited from PuppetService

#get, #post

Constructor Details

#initializeRbac

Returns a new instance of Rbac.



6
7
8
9
10
11
# File 'lib/easy_type/rbac.rb', line 6

def initialize
  super
  port       = 4433
  prefix     = '/rbac-api/v1/auth' 
  @base_url = "https://#{@server}:#{port}#{prefix}"
end

Instance Method Details

#_token(data) ⇒ Object



13
14
15
# File 'lib/easy_type/rbac.rb', line 13

def _token(data)
  post('/token',data)
end

#token(login, password, lifetime = '4h') ⇒ Object



17
18
19
20
# File 'lib/easy_type/rbac.rb', line 17

def token(, password, lifetime='4h')
  data = { login: , password:password, lifetime:lifetime }
  _token(data)
end