Class: OwaspZap::Auth
- Inherits:
-
Object
- Object
- OwaspZap::Auth
- Defined in:
- lib/owasp_zap/auth.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#ctx ⇒ Object
Returns the value of attribute ctx.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Auth
constructor
A new instance of Auth.
- #set_logged_in_indicator(args) ⇒ Object
- #set_logged_out_indicator(args) ⇒ Object
-
#set_login_url(args) ⇒ Object
params: args a hash with the following keys -> values url: url including http:// post_data: an already encoded string like “email%3Dfoo%2540example.org%26passwd%3Dfoobar” TODO: offer a way to encode it, giving a hash?.
- #set_logout_url(args) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Auth
Returns a new instance of Auth.
4 5 6 7 |
# File 'lib/owasp_zap/auth.rb', line 4 def initialize(params = {}) @ctx = params[:context] || 1 #default context is the1 @base = params[:base] || "http://127.0.0.1:8080/JSON" end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
3 4 5 |
# File 'lib/owasp_zap/auth.rb', line 3 def base @base end |
#ctx ⇒ Object
Returns the value of attribute ctx.
3 4 5 |
# File 'lib/owasp_zap/auth.rb', line 3 def ctx @ctx end |
Instance Method Details
#set_logged_in_indicator(args) ⇒ Object
42 43 44 |
# File 'lib/owasp_zap/auth.rb', line 42 def set_logged_in_indicator(args) set_query "#{@base}/auth/action/setLoggedInIndicator/",:postData=>args[:indicator] end |
#set_logged_out_indicator(args) ⇒ Object
46 47 48 |
# File 'lib/owasp_zap/auth.rb', line 46 def set_logged_out_indicator(args) set_query "#{@base}/auth/action/setLoggedOutIndicator/", :indicator=>args[:indicator] end |
#set_login_url(args) ⇒ Object
params: args a hash with the following keys -> values url: url including http:// post_data: an already encoded string like “email%3Dfoo%2540example.org%26passwd%3Dfoobar” TODO: offer a way to encode it, giving a hash?
34 35 36 |
# File 'lib/owasp_zap/auth.rb', line 34 def set_login_url(args) set_query "#{@base}/auth/action/setLoginUrl/",:postData=>args[:post_data] end |
#set_logout_url(args) ⇒ Object
38 39 40 |
# File 'lib/owasp_zap/auth.rb', line 38 def set_logout_url(args) set_query "#{@base}/auth/action/setLogoutUrl/",:postData=>args[:post_data] end |