local testing without cas and https
This commit is contained in:
parent
dec7a70e42
commit
efe1dca0df
@ -32,12 +32,19 @@ public class CASTicket {
|
||||
this.user = user;
|
||||
this.runAs = runAs;
|
||||
Config config = Config.getInstance();
|
||||
loginURL = config.getProperty("loginURL", LOGIN_URL);
|
||||
backendURL = config.getProperty("backendURL", BACKEND_URL);
|
||||
grantingTicket = readFiledGrantingTicket();
|
||||
loginURL = config.getProperty("loginURL", LOGIN_URL);
|
||||
if ("TestUmgebung".equals(loginURL)) {
|
||||
grantingTicket = "ticket:" + user;
|
||||
} else {
|
||||
grantingTicket = readFiledGrantingTicket();
|
||||
}
|
||||
}
|
||||
|
||||
public String getTicket() throws JSCliException {
|
||||
if (grantingTicket != null && grantingTicket.startsWith("ticket:")) {
|
||||
return grantingTicket.replaceFirst("ticket", "user");
|
||||
}
|
||||
try {
|
||||
String encodedParams = URLEncoder.encode("service", "UTF-8")
|
||||
+ "=" + URLEncoder.encode(backendURL, "UTF-8");
|
||||
|
@ -38,6 +38,9 @@ public class Main {
|
||||
throw new JSCliException("fatal error: console not found");
|
||||
}
|
||||
String command = console.readLine("%s@hsadmin>", runAs);
|
||||
if (command == null) {
|
||||
command = "";
|
||||
}
|
||||
while (!("bye".equals(command.trim()) || "exit".equals(command.trim()) || "quit".equals(command.trim()))) {
|
||||
try {
|
||||
console.printf("%s\n", formatter.format(scriptClient.execute(command)));
|
||||
@ -45,9 +48,12 @@ public class Main {
|
||||
console.printf("ERR: %s\n", e.getLocalizedMessage());
|
||||
}
|
||||
command = console.readLine("%s@hsadmin>", runAs);
|
||||
while (command.endsWith("\\")) {
|
||||
if (command == null) {
|
||||
command = "";
|
||||
}
|
||||
while (command.trim().endsWith("\\")) {
|
||||
command = command.substring(0, command.length() - 1) +
|
||||
console.readLine(">");
|
||||
"\n" + console.readLine(">");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user