Made all libraries compilable in any mode (voidsafe or not)
Fixed related examples
This commit is contained in:
@@ -14,6 +14,9 @@ inherit
|
||||
end
|
||||
|
||||
REST_REQUEST_AGENT_HANDLER [APP_REQUEST_HANDLER_CONTEXT]
|
||||
undefine
|
||||
authenticated
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user