| | |
| | | import com.gitblit.Keys; |
| | | import com.gitblit.Keys.web; |
| | | import com.gitblit.manager.IRuntimeManager; |
| | | import com.gitblit.manager.ISessionManager; |
| | | import com.gitblit.manager.IAuthenticationManager; |
| | | import com.gitblit.models.UserModel; |
| | | |
| | | /** |
| | |
| | | |
| | | private final IStoredSettings settings; |
| | | |
| | | private final ISessionManager sessionManager; |
| | | private final IAuthenticationManager authenticationManager; |
| | | |
| | | @Inject |
| | | public EnforceAuthenticationFilter( |
| | | IRuntimeManager runtimeManager, |
| | | ISessionManager sessionManager) { |
| | | IAuthenticationManager authenticationManager) { |
| | | |
| | | super(); |
| | | this.settings = runtimeManager.getSettings(); |
| | | this.sessionManager = sessionManager; |
| | | this.authenticationManager = authenticationManager; |
| | | } |
| | | |
| | | /* |
| | |
| | | |
| | | HttpServletRequest httpRequest = (HttpServletRequest) request; |
| | | HttpServletResponse httpResponse = (HttpServletResponse) response; |
| | | UserModel user = sessionManager.authenticate(httpRequest); |
| | | UserModel user = authenticationManager.authenticate(httpRequest); |
| | | |
| | | if (mustForceAuth && (user == null)) { |
| | | // not authenticated, enforce now: |