Search in sources :

Example 11 with XssFilter

use of com.gitblit.utils.XssFilter in project gitblit by gitblit.

the class LdapAuthenticationTest method newAuthenticationManager.

private AuthenticationManager newAuthenticationManager(IStoredSettings settings) {
    XssFilter xssFilter = new AllowXssFilter();
    RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
    AuthenticationManager auth = new AuthenticationManager(runtime, userManager);
    auth.addAuthenticationProvider(newLdapAuthentication(settings));
    return auth;
}
Also used : AuthenticationManager(com.gitblit.manager.AuthenticationManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) XssFilter(com.gitblit.utils.XssFilter) RuntimeManager(com.gitblit.manager.RuntimeManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter)

Example 12 with XssFilter

use of com.gitblit.utils.XssFilter in project gitblit by gitblit.

the class LdapAuthenticationTest method newLdapAuthentication.

private LdapAuthProvider newLdapAuthentication(IStoredSettings settings) {
    XssFilter xssFilter = new AllowXssFilter();
    RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
    userManager = new UserManager(runtime, null).start();
    LdapAuthProvider ldap = new LdapAuthProvider();
    ldap.setup(runtime, userManager);
    return ldap;
}
Also used : LdapAuthProvider(com.gitblit.auth.LdapAuthProvider) IUserManager(com.gitblit.manager.IUserManager) UserManager(com.gitblit.manager.UserManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) XssFilter(com.gitblit.utils.XssFilter) RuntimeManager(com.gitblit.manager.RuntimeManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter)

Example 13 with XssFilter

use of com.gitblit.utils.XssFilter in project gitblit by gitblit.

the class AuthenticationManagerTest method newAuthenticationManager.

IAuthenticationManager newAuthenticationManager() {
    XssFilter xssFilter = new AllowXssFilter();
    RuntimeManager runtime = new RuntimeManager(getSettings(), xssFilter, GitBlitSuite.BASEFOLDER).start();
    users = new UserManager(runtime, null).start();
    final Map<String, UserModel> virtualUsers = new HashMap<String, UserModel>();
    users.setUserService(new IUserService() {

        @Override
        public void setup(IRuntimeManager runtimeManager) {
        }

        @Override
        public String getCookie(UserModel model) {
            return null;
        }

        @Override
        public UserModel getUserModel(char[] cookie) {
            return null;
        }

        @Override
        public UserModel getUserModel(String username) {
            return virtualUsers.get(username);
        }

        @Override
        public boolean updateUserModel(UserModel model) {
            virtualUsers.put(model.username, model);
            return true;
        }

        @Override
        public boolean updateUserModels(Collection<UserModel> models) {
            return false;
        }

        @Override
        public boolean updateUserModel(String username, UserModel model) {
            virtualUsers.put(username, model);
            return true;
        }

        @Override
        public boolean deleteUserModel(UserModel model) {
            return false;
        }

        @Override
        public boolean deleteUser(String username) {
            return false;
        }

        @Override
        public List<String> getAllUsernames() {
            return null;
        }

        @Override
        public List<UserModel> getAllUsers() {
            return null;
        }

        @Override
        public List<String> getAllTeamNames() {
            return null;
        }

        @Override
        public List<TeamModel> getAllTeams() {
            return null;
        }

        @Override
        public List<String> getTeamNamesForRepositoryRole(String role) {
            return null;
        }

        @Override
        public TeamModel getTeamModel(String teamname) {
            return null;
        }

        @Override
        public boolean updateTeamModel(TeamModel model) {
            return false;
        }

        @Override
        public boolean updateTeamModels(Collection<TeamModel> models) {
            return false;
        }

        @Override
        public boolean updateTeamModel(String teamname, TeamModel model) {
            return false;
        }

        @Override
        public boolean deleteTeamModel(TeamModel model) {
            return false;
        }

        @Override
        public boolean deleteTeam(String teamname) {
            return false;
        }

        @Override
        public List<String> getUsernamesForRepositoryRole(String role) {
            return null;
        }

        @Override
        public boolean renameRepositoryRole(String oldRole, String newRole) {
            return false;
        }

        @Override
        public boolean deleteRepositoryRole(String role) {
            return false;
        }
    });
    AuthenticationManager auth = new AuthenticationManager(runtime, users).start();
    return auth;
}
Also used : HashMap(java.util.HashMap) IRuntimeManager(com.gitblit.manager.IRuntimeManager) RuntimeManager(com.gitblit.manager.RuntimeManager) UserModel(com.gitblit.models.UserModel) IRuntimeManager(com.gitblit.manager.IRuntimeManager) AuthenticationManager(com.gitblit.manager.AuthenticationManager) IAuthenticationManager(com.gitblit.manager.IAuthenticationManager) TeamModel(com.gitblit.models.TeamModel) UserManager(com.gitblit.manager.UserManager) IUserService(com.gitblit.IUserService) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) XssFilter(com.gitblit.utils.XssFilter) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) List(java.util.List)

Example 14 with XssFilter

use of com.gitblit.utils.XssFilter in project gitblit by gitblit.

the class RedmineAuthenticationTest method newAuthenticationManager.

AuthenticationManager newAuthenticationManager() {
    XssFilter xssFilter = new AllowXssFilter();
    RuntimeManager runtime = new RuntimeManager(getSettings(), xssFilter, GitBlitSuite.BASEFOLDER).start();
    UserManager users = new UserManager(runtime, null).start();
    RedmineAuthProvider redmine = new RedmineAuthProvider();
    redmine.setup(runtime, users);
    redmine.setTestingCurrentUserAsJson(JSON);
    AuthenticationManager auth = new AuthenticationManager(runtime, users);
    auth.addAuthenticationProvider(redmine);
    return auth;
}
Also used : AuthenticationManager(com.gitblit.manager.AuthenticationManager) UserManager(com.gitblit.manager.UserManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) XssFilter(com.gitblit.utils.XssFilter) RuntimeManager(com.gitblit.manager.RuntimeManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) RedmineAuthProvider(com.gitblit.auth.RedmineAuthProvider)

Example 15 with XssFilter

use of com.gitblit.utils.XssFilter in project gitblit by gitblit.

the class RedmineAuthenticationTest method newRedmineAuthentication.

RedmineAuthProvider newRedmineAuthentication(IStoredSettings settings) {
    XssFilter xssFilter = new AllowXssFilter();
    RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
    UserManager users = new UserManager(runtime, null).start();
    RedmineAuthProvider redmine = new RedmineAuthProvider();
    redmine.setup(runtime, users);
    return redmine;
}
Also used : UserManager(com.gitblit.manager.UserManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) XssFilter(com.gitblit.utils.XssFilter) RuntimeManager(com.gitblit.manager.RuntimeManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) RedmineAuthProvider(com.gitblit.auth.RedmineAuthProvider)

Aggregations

RuntimeManager (com.gitblit.manager.RuntimeManager)15 XssFilter (com.gitblit.utils.XssFilter)15 AllowXssFilter (com.gitblit.utils.XssFilter.AllowXssFilter)15 UserManager (com.gitblit.manager.UserManager)12 RepositoryManager (com.gitblit.manager.RepositoryManager)8 IRuntimeManager (com.gitblit.manager.IRuntimeManager)7 IRepositoryManager (com.gitblit.manager.IRepositoryManager)6 IUserManager (com.gitblit.manager.IUserManager)5 IStoredSettings (com.gitblit.IStoredSettings)4 AuthenticationManager (com.gitblit.manager.AuthenticationManager)4 INotificationManager (com.gitblit.manager.INotificationManager)4 IPluginManager (com.gitblit.manager.IPluginManager)4 NotificationManager (com.gitblit.manager.NotificationManager)4 PluginManager (com.gitblit.manager.PluginManager)4 BranchTicketService (com.gitblit.tickets.BranchTicketService)4 CmdLineException (org.kohsuke.args4j.CmdLineException)3 HtpasswdAuthProvider (com.gitblit.auth.HtpasswdAuthProvider)2 RedmineAuthProvider (com.gitblit.auth.RedmineAuthProvider)2 FileTicketService (com.gitblit.tickets.FileTicketService)2 ITicketService (com.gitblit.tickets.ITicketService)2