/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

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