From efcaf4d9b599308dcc63cb7a0b4f3fd1c7bde4b5 Mon Sep 17 00:00:00 2001 From: Ivan Dimov <78815270+idimov-keeper@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:29:27 -0500 Subject: [PATCH] Added ServiceNow Vancouver version to the Release --- .github/workflows/publish.servicenow.plugin.yml | 1 + .../build.gradle | 6 ++++++ .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../java/com/snc/discovery/CredentialResolver.java | 10 +++++----- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.servicenow.plugin.yml b/.github/workflows/publish.servicenow.plugin.yml index 51db2ca6..22507b25 100644 --- a/.github/workflows/publish.servicenow.plugin.yml +++ b/.github/workflows/publish.servicenow.plugin.yml @@ -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/2023/07/26/mid.vancouver-07-06-2023__patch0-07-18-2023_07-26-2023_1029.linux.x86-64.zip MID_SERVER_URLS=${MID_SERVER_URLS},https://install.service-now.com/glide/distribution/builds/package/mid/2023/08/20/mid.utah-12-21-2022__patch6-08-09-2023_08-20-2023_0545.linux.x86-64.zip MID_SERVER_URLS=${MID_SERVER_URLS},https://install.service-now.com/glide/distribution/builds/package/mid/2023/06/23/mid.tokyo-07-08-2022__patch9-hotfix2-06-07-2023_06-23-2023_1740.linux.x86-64.zip MID_SERVER_URLS=${MID_SERVER_URLS},https://install.service-now.com/glide/distribution/builds/package/mid/2023/03/07/mid.sandiego-12-22-2021__patch10-hotfix2-03-06-2023_03-07-2023_0439.linux.x86-64.zip diff --git a/integration/servicenow-external-credential-resolver/build.gradle b/integration/servicenow-external-credential-resolver/build.gradle index a98270bf..28dbcd15 100644 --- a/integration/servicenow-external-credential-resolver/build.gradle +++ b/integration/servicenow-external-credential-resolver/build.gradle @@ -34,6 +34,12 @@ dependencies { compileOnly 'com.snc:commons-glide' compileOnly 'com.snc:commons-core-automation' compileOnly 'com.snc:snc-automation-api' + + // NB! JDK16+/Vancouver+ may require: export _JAVA_OPTIONS="--add-opens=java.base/sun.security.util=ALL-UNNAMED" + // Vancouver and newer: IFileSystem is in the new mid-api.jar + if( !fileTree("$midserver_agent_dir").filter{File f -> (f.name == "mid-api.jar")}.isEmpty() ) { + compileOnly 'com.snc:mid-api' + } } jar { diff --git a/integration/servicenow-external-credential-resolver/gradle/wrapper/gradle-wrapper.properties b/integration/servicenow-external-credential-resolver/gradle/wrapper/gradle-wrapper.properties index 17a8ddce..c30b486a 100644 --- a/integration/servicenow-external-credential-resolver/gradle/wrapper/gradle-wrapper.properties +++ b/integration/servicenow-external-credential-resolver/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/integration/servicenow-external-credential-resolver/src/main/java/com/snc/discovery/CredentialResolver.java b/integration/servicenow-external-credential-resolver/src/main/java/com/snc/discovery/CredentialResolver.java index 23f4fa85..ae08600d 100644 --- a/integration/servicenow-external-credential-resolver/src/main/java/com/snc/discovery/CredentialResolver.java +++ b/integration/servicenow-external-credential-resolver/src/main/java/com/snc/discovery/CredentialResolver.java @@ -66,7 +66,7 @@ public void config(Map configMap) { ksmConfig = configMap.get(KSM_CONFIG); if(isNullOrEmpty(ksmConfig)) - fLogger.error("[Vault] INFO - CredentialResolver ksmConfig not set!"); + fLogger.error("[Vault] ERROR - CredentialResolver ksmConfig not set!"); String configMask = new String(new char[ksmConfig.length()]).replace('\0', '*'); fLogger.info("ksmConfig: " + configMask); @@ -460,18 +460,18 @@ public static String getCacheDir() { } public static String getCacheFilename() { - String workPath = getCacheDir(); - return FileSystem.get().combinePath(workPath, "ksm_cache.dat"); + return Paths.get(getCacheDir(), "ksm_cache.dat").toString(); } public static String getCacheTmpFilename() { - String workPath = getCacheDir(); - return FileSystem.get().combinePath(workPath, "ksm_cache.tmp"); + return Paths.get(getCacheDir(), "ksm_cache.tmp").toString(); } //main method to test locally, provide KSM config and test it // TODO: Remove this before moving to production /* + // Note Java16+ needs following setup (Vancouver+ switched from Java11 to Java17) + // export _JAVA_OPTIONS="--add-opens=java.base/sun.security.util=ALL-UNNAMED" public static void main(String[] args) { CredentialResolver credResolver = new CredentialResolver(); credResolver.ksmConfig = "[Base64_KSM_Config]";