Class: Qualys::Auth
Defined Under Namespace
Classes: InvalidLogin
Constant Summary
Constants inherited from Api
Qualys::Api::PRODUCTION_ENDPOINT
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.login ⇒ Object
Do Login.
-
.logout ⇒ Object
Set Logout.
Methods inherited from Api
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/qualys/auth.rb', line 5 def name @name end |
Class Method Details
.login ⇒ Object
Do Login
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/qualys/auth.rb', line 8 def self.login # Request a login response = api_post('/session/', body: { action: 'login', username: Qualys::Config.username, password: Qualys::Config.password }) # set the session key Qualys::Config.session_key = response.header['Set-Cookie'] true end |
.logout ⇒ Object
Set Logout
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/qualys/auth.rb', line 22 def self.logout # Request a login api_post('/session/', body: { action: 'logout' }) # set the session key Qualys::Config.session_key = nil true end |