use of com.gitblit.utils.XssFilter.AllowXssFilter in project gitblit by gitblit.
the class HtpasswdAuthenticationTest method newHtpasswdAuthentication.
private HtpasswdAuthProvider newHtpasswdAuthentication(IStoredSettings settings) {
XssFilter xssFilter = new AllowXssFilter();
RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
UserManager users = new UserManager(runtime, null).start();
HtpasswdAuthProvider htpasswd = new HtpasswdAuthProvider();
htpasswd.setup(runtime, users);
return htpasswd;
}
use of com.gitblit.utils.XssFilter.AllowXssFilter in project gitblit by gitblit.
the class HtpasswdAuthenticationTest method newAuthenticationManager.
private AuthenticationManager newAuthenticationManager(IStoredSettings settings) {
XssFilter xssFilter = new AllowXssFilter();
RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
UserManager users = new UserManager(runtime, null).start();
HtpasswdAuthProvider htpasswd = new HtpasswdAuthProvider();
htpasswd.setup(runtime, users);
AuthenticationManager auth = new AuthenticationManager(runtime, users);
auth.addAuthenticationProvider(htpasswd);
return auth;
}
use of com.gitblit.utils.XssFilter.AllowXssFilter in project gitblit by gitblit.
the class BranchTicketServiceTest method getService.
@Override
protected ITicketService getService(boolean deleteAll) throws Exception {
IStoredSettings settings = getSettings(deleteAll);
XssFilter xssFilter = new AllowXssFilter();
IRuntimeManager runtimeManager = new RuntimeManager(settings, xssFilter).start();
IPluginManager pluginManager = new PluginManager(runtimeManager).start();
INotificationManager notificationManager = new NotificationManager(settings).start();
IUserManager userManager = new UserManager(runtimeManager, pluginManager).start();
IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, pluginManager, userManager).start();
BranchTicketService service = (BranchTicketService) new BranchTicketService(runtimeManager, pluginManager, notificationManager, userManager, repositoryManager).start();
if (deleteAll) {
service.deleteAll(getRepository());
}
return service;
}
use of com.gitblit.utils.XssFilter.AllowXssFilter in project gitblit by gitblit.
the class FederationClient method main.
public static void main(String[] args) {
Params params = new Params();
CmdLineParser parser = new CmdLineParser(params);
try {
parser.parseArgument(args);
} catch (CmdLineException t) {
usage(parser, t);
}
System.out.println("Gitblit Federation Client v" + Constants.getVersion() + " (" + Constants.getBuildDate() + ")");
// command-line specified base folder
File baseFolder = new File(System.getProperty("user.dir"));
if (!StringUtils.isEmpty(params.baseFolder)) {
baseFolder = new File(params.baseFolder);
}
File regFile = com.gitblit.utils.FileUtils.resolveParameter(Constants.baseFolder$, baseFolder, params.registrationsFile);
FileSettings settings = new FileSettings(regFile.getAbsolutePath());
List<FederationModel> registrations = new ArrayList<FederationModel>();
if (StringUtils.isEmpty(params.url)) {
registrations.addAll(FederationUtils.getFederationRegistrations(settings));
} else {
if (StringUtils.isEmpty(params.token)) {
System.out.println("Must specify --token parameter!");
System.exit(0);
}
FederationModel model = new FederationModel("Gitblit");
model.url = params.url;
model.token = params.token;
model.mirror = params.mirror;
model.bare = params.bare;
model.folder = "";
registrations.add(model);
}
if (registrations.size() == 0) {
System.out.println("No Federation Registrations! Nothing to do.");
System.exit(0);
}
// command-line specified repositories folder
if (!StringUtils.isEmpty(params.repositoriesFolder)) {
settings.overrideSetting(Keys.git.repositoriesFolder, new File(params.repositoriesFolder).getAbsolutePath());
}
// configure the Gitblit singleton for minimal, non-server operation
XssFilter xssFilter = new AllowXssFilter();
RuntimeManager runtime = new RuntimeManager(settings, xssFilter, baseFolder).start();
NoopNotificationManager notifications = new NoopNotificationManager().start();
UserManager users = new UserManager(runtime, null).start();
RepositoryManager repositories = new RepositoryManager(runtime, null, users).start();
FederationManager federation = new FederationManager(runtime, notifications, repositories).start();
IGitblit gitblit = new GitblitManager(null, null, runtime, null, notifications, users, null, repositories, null, federation, null);
FederationPullService puller = new FederationPullService(gitblit, federation.getFederationRegistrations()) {
@Override
public void reschedule(FederationModel registration) {
// NOOP
}
};
puller.run();
System.out.println("Finished.");
System.exit(0);
}
use of com.gitblit.utils.XssFilter.AllowXssFilter in project gitblit by gitblit.
the class FileTicketServiceTest method getService.
@Override
protected ITicketService getService(boolean deleteAll) throws Exception {
IStoredSettings settings = getSettings(deleteAll);
XssFilter xssFilter = new AllowXssFilter();
IRuntimeManager runtimeManager = new RuntimeManager(settings, xssFilter).start();
IPluginManager pluginManager = new PluginManager(runtimeManager).start();
INotificationManager notificationManager = new NotificationManager(settings).start();
IUserManager userManager = new UserManager(runtimeManager, pluginManager).start();
IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, pluginManager, userManager).start();
FileTicketService service = (FileTicketService) new FileTicketService(runtimeManager, pluginManager, notificationManager, userManager, repositoryManager).start();
if (deleteAll) {
service.deleteAll(getRepository());
}
return service;
}
Aggregations