Made all libraries compilable in any mode (voidsafe or not)

Fixed related examples
This commit is contained in:
Jocelyn Fiat
2011-09-22 15:12:33 +02:00
parent d9ba97d33b
commit dae8e1d67d
10 changed files with 58 additions and 47 deletions

View File

@@ -14,6 +14,9 @@ inherit
end
REST_REQUEST_AGENT_HANDLER [APP_REQUEST_HANDLER_CONTEXT]
undefine
authenticated
end
create
make

View File

@@ -8,6 +8,9 @@ deferred class
inherit
REST_REQUEST_HANDLER [APP_REQUEST_HANDLER_CONTEXT]
redefine
authenticated
end
APP_REQUEST_HELPER
@@ -17,7 +20,7 @@ feature {NONE} -- Initialization
-- Initialize various attributes
do
end
feature {NONE} -- Implementation
wgi_value_iteration_to_string (cur: ITERATION_CURSOR [WGI_VALUE]; using_pre: BOOLEAN): STRING_8
@@ -38,6 +41,24 @@ feature {NONE} -- Implementation
end
end
feature -- Auth
authenticated (ctx: APP_REQUEST_HANDLER_CONTEXT): BOOLEAN
-- Is authenticated?
do
--| To redefine if needed
if attached ctx.request.http_authorization as l_http_authorization then
Result := True
end
end
authenticated_identifier (ctx: APP_REQUEST_HANDLER_CONTEXT): detachable READABLE_STRING_32
do
if attached ctx.request.http_authorization as l_http_authorization then
Result := "foo" -- Implement it as you want
end
end
feature -- Helpers
format_id (s: detachable STRING): INTEGER

View File

@@ -9,29 +9,10 @@ class
inherit
REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT
redefine
authenticated,
authenticated_identifier
end
create
make
feature -- Auth
authenticated: BOOLEAN
do
if attached request.http_authorization as l_http_auth then
Result := True
end
end
authenticated_identifier: detachable READABLE_STRING_32
do
if authenticated then
Result := "foo"
end
end
feature -- Format

View File

@@ -10,12 +10,14 @@ class
inherit
APP_REQUEST_HANDLER
undefine
execute,
pre_execute,
post_execute
execute
end
REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT]
undefine
authenticated,
pre_execute,
post_execute
redefine
router
end