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 20 21 22 23 |
# File 'lib/qualys/auth.rb', line 8 def self.login # Request a login response = self.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
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/qualys/auth.rb', line 26 def self.logout # Request a login response = self.api_post('session/', { :body => { :action => 'logout', } }) # set the session key Qualys::Config.session_key = nil true end |