| | |
| | | import org.slf4j.LoggerFactory;
|
| | |
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.manager.ISessionManager;
|
| | | import com.gitblit.manager.IAuthenticationManager;
|
| | | import com.gitblit.models.UserModel;
|
| | | import com.gitblit.utils.DeepCopier;
|
| | | import com.gitblit.utils.StringUtils;
|
| | |
| | |
|
| | | protected transient Logger logger = LoggerFactory.getLogger(getClass());
|
| | |
|
| | | protected final ISessionManager sessionManager;
|
| | | protected IAuthenticationManager authenticationManager;
|
| | |
|
| | | protected AuthenticationFilter(ISessionManager sessionManager) {
|
| | | this.sessionManager = sessionManager;
|
| | | protected AuthenticationFilter(IAuthenticationManager authenticationManager) {
|
| | | this.authenticationManager = authenticationManager;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void init(FilterConfig filterConfig) throws ServletException {
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void destroy() {
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @return user
|
| | | */
|
| | | protected UserModel getUser(HttpServletRequest httpRequest) {
|
| | | UserModel user = sessionManager.authenticate(httpRequest, requiresClientCertificate());
|
| | | UserModel user = authenticationManager.authenticate(httpRequest, requiresClientCertificate());
|
| | | return user;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
|
| | | */
|
| | | @Override
|
| | | public void init(final FilterConfig config) throws ServletException {
|
| | | }
|
| | |
|
| | | /**
|
| | | * @see javax.servlet.Filter#destroy()
|
| | | */
|
| | | @Override
|
| | | public void destroy() {
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | // Gitblit does not currently use actual roles in the traditional
|
| | | // servlet container sense. That is the reason this is marked
|
| | | // deprecated, but I may want to revisit this.
|
| | | return user.canAccessRepository(role);
|
| | | return user.hasRepositoryPermission(role);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return user;
|
| | | }
|
| | | }
|
| | | } |
| | | }
|