Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317759 - roles and constraints need to be added after init
Summary: roles and constraints need to be added after init
Status: CLOSED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.1.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.1.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-23 20:31 EDT by Greg Wilkins CLA
Modified: 2011-06-30 23:29 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Wilkins CLA 2010-06-23 20:31:06 EDT
roles and constraints may be discovered as annotations and added as a servlet is loaded.
Comment 1 Greg Wilkins CLA 2011-02-22 23:52:31 EST
is this now dealt with?
Comment 2 Jesse McConnell CLA 2011-05-11 12:24:44 EDT
I see a DeclareRolesAnnotationHandler that looks for DeclareRoles annotations and adds those roles to the constraint security handler so think its resolves...

Jan, can you confirm and close or if there is something else missing here expand on it and I'll take care of it
Comment 3 Jan Bartel CLA 2011-06-30 23:26:16 EDT
There is indeed the @DeclaresRoles annotation method implemented that will add roles to the context that can be tested with isUserInRole() method programmatically. There is also the test-annotation-webapp over on codehaus that exercises this annotation.

The @ServletSecurity annotation has also been implemented that is introspected when the Servlet class goes into use. This annotation defines constraints.

Note also that all relevant tests from the Glassfish JavaEE6 Samples project have been run against jetty-8: see http://glassfish-samples.java.net/.
Comment 4 Jan Bartel CLA 2011-06-30 23:27:21 EDT
Fixed for jetty-8.
Comment 5 Jan Bartel CLA 2011-06-30 23:29:53 EDT
I should have also added that @DeclaresRoles is also implemented for jetty-7. The @ServletSecurity annotation only exists in jetty-8 (as it is servlet 3.0).