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