MNG-4222: Introducing JSecurity to manage authentication against remote repositories

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@789079 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-06-28 09:44:35 +00:00
parent ba289ad502
commit 5f2cfdabb8
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package org.apache.maven.repository.security;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.jsecurity.authc.AuthenticationException;
import org.jsecurity.authc.AuthenticationInfo;
import org.jsecurity.authc.AuthenticationToken;
import org.jsecurity.authc.Authenticator;
@Component(role=RepositorySystemSecurityManager.class)
public class DefaultRepositorySystemSecurityManager
implements RepositorySystemSecurityManager
{
@Requirement
private Authenticator authenticator;
public AuthenticationInfo authenticate( AuthenticationToken token )
throws AuthenticationException
{
AuthenticationInfo authenticationInfo = authenticator.authenticate( token );
return authenticationInfo;
}
}

View File

@ -0,0 +1,11 @@
package org.apache.maven.repository.security;
import org.jsecurity.authc.AuthenticationException;
import org.jsecurity.authc.AuthenticationInfo;
import org.jsecurity.authc.AuthenticationToken;
public interface RepositorySystemSecurityManager
{
public AuthenticationInfo authenticate( AuthenticationToken token )
throws AuthenticationException;
}