Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This compensates for Grizzly's missing http auth via a servlet filter. #112

Closed
wants to merge 3 commits into from

Conversation

gregjan
Copy link
Contributor

@gregjan gregjan commented Oct 3, 2013

https://www.pivotaltracker.com/story/show/58003404

The test filter proxies the request, adding methods needed for authN, simulating container auth.
All BASIC login attempts will pass with test filter configured
The fedoraAdmin container role is assigned to any user named "fedoraAdmin"
New filter is configured in web.xml for http-api and auth-commons.
OAuth project has a similar filter that was tweaked to support more auth methods in a basic way.
OAuth project now configured to use the bypass security authentication provider for ITs

Fedora PEP interface for filtering searches was refactored around iterators instead of sets.

JAX-RS security contexts were stripped out of the ModeShape login chain, keeping login
at the container level. This also means that login can be based on Modeshape's standard
ServletCredentials object.

Made some changes to FedoraUserSecurityContext and FedoraAdminSecurityContext to better support ModeShape logout.

Renamed a constant representing the fedora user role, resulting in some one-line changes in other places

The test filter proxies the request, adding methods needed for authN, simulating container auth.
All BASIC login attempts will pass with test filter configured
The fedoraAdmin container role is assigned to any user named "fedoraAdmin"
New filter is configured in web.xml for http-api and auth-commons.
OAuth project has a similar filter that was tweaked to support more auth methods in a basic way.
OAuth project now configured to use the bypass security authentication provider for ITs

Fedora PEP interface for filtering searches was refactored around iterators instead of sets.

JAX-RS security contexts were stripped out of the ModeShape login chain, keeping login
at the container level. This also means that login can be based on Modeshape's standard
ServletCredentials object.

Renamed a constant representing the fedora user role, resulting in some one-line changes in other places
private HttpServletRequest request = null;
private String username = null;

boolean loggedIn = true;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add "private" access qualifier.

backed out whitespace changes
various access modifiers and logging details
removed MockHeaderFilter, will use normal mocks or ITs to test principal factory functions
* @see SecurityContext#getUserName()
*/
@Override
public final String getUserName() {
return request.getRemoteUser();
if (this.loggedIn && this.userPrincipal != null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about replacing this if/else with:
getEffectiveUserPrincipal().getName() ?

@awoods
Copy link

awoods commented Oct 4, 2013

@awoods awoods closed this Oct 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants