Updated CMS libary:
Initial Basic Authentication Node with filters. Updated ROC API to use the new module.
This commit is contained in:
@@ -62,7 +62,7 @@ feature -- Configure Node Resources Routes
|
||||
create l_bal_handler.make (config)
|
||||
create l_methods
|
||||
l_methods.enable_get
|
||||
router.handle_with_request_methods ("/basic_auth/login", l_bal_handler, l_methods)
|
||||
router.handle_with_request_methods ("/basic_auth_login", l_bal_handler, l_methods)
|
||||
end
|
||||
|
||||
configure_api_logoff
|
||||
@@ -73,7 +73,7 @@ feature -- Configure Node Resources Routes
|
||||
create l_bal_handler.make (config)
|
||||
create l_methods
|
||||
l_methods.enable_get
|
||||
router.handle_with_request_methods ("/basic_auth/logoff", l_bal_handler, l_methods)
|
||||
router.handle_with_request_methods ("/basic_auth_logoff", l_bal_handler, l_methods)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ feature -- HTTP Methods
|
||||
do
|
||||
log.write_information(generator + ".do_get Processing basic auth login")
|
||||
if attached {STRING_32} current_user_name (req) as l_user then
|
||||
(create {CMS_GENERIC_RESPONSE}).new_response_redirect (req, res, req.absolute_script_url(""))
|
||||
(create {CMS_GENERIC_RESPONSE}).new_response_redirect (req, res, req.absolute_script_url("/"))
|
||||
else
|
||||
(create {CMS_GENERIC_RESPONSE}).new_response_authenticate (req, res)
|
||||
end
|
||||
|
||||
@@ -71,7 +71,7 @@ feature -- HTTP Methods
|
||||
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
||||
if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_content")
|
||||
l_page.add_variable (l_node.content, "content")
|
||||
l_page.add_variable (l_node.content, "node_content")
|
||||
l_page.add_variable (l_id.value, "id")
|
||||
l_page.execute
|
||||
else
|
||||
|
||||
@@ -70,8 +70,8 @@ feature -- HTTP Methods
|
||||
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
||||
if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_summary")
|
||||
l_page.add_variable (l_node.summary, "summary")
|
||||
l_page.add_variable (l_id.value, "id")
|
||||
l_page.add_variable (l_node.summary, "node_summary")
|
||||
l_page.execute
|
||||
else
|
||||
do_error (req, res, l_id)
|
||||
|
||||
@@ -70,20 +70,14 @@ feature -- HTTP Methods
|
||||
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
||||
if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_title")
|
||||
l_page.add_variable (setup.is_html, "html")
|
||||
l_page.add_variable (setup.is_web, "web")
|
||||
l_page.add_variable (l_node.title, "title")
|
||||
l_page.add_variable (l_node.title, "node_title")
|
||||
l_page.add_variable (l_id.value, "id")
|
||||
l_page.execute
|
||||
else
|
||||
do_error (req, res, l_id)
|
||||
end
|
||||
else
|
||||
to_implement ("Check how to implement API error")
|
||||
-- create l_page.make (req, "master2/error")
|
||||
-- l_page.set_value ("500", "code")
|
||||
-- l_page.set_value (req.absolute_script_url (req.path_info), "request")
|
||||
-- l_page.send_to (res)
|
||||
(create {ERROR_500_CMS_RESPONSE}.make (req, res, setup, "master2/error")).execute
|
||||
end
|
||||
else
|
||||
(create {CMS_GENERIC_RESPONSE}).new_response_unauthorized (req, res)
|
||||
|
||||
Reference in New Issue
Block a user