mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Remove old username/password settings
These were once used to secure interactions with the web api, back when we allowed anonymous access to git repositories. This feature was dropped in the migration to Overleaf v2, and we use OAuth on those interactions anyway, so these settings are not actually used for anything, and keeping these around is just confusing.
This commit is contained in:
@@ -25,8 +25,6 @@ public class Config implements JSONSource {
|
||||
return new Config(
|
||||
config.port,
|
||||
config.rootGitDirectory,
|
||||
config.username,
|
||||
"<password>",
|
||||
config.apiBaseURL,
|
||||
config.postbackURL,
|
||||
config.serviceName,
|
||||
@@ -39,8 +37,6 @@ public class Config implements JSONSource {
|
||||
|
||||
private int port;
|
||||
private String rootGitDirectory;
|
||||
private String username;
|
||||
private String password;
|
||||
private String apiBaseURL;
|
||||
private String postbackURL;
|
||||
private String serviceName;
|
||||
@@ -67,8 +63,6 @@ public class Config implements JSONSource {
|
||||
public Config(
|
||||
int port,
|
||||
String rootGitDirectory,
|
||||
String username,
|
||||
String password,
|
||||
String apiBaseURL,
|
||||
String postbackURL,
|
||||
String serviceName,
|
||||
@@ -79,8 +73,6 @@ public class Config implements JSONSource {
|
||||
) {
|
||||
this.port = port;
|
||||
this.rootGitDirectory = rootGitDirectory;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.apiBaseURL = apiBaseURL;
|
||||
this.postbackURL = postbackURL;
|
||||
this.serviceName = serviceName;
|
||||
@@ -98,8 +90,6 @@ public class Config implements JSONSource {
|
||||
configObject,
|
||||
"rootGitDirectory"
|
||||
).getAsString();
|
||||
username = getOptionalString(configObject, "username");
|
||||
password = getOptionalString(configObject, "password");
|
||||
String apiBaseURL = getElement(
|
||||
configObject,
|
||||
"apiBaseUrl"
|
||||
@@ -138,14 +128,6 @@ public class Config implements JSONSource {
|
||||
return rootGitDirectory;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public String getAPIBaseURL() {
|
||||
return apiBaseURL;
|
||||
}
|
||||
|
||||
@@ -73,10 +73,6 @@ public class GitBridgeServer {
|
||||
);
|
||||
jettyServer = new Server(port);
|
||||
configureJettyServer(config, repoStore, snapshotApi);
|
||||
SnapshotAPIRequest.setBasicAuth(
|
||||
config.getUsername(),
|
||||
config.getPassword()
|
||||
);
|
||||
apiBaseURL = config.getAPIBaseURL();
|
||||
SnapshotAPIRequest.setBaseURL(apiBaseURL);
|
||||
Util.setServiceName(config.getServiceName());
|
||||
|
||||
@@ -11,9 +11,6 @@ import java.io.IOException;
|
||||
*/
|
||||
public abstract class SnapshotAPIRequest<T extends Result> extends Request<T> {
|
||||
|
||||
private static String USERNAME;
|
||||
private static String PASSWORD;
|
||||
|
||||
private static String BASE_URL;
|
||||
|
||||
private final Credential oauth2;
|
||||
@@ -33,27 +30,11 @@ public abstract class SnapshotAPIRequest<T extends Result> extends Request<T> {
|
||||
) throws IOException {
|
||||
if (oauth2 != null) {
|
||||
request.setInterceptor(request1 -> {
|
||||
new BasicAuthentication(
|
||||
USERNAME,
|
||||
PASSWORD
|
||||
).intercept(request1);
|
||||
oauth2.intercept(request1);
|
||||
});
|
||||
} else {
|
||||
request.setInterceptor(request1 -> {
|
||||
new BasicAuthentication(
|
||||
USERNAME,
|
||||
PASSWORD
|
||||
).intercept(request1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static void setBasicAuth(String username, String password) {
|
||||
USERNAME = username;
|
||||
PASSWORD = password;
|
||||
}
|
||||
|
||||
/* baseURL ends with / */
|
||||
public static void setBaseURL(String baseURL) {
|
||||
BASE_URL = baseURL + "docs/";
|
||||
|
||||
Reference in New Issue
Block a user