Class: EasyType::Rbac
- Inherits:
-
PuppetService
- Object
- PuppetService
- EasyType::Rbac
- Defined in:
- lib/easy_type/rbac.rb
Instance Method Summary collapse
- #_token(data) ⇒ Object
-
#initialize ⇒ Rbac
constructor
A new instance of Rbac.
- #token(login, password, lifetime = '4h') ⇒ Object
Methods inherited from PuppetService
Constructor Details
#initialize ⇒ Rbac
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(login, password, lifetime='4h') data = { login: login, password:password, lifetime:lifetime } _token(data) end |