Line data Source code
1 : // Copyright (C) 2015 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.httpd.auth.oauth; 16 : 17 : import com.google.gerrit.extensions.auth.oauth.OAuthServiceProvider; 18 : import com.google.gerrit.extensions.registration.DynamicMap; 19 : import com.google.inject.servlet.ServletModule; 20 : 21 : /** Servlets and support related to OAuth authentication. */ 22 0 : public class OAuthModule extends ServletModule { 23 : 24 : @Override 25 : protected void configureServlets() { 26 0 : filter("/login", "/login/*", "/oauth").through(OAuthWebFilter.class); 27 : // This is needed to invalidate OAuth session during logout 28 0 : serve("/logout").with(OAuthLogoutServlet.class); 29 0 : DynamicMap.mapOf(binder(), OAuthServiceProvider.class); 30 0 : } 31 : }