PageRenderTime 139ms CodeModel.GetById 135ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/library/server/rest/tests/src/rest_server_request_context.e

http://github.com/jocelyn/EiffelWebReloaded
Specman e | 59 lines | 48 code | 10 blank | 1 comment | 1 complexity | fbe96c526db09c7ec884967f7c04960c MD5 | raw file
 1note
 2	description: "Summary description for {REST_SERVER_REQUEST_CONTEXT}."
 3	author: ""
 4	date: "$Date$"
 5	revision: "$Revision$"
 6
 7class
 8	REST_SERVER_REQUEST_CONTEXT
 9
10inherit
11	REST_REQUEST_CONTEXT
12		redefine
13			authentication,
14			validate_cookies,
15			initialize
16		end
17
18create {HTTPD_APPLICATION}
19	make
20
21feature {NONE} -- Initialize
22
23	initialize
24		do
25			create authentication
26			Precursor
27		end
28
29feature -- Basic operation
30
31	validate_cookies
32		do
33			if
34				attached cookies as l_cookies and then
35				attached l_cookies.item ("uuid") as l_uuid and then
36				attached l_cookies.item ("auth") as l_auth and then
37				attached l_cookies.item ("user") as l_user
38			then
39				authenticated := l_auth.value_is_string ("yes")
40				authenticated_identifier := l_user.value
41			end
42		end
43
44feature -- Authentication		
45
46	authentication: detachable REST_SERVER_AUTHENTICATION
47			-- Optional authentication system
48
49;note
50	copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
51	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
52	source: "[
53			Eiffel Software
54			5949 Hollister Ave., Goleta, CA 93117 USA
55			Telephone 805-685-1006, Fax 805-685-6869
56			Website http://www.eiffel.com
57			Customer support http://support.eiffel.com
58		]"
59end