Class: Upman::Extensions::InstallPackage::Servlet
- Inherits:
-
Server::BaseServlet
- Object
- WEBrick::HTTPServlet::AbstractServlet
- Server::BaseServlet
- Upman::Extensions::InstallPackage::Servlet
- Defined in:
- lib/upman/extensions/install_package.rb
Overview
Servlet action for WEBrick
Instance Attribute Summary collapse
-
#payload ⇒ Object
Returns the value of attribute payload.
Attributes inherited from Server::BaseServlet
Instance Method Summary collapse
-
#do_GET(request, response) ⇒ Object
rubocop:disable Naming/MethodName.
- #perform_action ⇒ Object
Methods inherited from Server::BaseServlet
#bad_request, #get_param, #initialize, #is_authenticated, #not_authorized, #ok
Methods included from Utils::Helper
Constructor Details
This class inherits a constructor from Upman::Server::BaseServlet
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
14 15 16 |
# File 'lib/upman/extensions/install_package.rb', line 14 def payload @payload end |
Instance Method Details
#do_GET(request, response) ⇒ Object
rubocop:disable Naming/MethodName
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/upman/extensions/install_package.rb', line 17 def do_GET(request, response) # rubocop:enable Naming/MethodName super(request, response) unless is_authenticated(request) response = (response, "Request declined") return response end @payload = get_param('payload', 'json', false) if (body = perform_action) response = ok(response, body) end end |
#perform_action ⇒ Object
34 35 36 |
# File 'lib/upman/extensions/install_package.rb', line 34 def perform_action "{\"autentication\": \"failed - no valid certifacte was given\"}" end |