-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Added support for Windows SSO authentication in Windows plat…
…form.
- Loading branch information
Showing
25 changed files
with
334 additions
and
157 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
.idea/libraries/com_google_dexmaker_dexmaker_mockito_1_0.xml
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Class-Path: lib/common.jar lib/jtds-1.2.7.jar | ||
Class-Path: common.jar jtds-1.2.7.jar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package org.tsqlt.runner.agent; | ||
|
||
import jetbrains.buildServer.agent.BuildAgentConfiguration; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
public interface ConnectionBuilder { | ||
Connection getConnection() throws SQLException, ClassNotFoundException; | ||
Connection getConnection(@NotNull BuildAgentConfiguration configuration) throws SQLException, ClassNotFoundException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.tsqlt.runner.agent; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.Vector; | ||
|
||
public final class OptionHelper { | ||
private static final List<String> invalidOptions = new Vector<String>() {{ | ||
add("domain"); | ||
add("useNTMLv2"); | ||
add("instance"); | ||
add("user"); | ||
add("password"); | ||
}}; | ||
|
||
public static List<String> filter(Set<String> options) { | ||
List<String> validOptions = new Vector<String>(); | ||
for (String option : options){ | ||
if (isValid(option)) | ||
validOptions.add(option); | ||
} | ||
return validOptions; | ||
} | ||
|
||
public static boolean isValid(String option) { | ||
return invalidOptions.contains(option) == false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,14 @@ | ||
package org.tsqlt.runner.agent; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.tsqlt.runner.common.PropertyNames; | ||
|
||
import java.util.Map; | ||
|
||
public class ServerInstance { | ||
private String server; | ||
private int port; | ||
private final String instance; | ||
|
||
public ServerInstance(@NotNull String input) { | ||
if (input.contains("\\")) { | ||
String[] parsed = input.split("\\\\", 2); | ||
setServer(parsed[0]); | ||
instance = parsed[1]; | ||
} else { | ||
setServer(input); | ||
instance = null; | ||
} | ||
} | ||
|
||
public interface ServerInstance { | ||
@NotNull | ||
public String getServer(){ | ||
return server; | ||
} | ||
String getServer(); | ||
|
||
private void setServer(@NotNull String server) { | ||
if (server.contains(":")) { | ||
String[] parsed = server.split(":", 2); | ||
this.server = transformLocalAddress(parsed[0]); | ||
this.port = Integer.parseInt(parsed[1]); | ||
} else { | ||
this.server = transformLocalAddress(server); | ||
port = 1433; | ||
} | ||
} | ||
|
||
@NotNull | ||
public static String transformLocalAddress(@NotNull String input) { | ||
if (input.toLowerCase().equals("(local)") || input.trim().equals(".")) | ||
return "127.0.0.1"; | ||
return input; | ||
} | ||
String getInstance(); | ||
|
||
public String getInstance(){ | ||
return instance; | ||
} | ||
|
||
public boolean hasInstance(){ | ||
return instance != null && !instance.isEmpty(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return hasInstance() ? String.format("%s\\%s", server, instance) : server; | ||
} | ||
|
||
@NotNull | ||
public static ServerInstance create(@NotNull Map<String, String> options){ | ||
return new ServerInstance(options.get(PropertyNames.SERVER_INSTANCE)); | ||
} | ||
boolean hasInstance(); | ||
|
||
public int getPort() { | ||
return port; | ||
} | ||
int getPort(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package org.tsqlt.runner.agent; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.tsqlt.runner.common.PropertyNames; | ||
|
||
import java.util.Map; | ||
|
||
public class ServerInstanceImpl implements ServerInstance { | ||
private String server; | ||
private int port; | ||
private final String instance; | ||
|
||
public ServerInstanceImpl(@NotNull String input) { | ||
if (input.contains("\\")) { | ||
String[] parsed = input.split("\\\\", 2); | ||
setServer(parsed[0]); | ||
instance = parsed[1]; | ||
} else { | ||
setServer(input); | ||
instance = null; | ||
} | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public String getServer(){ | ||
return server; | ||
} | ||
|
||
private void setServer(@NotNull String server) { | ||
if (server.contains(":")) { | ||
String[] parsed = server.split(":", 2); | ||
this.server = transformLocalAddress(parsed[0]); | ||
this.port = Integer.parseInt(parsed[1]); | ||
} else { | ||
this.server = transformLocalAddress(server); | ||
port = 1433; | ||
} | ||
} | ||
|
||
@NotNull | ||
public static String transformLocalAddress(@NotNull String input) { | ||
if (input.toLowerCase().equals("(local)") || input.trim().equals(".")) | ||
return "127.0.0.1"; | ||
return input; | ||
} | ||
|
||
@Override | ||
public String getInstance(){ | ||
return instance; | ||
} | ||
|
||
@Override | ||
public boolean hasInstance(){ | ||
return instance != null && !instance.isEmpty(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return hasInstance() ? String.format("%s\\%s", server, instance) : server; | ||
} | ||
|
||
@NotNull | ||
public static ServerInstance create(@NotNull Map<String, String> options){ | ||
return new ServerInstanceImpl(options.get(PropertyNames.SERVER_INSTANCE)); | ||
} | ||
|
||
@Override | ||
public int getPort() { | ||
return port; | ||
} | ||
} |
Oops, something went wrong.