Moved activation implementation into authentication api.

Improved core webapi, added registration link, support redirection.
Use error webapi response, rather than `send_...` routines.
This commit is contained in:
Jocelyn Fiat
2017-09-19 21:21:30 +02:00
parent e04138c89e
commit 9d7d43073d
13 changed files with 117 additions and 137 deletions

View File

@@ -28,7 +28,7 @@ feature -- Token Generation
-- Create activation token -- Create activation token
l_token := new_token l_token := new_token
l_user_api.new_activation (l_token, u.id) l_user_api.new_activation (l_token, u.id)
l_url_activate := cms_api.absolute_url ("/account/activate/" + l_token, void) l_url_activate := cms_api.absolute_url ("/account/activate/" + l_token, Void)
l_url_reject := cms_api.absolute_url ("/account/reject/" + l_token, Void) l_url_reject := cms_api.absolute_url ("/account/reject/" + l_token, Void)
-- Send Email to webmaster -- Send Email to webmaster
cms_api.log_debug ("registration", "send_register_email", Void) cms_api.log_debug ("registration", "send_register_email", Void)
@@ -43,6 +43,47 @@ feature -- Token Generation
cms_api.log ("registration", {STRING_32} "new user %"" + u.name + "%" <" + a_email + ">", {CMS_LOG}.level_info, Void) cms_api.log ("registration", {STRING_32} "new user %"" + u.name + "%" <" + a_email + ">", {CMS_LOG}.level_info, Void)
end end
activate_user (a_temp_user: CMS_TEMP_USER; a_token: READABLE_STRING_GENERAL)
require
a_temp_user.has_id
not a_temp_user.is_active
local
l_user_api: CMS_USER_API
l_temp_id: INTEGER_64
es: CMS_AUTHENTICATION_EMAIL_SERVICE
do
l_temp_id := a_temp_user.id
-- Valid user_id
a_temp_user.set_id (0)
a_temp_user.mark_active
l_user_api := cms_api.user_api
l_user_api.new_user_from_temp_user (a_temp_user)
if
not l_user_api.has_error and then
attached l_user_api.user_by_name (a_temp_user.name) as l_new_user
then
if attached a_temp_user.personal_information as l_perso_info then
-- Keep personal information in profile item!
l_user_api.save_user_profile_item (l_new_user, "personal_information", l_perso_info)
end
-- Delete temporal User
a_temp_user.set_id (l_temp_id)
l_user_api.delete_temp_user (a_temp_user)
l_user_api.remove_activation (a_token)
-- Send Email
if attached l_new_user.email as l_email then
cms_api.log_debug ("activation", "send_contact_activation_confirmation_email", Void)
create es.make (create {CMS_AUTHENTICATION_EMAIL_SERVICE_PARAMETERS}.make (cms_api))
es.send_contact_activation_confirmation_email (l_email, l_new_user, cms_api.site_url)
end
else
error_handler.add_custom_error (-1, "activation error", "Activation failed!")
end
end
new_token: STRING new_token: STRING
-- Generate a new token activation token -- Generate a new token activation token
local local

View File

@@ -520,48 +520,18 @@ feature -- Handler
local local
r: CMS_RESPONSE r: CMS_RESPONSE
l_user_api: CMS_USER_API l_user_api: CMS_USER_API
l_ir: INTERNAL_SERVER_ERROR_CMS_RESPONSE
es: CMS_AUTHENTICATION_EMAIL_SERVICE
l_temp_id: INTEGER_64
do do
if a_auth_api.cms_api.has_permission ("account activate") then if a_auth_api.cms_api.has_permission ("account activate") then
l_user_api := a_auth_api.cms_api.user_api l_user_api := a_auth_api.cms_api.user_api
if attached {WSF_STRING} req.path_parameter ("token") as l_token then if attached {WSF_STRING} req.path_parameter ("token") as l_token then
if attached {CMS_TEMP_USER} l_user_api.temp_user_by_activation_token (l_token.value) as l_temp_user then if attached {CMS_TEMP_USER} l_user_api.temp_user_by_activation_token (l_token.value) as l_temp_user then
-- TODO copy the personal information
--! to CMS_USER_PROFILE and persist data
--! check also CMS_USER.data_items
l_temp_id := l_temp_user.id
-- Valid user_id
l_temp_user.set_id (0)
l_temp_user.mark_active
l_user_api.new_user_from_temp_user (l_temp_user)
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, a_auth_api.cms_api) create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, a_auth_api.cms_api)
a_auth_api.activate_user (l_temp_user, l_token.value)
if if
not l_user_api.has_error and then not a_auth_api.has_error and then
attached l_user_api.user_by_name (l_temp_user.name) as l_new_user attached l_user_api.user_by_name (l_temp_user.name) as l_new_user
then then
if attached l_temp_user.personal_information as l_perso_info then
-- Keep personal information in profile item!
a_auth_api.cms_api.user_api.save_user_profile_item (l_new_user, "personal_information", l_perso_info)
end
-- Delete temporal User
l_temp_user.set_id (l_temp_id)
l_user_api.delete_temp_user (l_temp_user)
l_user_api.remove_activation (l_token.value)
r.set_main_content ("<p> The account <i>" + a_auth_api.cms_api.user_html_link (l_new_user) + "</i> has been activated</p>") r.set_main_content ("<p> The account <i>" + a_auth_api.cms_api.user_html_link (l_new_user) + "</i> has been activated</p>")
-- Send Email
if attached l_new_user.email as l_email then
create es.make (create {CMS_AUTHENTICATION_EMAIL_SERVICE_PARAMETERS}.make (a_auth_api.cms_api))
write_debug_log (generator + ".handle register: send_contact_activation_confirmation_email")
es.send_contact_activation_confirmation_email (l_email, l_new_user, req.absolute_script_url (""))
end
else else
-- Failure!!! -- Failure!!!
r.set_status_code ({HTTP_CONSTANTS}.internal_server_error) r.set_status_code ({HTTP_CONSTANTS}.internal_server_error)
@@ -578,8 +548,7 @@ feature -- Handler
end end
r.execute r.execute
else else
create l_ir.make (req, res, a_auth_api.cms_api) (create {INTERNAL_SERVER_ERROR_CMS_RESPONSE}.make (req, res, a_auth_api.cms_api)).execute
l_ir.execute
end end
else else
a_auth_api.cms_api.response_api.send_access_denied (Void, req, res) a_auth_api.cms_api.response_api.send_access_denied (Void, req, res)

View File

@@ -32,14 +32,14 @@ feature -- Execution
if req.is_post_request_method then if req.is_post_request_method then
register_user (req, res) register_user (req, res)
else else
send_bad_request (Void, req, res) new_bad_request_error_response (Void, req, res).execute
end end
end end
register_user (req: WSF_REQUEST; res: WSF_RESPONSE) register_user (req: WSF_REQUEST; res: WSF_RESPONSE)
local local
f: CMS_FORM f: CMS_FORM
rep: like new_webapi_response rep: like new_response
l_user_api: CMS_USER_API l_user_api: CMS_USER_API
u: CMS_TEMP_USER u: CMS_TEMP_USER
l_exist: BOOLEAN l_exist: BOOLEAN
@@ -60,7 +60,7 @@ feature -- Execution
f.extend_text_field ("email", Void) f.extend_text_field ("email", Void)
f.extend_text_field ("personal_information", Void) f.extend_text_field ("personal_information", Void)
rep := new_webapi_response (req, res) rep := new_response (req, res)
f.process (rep) f.process (rep)
if if
attached f.last_data as fd and then not fd.has_error and then attached f.last_data as fd and then not fd.has_error and then
@@ -83,7 +83,7 @@ feature -- Execution
l_exist := True l_exist := True
end end
if fd.has_error or l_exist then if fd.has_error or l_exist then
send_bad_request ("User name or email is already taken!", req, res) rep := new_bad_request_error_response ("User name or email is already taken!", req, res)
else else
-- New temp user -- New temp user
create u.make (l_name) create u.make (l_name)
@@ -92,20 +92,22 @@ feature -- Execution
u.set_personal_information (l_personal_information) u.set_personal_information (l_personal_information)
auth_api.register_user (u, l_email, l_personal_information) auth_api.register_user (u, l_email, l_personal_information)
-- Until it is activated, this is not a real user.
-- add_user_links_to (u, rep) -- add_user_links_to (u, rep)
rep.add_string_field ("status", "succeed") rep.add_string_field ("status", "succeed")
rep.add_string_field ("information", "Waiting for activation")
rep.add_self (req.percent_encoded_path_info) rep.add_self (req.percent_encoded_path_info)
rep.execute
end end
else else
send_bad_request ("Invalid email", req, res) rep := new_access_denied_error_response ("Invalid email", req, res)
end end
else else
send_bad_request ("There were issue with your application, invalid or missing values.", req, res) rep := new_access_denied_error_response ("There were issue with your application, invalid or missing values.", req, res)
end end
else else
send_access_denied ("You can also contact the webmaster to ask for an account.", req, res) rep := new_access_denied_error_response ("You can also contact the webmaster to ask for an account.", req, res)
end end
rep.execute
end end

View File

@@ -575,7 +575,7 @@ feature -- Change Temp User
end end
end end
remove_activation (a_token: READABLE_STRING_32) remove_activation (a_token: READABLE_STRING_GENERAL)
-- Remove activation token `a_token', from the user_storage. -- Remove activation token `a_token', from the user_storage.
do do
user_storage.remove_activation (a_token) user_storage.remove_activation (a_token)

View File

@@ -265,7 +265,7 @@ feature -- New Temp User
deferred deferred
end end
remove_activation (a_token: READABLE_STRING_32) remove_activation (a_token: READABLE_STRING_GENERAL)
-- Remove activation by token `a_token'. -- Remove activation by token `a_token'.
deferred deferred
end end

View File

@@ -191,7 +191,7 @@ feature -- Temp Users
end end
remove_activation (a_token: READABLE_STRING_32) remove_activation (a_token: READABLE_STRING_GENERAL)
-- <Precursor>. -- <Precursor>.
do do
end end

View File

@@ -1312,7 +1312,7 @@ feature -- New Temp User
feature -- Remove Activation feature -- Remove Activation
remove_activation (a_token: READABLE_STRING_32) remove_activation (a_token: READABLE_STRING_GENERAL)
-- <Precursor>. -- <Precursor>.
local local
l_parameters: STRING_TABLE [detachable ANY] l_parameters: STRING_TABLE [detachable ANY]

View File

@@ -28,10 +28,10 @@ feature -- Execution
elseif req.is_get_request_method then elseif req.is_get_request_method then
get_access_token (l_uid, req, res) get_access_token (l_uid, req, res)
else else
send_bad_request (Void, req, res) new_bad_request_error_response (Void, req, res).execute
end end
else else
send_bad_request ("Missing {uid} parameter", req, res) new_bad_request_error_response ("Missing {uid} parameter", req, res).execute
end end
end end
@@ -52,28 +52,28 @@ feature -- Request execution
if attached user_by_uid (a_uid) as l_user then if attached user_by_uid (a_uid) as l_user then
if attached api.user as u then if attached api.user as u then
if u.same_as (l_user) or api.user_api.is_admin_user (u) then if u.same_as (l_user) or api.user_api.is_admin_user (u) then
rep := new_access_token_webapi_response (l_user, user_access_token (l_user), req, res) rep := new_access_token_response (l_user, user_access_token (l_user), req, res)
if attached {WSF_STRING} req.item ("destination") as dest then if attached {WSF_STRING} req.item ("destination") as dest then
rep.set_redirection (dest.url_encoded_value) rep.set_redirection (dest.url_encoded_value)
end end
rep.execute
else else
-- Only admin, or current user can see its access_token! -- Only admin, or current user can see its access_token!
send_access_denied (Void, req, res) rep := new_access_denied_error_response (Void, req, res)
end end
else else
send_access_denied (Void, req, res) rep := new_access_denied_error_response (Void, req, res)
end end
else else
send_not_found ("User not found", req, res) rep := new_not_found_error_response ("User not found", req, res)
end end
rep.execute
end end
post_access_token (a_uid: READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE) post_access_token (a_uid: READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute handler for `req' and respond in `res'. -- Execute handler for `req' and respond in `res'.
local local
l_access_token: detachable READABLE_STRING_32 l_access_token: detachable READABLE_STRING_32
rep: like new_webapi_response rep: like new_response
do do
if attached user_by_uid (a_uid) as l_user then if attached user_by_uid (a_uid) as l_user then
if attached api.user as u then if attached api.user as u then
@@ -91,21 +91,21 @@ feature -- Request execution
-- end -- end
set_user_access_token (l_user, l_access_token) set_user_access_token (l_user, l_access_token)
rep := new_access_token_webapi_response (l_user, l_access_token, req, res) rep := new_access_token_response (l_user, l_access_token, req, res)
if attached {WSF_STRING} req.item ("destination") as dest then if attached {WSF_STRING} req.item ("destination") as dest then
rep.set_redirection (dest.url_encoded_value) rep.set_redirection (dest.url_encoded_value)
end end
rep.execute
else else
-- Only admin, or current user can create the user access_token! -- Only admin, or current user can create the user access_token!
send_access_denied (Void, req, res) rep := new_access_denied_error_response (Void, req, res)
end end
else else
send_access_denied (Void, req, res) rep := new_access_denied_error_response (Void, req, res)
end end
else else
send_not_found ("User not found", req, res) rep := new_not_found_error_response ("User not found", req, res)
end end
rep.execute
end end
feature {NONE} -- Implementation feature {NONE} -- Implementation
@@ -128,11 +128,11 @@ feature {NONE} -- Implementation
api.user_api.save_user_profile_item (a_user, "access_token", a_access_token) api.user_api.save_user_profile_item (a_user, "access_token", a_access_token)
end end
new_access_token_webapi_response (a_user: CMS_USER; a_access_token: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE): like new_webapi_response new_access_token_response (a_user: CMS_USER; a_access_token: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE): like new_response
local local
tb: STRING_TABLE [detachable ANY] tb: STRING_TABLE [detachable ANY]
do do
Result := new_webapi_response (req, res) Result := new_response (req, res)
if a_access_token /= Void then if a_access_token /= Void then
Result.add_string_field ("access_token", a_access_token) Result.add_string_field ("access_token", a_access_token)
else else

View File

@@ -21,10 +21,12 @@ feature -- Execution
local local
rep: HM_WEBAPI_RESPONSE rep: HM_WEBAPI_RESPONSE
do do
rep := new_webapi_response (req, res) rep := new_response (req, res)
rep.add_string_field ("site_name", api.setup.site_name) rep.add_string_field ("site_name", api.setup.site_name)
if attached api.user as u then if attached api.user as u then
add_user_links_to (u, rep) add_user_links_to (u, rep)
elseif api.has_permission ("account register") then
rep.add_link ("register", Void, api.webapi_path ("/account/register"))
end end
rep.add_self (req.percent_encoded_path_info) rep.add_self (req.percent_encoded_path_info)
rep.execute rep.execute

View File

@@ -24,7 +24,7 @@ feature -- Execution
-- elseif req.is_post_request_method then -- elseif req.is_post_request_method then
-- execute_post (req, res) -- execute_post (req, res)
else else
send_bad_request (Void, req, res) new_bad_request_error_response (Void, req, res).execute
end end
end end
@@ -46,7 +46,7 @@ feature -- Execution
-- end -- end
if l_user /= Void then if l_user /= Void then
if l_user.same_as (u) or api.has_permissions (<<"admin users", "view users">>) then if l_user.same_as (u) or api.has_permissions (<<"admin users", "view users">>) then
rep := new_webapi_response (req, res) rep := new_response (req, res)
rep.add_string_field ("uid", l_user.id.out) rep.add_string_field ("uid", l_user.id.out)
rep.add_string_field ("name", l_user.name) rep.add_string_field ("name", l_user.name)
if attached l_user.email as l_email then if attached l_user.email as l_email then
@@ -66,56 +66,24 @@ feature -- Execution
end end
add_user_links_to (l_user, rep) add_user_links_to (l_user, rep)
else else
rep := new_wepapi_error_response ("denied", req, res) rep := new_error_response ("denied", req, res)
rep.set_status_code ({HTTP_STATUS_CODE}.user_access_denied) rep.set_status_code ({HTTP_STATUS_CODE}.user_access_denied)
end end
else else
rep := new_wepapi_error_response ("Not found", req, res) rep := new_error_response ("Not found", req, res)
rep.set_status_code ({HTTP_STATUS_CODE}.not_found) rep.set_status_code ({HTTP_STATUS_CODE}.not_found)
end end
else else
rep := new_wepapi_error_response ("Bad request", req, res) rep := new_error_response ("Bad request", req, res)
rep.set_status_code ({HTTP_STATUS_CODE}.bad_request) rep.set_status_code ({HTTP_STATUS_CODE}.bad_request)
end end
rep.execute
else else
-- FIXME: use specific Web API response! -- FIXME: use specific Web API response!
send_access_denied (Void, req, res) rep := new_access_denied_error_response (Void, req, res)
end end
rep.execute
end end
-- execute_post (req: WSF_REQUEST; res: WSF_RESPONSE)
-- -- Execute handler for `req' and respond in `res'.
-- local
-- rep: HM_WEBAPI_RESPONSE
-- l_user: detachable CMS_USER
-- do
-- if attached api.user as u and then api.has_permission ("admin users") then
-- if attached {WSF_STRING} req.path_parameter ("uid") as p_uid then
-- if p_uid.is_integer then
-- l_user := api.user_api.user_by_id (p_uid.integer_value)
-- else
-- l_user := api.user_api.user_by_name (p_uid.value)
-- end
---- if l_user = Void and p_uid.is_case_insensitive_equal ("me") then
---- l_user := u
---- end
-- if l_user /= Void then
-- else
-- rep := new_wepapi_error_response ("Not found", req, res)
-- rep.set_status_code ({HTTP_STATUS_CODE}.not_found)
-- end
-- else
-- rep := new_wepapi_error_response ("Bad request", req, res)
-- rep.set_status_code ({HTTP_STATUS_CODE}.bad_request)
-- end
-- rep.execute
-- else
-- -- FIXME: use specific Web API response!
-- send_access_denied (Void, req, res)
-- end
-- end
note note
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"

View File

@@ -24,7 +24,7 @@ feature -- Execution
elseif req.is_post_request_method then elseif req.is_post_request_method then
execute_post (req, res) execute_post (req, res)
else else
send_bad_request (Void, req, res) new_bad_request_error_response (Void, req, res).execute
end end
end end
@@ -43,7 +43,7 @@ feature -- Execution
if attached req.query_parameter ("full") as p and then p.is_case_insensitive_equal ("yes") then if attached req.query_parameter ("full") as p and then p.is_case_insensitive_equal ("yes") then
l_full := True l_full := True
end end
rep := new_webapi_response (req, res) rep := new_response (req, res)
nb := api.user_api.users_count nb := api.user_api.users_count
rep.add_integer_64_field ("users_count", nb) rep.add_integer_64_field ("users_count", nb)
create l_params.make (0, nb.to_natural_32) create l_params.make (0, nb.to_natural_32)
@@ -77,10 +77,10 @@ feature -- Execution
end end
rep.add_iterator_field ("users", arr) rep.add_iterator_field ("users", arr)
rep.add_self (req.percent_encoded_path_info) rep.add_self (req.percent_encoded_path_info)
rep.execute
else else
send_access_denied (Void, req, res) rep := new_access_denied_error_response (Void, req, res)
end end
rep.execute
end end
execute_post (req: WSF_REQUEST; res: WSF_RESPONSE) execute_post (req: WSF_REQUEST; res: WSF_RESPONSE)
@@ -155,17 +155,17 @@ feature -- Execution
end end
end end
if l_user = Void or else err /= Void then if l_user = Void or else err /= Void then
rep := new_wepapi_error_response (err, req, res) rep := new_error_response (err, req, res)
else else
rep := new_webapi_response (req, res) rep := new_response (req, res)
rep.add_string_field ("uid", l_user.id.out) rep.add_string_field ("uid", l_user.id.out)
add_user_links_to (l_user, rep) add_user_links_to (l_user, rep)
end end
rep.add_self (req.percent_encoded_path_info) rep.add_self (req.percent_encoded_path_info)
rep.execute
else else
send_access_denied (Void, req, res) rep := new_access_denied_error_response (Void, req, res)
end end
rep.execute
end end

View File

@@ -127,6 +127,11 @@ feature -- Execution
m: WSF_PAGE_RESPONSE m: WSF_PAGE_RESPONSE
do do
create m.make_with_body (resource.representation) create m.make_with_body (resource.representation)
m.set_status_code (status_code)
if attached redirection as loc then
m.header.put_location (loc)
m.set_status_code ({HTTP_STATUS_CODE}.temp_redirect)
end
m.header.put_content_type ("application/json") m.header.put_content_type ("application/json")
response.send (m) response.send (m)
end end

View File

@@ -32,59 +32,52 @@ feature -- API Service
feature -- Factory feature -- Factory
new_webapi_response (req: WSF_REQUEST; res: WSF_RESPONSE): HM_WEBAPI_RESPONSE new_response (req: WSF_REQUEST; res: WSF_RESPONSE): HM_WEBAPI_RESPONSE
do do
-- create {MD_WEBAPI_RESPONSE} Result.make (req, res, api) -- create {MD_WEBAPI_RESPONSE} Result.make (req, res, api)
create {JSON_WEBAPI_RESPONSE} Result.make (req, res, api) create {JSON_WEBAPI_RESPONSE} Result.make (req, res, api)
end end
new_wepapi_error_response (msg: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE): HM_WEBAPI_RESPONSE new_error_response (msg: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE): like new_response
do do
Result := new_webapi_response (req, res) Result := new_response (req, res)
Result.set_status_code ({HTTP_STATUS_CODE}.bad_request)
if msg /= Void then if msg /= Void then
Result.add_string_field ("error", msg) Result.add_string_field ("error", msg)
else else
Result.add_string_field ("error", "True") Result.add_string_field ("error", "True")
end end
Result.add_self (req.request_uri)
end end
send_not_found (m: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE) new_not_found_error_response (m: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE): like new_response
local
rep: HM_WEBAPI_RESPONSE
do do
if m /= Void then if m = Void then
rep := new_wepapi_error_response (m, req, res) Result := new_error_response ("Not Found", req, res)
else else
rep := new_wepapi_error_response ("Not found", req, res) Result := new_error_response (m, req, res)
end end
rep.set_status_code ({HTTP_STATUS_CODE}.not_found) Result.set_status_code ({HTTP_STATUS_CODE}.not_found)
rep.execute
end end
send_access_denied (m: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE) new_access_denied_error_response (m: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE): like new_response
local
rep: HM_WEBAPI_RESPONSE
do do
if m /= Void then if m = Void then
rep := new_wepapi_error_response (m, req, res) Result := new_error_response ("Access denied", req, res)
else else
rep := new_wepapi_error_response ("Access denied", req, res) Result := new_error_response (m, req, res)
end end
rep.set_status_code ({HTTP_STATUS_CODE}.user_access_denied) Result.set_status_code ({HTTP_STATUS_CODE}.user_access_denied)
rep.execute
end end
send_bad_request (m: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE) new_bad_request_error_response (m: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE): like new_response
local
rep: HM_WEBAPI_RESPONSE
do do
if m /= Void then if m = Void then
rep := new_wepapi_error_response (m, req, res) Result := new_error_response ("Bad request", req, res)
else else
rep := new_wepapi_error_response ("Bad request", req, res) Result := new_error_response (m, req, res)
end end
rep.set_status_code ({HTTP_STATUS_CODE}.bad_request) Result.set_status_code ({HTTP_STATUS_CODE}.bad_request)
rep.execute
end end
feature {NONE} -- Builder feature {NONE} -- Builder