Clean code: removed unused variables.
Move BASIC_AUTH module to ROC_SERVER setup, as an example of module extension
This commit is contained in:
@@ -62,10 +62,6 @@ feature {NONE} -- Initialization
|
|||||||
-- modules.extend (m)
|
-- modules.extend (m)
|
||||||
|
|
||||||
|
|
||||||
create {BASIC_AUTH_MODULE} m.make (Current)
|
|
||||||
m.enable
|
|
||||||
modules.extend (m)
|
|
||||||
|
|
||||||
create {NODE_MODULE} m.make (Current)
|
create {NODE_MODULE} m.make (Current)
|
||||||
m.enable
|
m.enable
|
||||||
modules.extend (m)
|
modules.extend (m)
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ feature -- HTTP Methods
|
|||||||
|
|
||||||
do_get (req: WSF_REQUEST; res: WSF_RESPONSE)
|
do_get (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
local
|
|
||||||
l_page: CMS_RESPONSE
|
|
||||||
do
|
do
|
||||||
log.write_information(generator + ".do_get Processing basic auth login")
|
log.write_information(generator + ".do_get Processing basic auth login")
|
||||||
if attached {STRING_32} current_user_name (req) as l_user then
|
if attached {STRING_32} current_user_name (req) as l_user then
|
||||||
|
|||||||
@@ -88,8 +88,6 @@ feature -- HTTP Methods
|
|||||||
|
|
||||||
do_post (req: WSF_REQUEST; res: WSF_RESPONSE)
|
do_post (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
local
|
|
||||||
l_page: CMS_RESPONSE
|
|
||||||
do
|
do
|
||||||
if attached current_user_name (req) then
|
if attached current_user_name (req) then
|
||||||
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
||||||
@@ -116,7 +114,6 @@ feature -- HTTP Methods
|
|||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
local
|
local
|
||||||
u_node: CMS_NODE
|
u_node: CMS_NODE
|
||||||
l_page: CMS_RESPONSE
|
|
||||||
do
|
do
|
||||||
to_implement ("Check if user has permissions")
|
to_implement ("Check if user has permissions")
|
||||||
if attached current_user (req) as l_user then
|
if attached current_user (req) as l_user then
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ feature -- HTTP Methods
|
|||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
local
|
local
|
||||||
u_node: CMS_NODE
|
u_node: CMS_NODE
|
||||||
l_page: CMS_RESPONSE
|
|
||||||
do
|
do
|
||||||
to_implement ("Check user permissions!!!")
|
to_implement ("Check user permissions!!!")
|
||||||
if attached current_user (req) as l_user then
|
if attached current_user (req) as l_user then
|
||||||
|
|||||||
@@ -87,8 +87,6 @@ feature -- HTTP Methods
|
|||||||
|
|
||||||
do_post (req: WSF_REQUEST; res: WSF_RESPONSE)
|
do_post (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
local
|
|
||||||
u_node: CMS_NODE
|
|
||||||
do
|
do
|
||||||
if attached current_user_name (req) then
|
if attached current_user_name (req) then
|
||||||
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
||||||
|
|||||||
@@ -86,8 +86,6 @@ feature -- HTTP Methods
|
|||||||
|
|
||||||
do_post (req: WSF_REQUEST; res: WSF_RESPONSE)
|
do_post (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
local
|
|
||||||
u_node: CMS_NODE
|
|
||||||
do
|
do
|
||||||
if attached current_user_name (req) as l_user then
|
if attached current_user_name (req) as l_user then
|
||||||
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
if attached {WSF_STRING} req.path_parameter ("id") as l_id then
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ feature -- Initialize
|
|||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
is_valid_credential (l_auth_login, l_auth_password: READABLE_STRING_32): BOOLEAN
|
is_valid_credential (l_auth_login, l_auth_password: READABLE_STRING_32): BOOLEAN
|
||||||
local
|
|
||||||
l_security: SECURITY_PROVIDER
|
|
||||||
do
|
do
|
||||||
Result := storage.is_valid_credential (l_auth_login, l_auth_password)
|
Result := storage.is_valid_credential (l_auth_login, l_auth_password)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ feature -- Responses
|
|||||||
-- Handle not authorized.
|
-- Handle not authorized.
|
||||||
local
|
local
|
||||||
h: HTTP_HEADER
|
h: HTTP_HEADER
|
||||||
output: STRING
|
|
||||||
do
|
do
|
||||||
create h.make
|
create h.make
|
||||||
h.put_content_type_text_html
|
h.put_content_type_text_html
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ feature -- CMS Initialization
|
|||||||
initialize_cms (a_setup: CMS_SETUP)
|
initialize_cms (a_setup: CMS_SETUP)
|
||||||
local
|
local
|
||||||
cms: CMS_SERVICE
|
cms: CMS_SERVICE
|
||||||
l_modules: CMS_MODULE_COLLECTION
|
|
||||||
do
|
do
|
||||||
log.write_debug (generator + ".initialize_cms")
|
log.write_debug (generator + ".initialize_cms")
|
||||||
|
|
||||||
@@ -134,7 +133,7 @@ feature -- CMS setup
|
|||||||
local
|
local
|
||||||
m: CMS_MODULE
|
m: CMS_MODULE
|
||||||
do
|
do
|
||||||
create {NODE_MODULE} m.make (a_setup)
|
create {BASIC_AUTH_MODULE} m.make (a_setup)
|
||||||
m.enable
|
m.enable
|
||||||
a_setup.modules.extend (m)
|
a_setup.modules.extend (m)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user