Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish.servicenow.plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
cat <<'EOF' > build.sh
#!/usr/bin/env bash
MID_SERVER_URLS=''
MID_SERVER_URLS=${MID_SERVER_URLS},https://install.service-now.com/glide/distribution/builds/package/mid/2025/04/30/mid.yokohama-12-18-2024__patch3-04-17-2025_04-30-2025_1345.linux.x86-64.zip
MID_SERVER_URLS=${MID_SERVER_URLS},https://install.service-now.com/glide/distribution/builds/package/mid/2024/09/01/mid.xanadu-07-02-2024__patch1-08-24-2024_09-01-2024_1853.linux.x86-64.zip
MID_SERVER_URLS=${MID_SERVER_URLS},https://install.service-now.com/glide/distribution/builds/package/mid/2024/08/31/mid.washingtondc-12-20-2023__patch7-08-21-2024_08-31-2024_1809.linux.x86-64.zip
MID_SERVER_URLS=${MID_SERVER_URLS},https://install.service-now.com/glide/distribution/builds/package/mid/2023/07/26/mid.vancouver-07-06-2023__patch0-07-18-2023_07-26-2023_1029.linux.x86-64.zip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ base {
java {
toolchain {
// Vancouver-- built with OpenJDK 11.x
languageVersion = JavaLanguageVersion.of(11)
//languageVersion = JavaLanguageVersion.of(11)

// Washington DC: A ServiceNow build of OpenJDK 17.0.8.1 is Supported and Included (17.0.8.1-sncmid1)
// Administrators will need to make sure any 3rd party JAR files for Credential resolvers, JDBC drivers, etc.
// are compatible with Java 17 and 'strong encapsulation', before upgrading.
// More information: KB1273036 MID Server - JRE 17 Upgrade

// Washington DC, Xanadu++ built with OpenJDK 17.x
//languageVersion = JavaLanguageVersion.of(17)
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand All @@ -36,7 +36,7 @@ repositories {
}

dependencies {
implementation ("com.keepersecurity.secrets-manager:core:16.6.4+")
implementation ("com.keepersecurity.secrets-manager:core:17.0.0+")

// MID server dependencies, not required to be uploaded
// MID jar dependency for config APIs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rootProject.name = "keeper-external-credentials"

plugins {
id("org.gradle.toolchains.foojay-resolver") version "0.8.0"
id("org.gradle.toolchains.foojay-resolver") version "0.10.0"
}

@Suppress("UnstableApiUsage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ public Map<String, String> resolve(Map<String, String> args) {
Map<String, String> result = new HashMap<>();

// input params
String credId = (String) args.get(ARG_ID);
String credType = (String) args.get(ARG_TYPE);
String midServer = (String) args.get(ARG_MID);
String credId = args.get(ARG_ID);
String credType = args.get(ARG_TYPE);
String midServer = args.get(ARG_MID);

if(isNullOrEmpty(credId) || isNullOrEmpty(credType))
throw new RuntimeException("Empty credential Id or type found.");
Expand Down Expand Up @@ -145,7 +145,7 @@ public Map<String, String> resolve(Map<String, String> args) {
throw new RuntimeException( "Invalid Credential ID: Credential Id has split string more than twice");
}

List<String> recordsFilter = Collections.<String>emptyList();
List<String> recordsFilter = Collections.emptyList();
if(!isNullOrEmpty(recType) || !isNullOrEmpty(recTitle)) {
fLogger.info(String.format("Record Type: '%s', Record Title: '%s'", recType, recTitle));
} else {
Expand All @@ -154,7 +154,7 @@ public Map<String, String> resolve(Map<String, String> args) {
}

// Initialize storage
InMemoryStorage storage = null;
InMemoryStorage storage;
try {
storage = new InMemoryStorage(ksmConfig);
} catch (Exception e) {
Expand All @@ -165,7 +165,7 @@ public Map<String, String> resolve(Map<String, String> args) {

try {
// Connect to vault and retrieve credential
List<KeeperRecord> records = Collections.<KeeperRecord> emptyList();
List<KeeperRecord> records = Collections.emptyList();
KeeperSecrets secrets;
if (ksmCache)
secrets = getSecretsCached(storage, recordsFilter);
Expand All @@ -187,7 +187,7 @@ public Map<String, String> resolve(Map<String, String> args) {
KeeperRecord record = null;
if (recordsFilter.isEmpty()) {
// no filter - search by type:title
List<KeeperRecord> found = new ArrayList<KeeperRecord>();
List<KeeperRecord> found = new ArrayList<>();
for (KeeperRecord rec : records) {
boolean matchesType = isNullOrEmpty(recType) || recType.equals(rec.getType());
boolean matchesTitle = recTitle.isEmpty() || recTitle.equals(rec.getTitle());
Expand Down Expand Up @@ -229,7 +229,7 @@ record = records.get(0);

// find fields by label prefix
List<KeeperRecordField> fields = record.getData().getCustom();
fields = (fields != null ? fields : new ArrayList<KeeperRecordField>());
fields = (fields != null ? fields : new ArrayList<>());
for (KeeperRecordField field : fields) {
String label = field.getLabel();
if (!isNullOrEmpty(label) && label.startsWith(ksmLabelPrefix)){
Expand All @@ -239,7 +239,7 @@ record = records.get(0);
} else if (result.containsKey(key)) {
fLogger.warn("### Skipped duplicate entry for field: " + label);
} else {
List<String> values = Collections.<String> emptyList();
List<String> values = Collections.emptyList();
if (field instanceof Text){
Text fld = (Text)field;
values = fld.getValue();
Expand Down Expand Up @@ -444,7 +444,7 @@ private static void saveCachedValue(byte[] key, byte[] data) throws Exception {

private static byte[] getCachedValue() throws Exception {
try (InputStream ins = Files.newInputStream(Paths.get(getCacheFilename()));
DataInputStream dis = new DataInputStream(ins);
DataInputStream dis = new DataInputStream(ins)
) {
//ins.reset();
byte[] bytes = new byte[ins.available()];
Expand Down
Loading