-
Notifications
You must be signed in to change notification settings - Fork 4
build: fix macOS/Windows cross-platform build without SAP SDK #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
51dbe04
a029df2
9d14808
0c69767
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| "executor": "nx:run-commands", | ||
| "dependsOn": ["openadt-config:compile", "openadt-sap-adt:compile"], | ||
| "options": { | ||
| "command": "node scripts/mvnw-runner.mjs -q compile -pl apps/openadt-bootstrap -am -f pom.xml", | ||
| "command": "node scripts/mvnw-runner.mjs -q install -pl apps/openadt-bootstrap -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||
| "cwd": "{workspaceRoot}" | ||
| }, | ||
| "cache": true, | ||
|
|
@@ -22,7 +22,7 @@ | |
| "executor": "nx:run-commands", | ||
| "dependsOn": ["compile"], | ||
| "options": { | ||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-bootstrap -am -f pom.xml", | ||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-bootstrap -Pdistribution -Dopenadt.distribution=true -f pom.xml && node scripts/mvnw-runner.mjs install -pl apps/openadt-bootstrap -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||
| "cwd": "{workspaceRoot}" | ||
|
Comment on lines
24
to
26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using "options": {
"commands": [
"node scripts/mvnw-runner.mjs -q test -pl apps/openadt-bootstrap -Pdistribution -Dopenadt.distribution=true -f pom.xml",
"node scripts/mvnw-runner.mjs -q install -pl apps/openadt-bootstrap -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml"
],
"parallel": false,
"cwd": "{workspaceRoot}" |
||
| }, | ||
| "cache": true, | ||
|
|
@@ -37,7 +37,7 @@ | |
| "openadt-sap-adt:package" | ||
| ], | ||
| "options": { | ||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-bootstrap -am -DskipTests -f pom.xml", | ||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-bootstrap -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||
| "cwd": "{workspaceRoot}" | ||
| }, | ||
| "cache": true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,12 +52,26 @@ | |
| List<SystemProfile> systems = new ArrayList<>(); | ||
| parseClassicSystems(document, systems); | ||
| parseLoadBalancedSystems(document, systems); | ||
| detectExternalLandscapeUrls(document, path); | ||
| return systems; | ||
| } catch (ParserConfigurationException | SAXException e) { | ||
| throw new IOException("Failed to parse SAP GUI landscape: " + path, e); | ||
| } | ||
| } | ||
|
|
||
| private void detectExternalLandscapeUrls(Document document, Path sourcePath) { | ||
|
Check warning on line 62 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SapGuiLandscapeDetector.java
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Unused parameter |
||
| NodeList includeNodes = document.getElementsByTagName("Include"); | ||
| for (int i = 0; i < includeNodes.getLength(); i++) { | ||
| Element include = (Element) includeNodes.item(i); | ||
| String url = blankToNull(include.getAttribute("url")); | ||
| if (url != null) { | ||
| System.err.println("INFO: External SAP landscape URL detected: " + url); | ||
|
Check warning on line 68 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SapGuiLandscapeDetector.java
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The code prints the full external landscape Severity Level: Critical 🚨- ❌ External landscape URLs with credentials exposed in stderr logs.
- ⚠️ SetupAnalyzer CLI leaks internal SAP endpoints to operators.Steps of Reproduction ✅1. Create an SAP GUI landscape file containing an external include, for example `<Include
url="https://user:secret@example.com/SAPUILandscape.xml"/>`, and place it at a location
returned by `SetupPathLocator.sapGuiLandscapeFiles()` (e.g.
`~/Library/Preferences/SAP/SAPGUILandscape.xml` for macOS as configured in
SetupPathLocator.java:37-42).
2. Run the setup analysis flow, which constructs a default `SetupAnalyzer`
(SetupAnalyzer.java:25-36); its constructor wires in a `SapGuiLandscapeDetector` instance
at line 28 and later calls `analyze()` (SetupAnalyzer.java:45-51), causing each
`SystemDetector` to execute `detect()`.
3. Inside `SapGuiLandscapeDetector.detect()` (SapGuiLandscapeDetector.java:35-47), the
detector iterates over paths from `SetupPathLocator.sapGuiLandscapeFiles()`
(SapGuiLandscapeDetector.java:25-27) and, for each existing file, invokes
`parseLandscapeFile(path)` (SapGuiLandscapeDetector.java:49-56).
4. `parseLandscapeFile()` parses the XML into a `Document`
(SapGuiLandscapeDetector.java:51) and calls `detectExternalLandscapeUrls(document, path)`
(line 55); for each `<Include>` element with a non-blank `url` attribute
(SapGuiLandscapeDetector.java:62-67), `detectExternalLandscapeUrls()` executes
`System.err.println("INFO: External SAP landscape URL detected: " + url);` at line 68,
emitting the full external URL—including any embedded credentials, tokens, or internal
hostnames—directly to stderr and into CLI/CI logs.Fix in Cursor | Fix in VSCode Claude (Use Cmd/Ctrl + Click for best experience) Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SapGuiLandscapeDetector.java
**Line:** 68:68
**Comment:**
*Security: The code prints the full external landscape `url` value directly to stderr, which can leak embedded credentials or internal endpoints into CI logs and terminal history. Redact sensitive URL parts (user-info/query/fragment) or avoid printing the raw URL value.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix |
||
| System.err.println("INFO: Some system details (message server hostnames) may be in the external landscape."); | ||
|
Check warning on line 69 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SapGuiLandscapeDetector.java
|
||
| System.err.println("INFO: Open SAP GUI once to cache the full landscape, or provide message server manually."); | ||
|
Check warning on line 70 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SapGuiLandscapeDetector.java
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| private void parseClassicSystems(Document document, List<SystemProfile> systems) { | ||
| NodeList systemNodes = document.getElementsByTagName("System"); | ||
| for (int i = 0; i < systemNodes.getLength(); i++) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,19 @@ | |
| paths.add(Path.of(home, "AppData", "Roaming", "SAP", SAP_COMMON, SAPUI_LANDSCAPE)); | ||
| } | ||
| } else if (os.contains("mac")) { | ||
| paths.add(Path.of(home, "Library", "Application Support", "SAP", SAP_COMMON, SAPUI_LANDSCAPE)); | ||
|
Check failure on line 38 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SetupPathLocator.java
|
||
| // SAP GUI for Java stores landscape in Preferences with different filename | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Overall Code Complexity |
||
| paths.add(Path.of(home, "Library", "Preferences", "SAP", "SAPGUILandscape.xml")); | ||
| // SAP GUI for Java caches full landscape with message servers | ||
| Path cacheDir = Path.of(home, "Library", "Preferences", "SAP", "Cache", "SAPUILandscape"); | ||
| if (Files.exists(cacheDir)) { | ||
| try (var stream = Files.list(cacheDir)) { | ||
| stream.filter(f -> f.toString().endsWith(".xml")) | ||
| .forEach(paths::add); | ||
|
Comment on lines
+45
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Cached landscape files are filtered with a case-sensitive Severity Level: Major
|
||
| } catch (IOException e) { | ||
| // Ignore cache read errors | ||
| } | ||
| } | ||
|
Comment on lines
+39
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Complex Method
Comment on lines
+39
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Bumpy Road Ahead |
||
| } | ||
|
|
||
| for (Path windowsHome : windowsUserHomes()) { | ||
|
|
@@ -103,6 +115,23 @@ | |
|
|
||
| static List<Path> jcoJarRoots() { | ||
| List<Path> paths = new ArrayList<>(); | ||
| String os = System.getProperty(OS_NAME_PROPERTY, "").toLowerCase(Locale.ROOT); | ||
| String home = System.getProperty(USER_HOME_PROPERTY, ""); | ||
|
|
||
| // macOS and Linux: check user's home directory for Eclipse p2 pool | ||
| if (!home.isBlank() && (os.contains("mac") || os.contains("nix") || os.contains("nux"))) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Complex Conditional |
||
| paths.add(Path.of(home, ".p2", "pool", "plugins")); | ||
|
Check failure on line 123 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SetupPathLocator.java
|
||
| } | ||
|
|
||
| // macOS: Eclipse.app bundle installations | ||
| if (os.contains("mac")) { | ||
| paths.add(Path.of("/Applications", "Eclipse.app", "Contents", "Eclipse", "plugins")); | ||
|
Check failure on line 128 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SetupPathLocator.java
|
||
| paths.add(Path.of("/Applications", "SAP Business Application Studio.app", "Contents", "Eclipse", "plugins")); | ||
| if (!home.isBlank()) { | ||
| paths.add(Path.of(home, "Applications", "Eclipse.app", "Contents", "Eclipse", "plugins")); | ||
| } | ||
| } | ||
|
Comment on lines
+123
to
+133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win Deduplicate repeated path literals to satisfy static analysis and reduce path drift risk. The new macOS path additions repeat literals ( Also applies to: 145-147, 185-188 🧰 Tools🪛 GitHub Check: SonarCloud Code Analysis[failure] 118-118: Define a constant instead of duplicating this literal "Eclipse" 5 times. [failure] 118-118: Define a constant instead of duplicating this literal "/Applications" 3 times. [failure] 118-118: Define a constant instead of duplicating this literal "Contents" 5 times. [failure] 118-118: Define a constant instead of duplicating this literal "Eclipse.app" 4 times. [failure] 113-113: Define a constant instead of duplicating this literal "plugins" 4 times. 🤖 Prompt for AI Agents |
||
|
|
||
| for (Path windowsHome : windowsUserHomes()) { | ||
| paths.add(windowsHome.resolve(".p2/pool/plugins")); | ||
| } | ||
|
|
@@ -113,6 +142,20 @@ | |
|
|
||
| static List<Path> jcoNativeSearchRoots() { | ||
| List<Path> paths = new ArrayList<>(); | ||
| String os = System.getProperty(OS_NAME_PROPERTY, "").toLowerCase(Locale.ROOT); | ||
| String home = System.getProperty(USER_HOME_PROPERTY, ""); | ||
|
|
||
| // macOS-specific paths for JCo native libraries | ||
| if (os.contains("mac") && !home.isBlank()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Absolute system paths ( Prompt for AI agents |
||
| paths.add(Path.of(home, "lib")); | ||
| paths.add(Path.of(home, ".p2")); | ||
| paths.add(Path.of("/usr", "local", "lib")); | ||
| paths.add(Path.of("/Library", "Java", "Extensions")); | ||
| // Eclipse.app OSGi bundle cache (where JCo native lib is extracted) | ||
| paths.add(Path.of("/Applications", "Eclipse.app", "Contents", "Eclipse", "configuration", "org.eclipse.osgi")); | ||
| paths.add(Path.of(home, "Applications", "Eclipse.app", "Contents", "Eclipse", "configuration", "org.eclipse.osgi")); | ||
| } | ||
|
Comment on lines
+149
to
+157
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don’t gate absolute macOS search paths on Both macOS blocks skip Also applies to: 184-188 🤖 Prompt for AI Agents |
||
|
|
||
| for (Path windowsHome : windowsUserHomes()) { | ||
| paths.add(windowsHome.resolve("Documents")); | ||
| paths.add(windowsHome.resolve("AppData/Local")); | ||
|
|
@@ -144,6 +187,16 @@ | |
|
|
||
| static List<Path> sapcryptoCandidates() { | ||
| List<Path> paths = new ArrayList<>(); | ||
| String os = System.getProperty(OS_NAME_PROPERTY, "").toLowerCase(Locale.ROOT); | ||
| String home = System.getProperty(USER_HOME_PROPERTY, ""); | ||
|
|
||
| // macOS-specific paths for SAP Crypto | ||
| if (os.contains("mac") && !home.isBlank()) { | ||
| paths.add(Path.of(home, "lib", "libsapcrypto.dylib")); | ||
|
Check failure on line 195 in apps/openadt-bootstrap/src/main/java/org/openadt/bootstrap/SetupPathLocator.java
|
||
| paths.add(Path.of("/usr", "local", "lib", "libsapcrypto.dylib")); | ||
| paths.add(Path.of("/Library", "Frameworks", "sapcrypto.framework", "Versions", "Current", "libsapcrypto.dylib")); | ||
| } | ||
|
|
||
| for (Path programFilesRoot : windowsProgramFilesRoots()) { | ||
| paths.add(programFilesRoot.resolve("SAP/FrontEnd/SecureLogin/lib/sapcrypto.dll")); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
| "openadt-bootstrap:compile" | ||
| ], | ||
| "options": { | ||
| "command": "node scripts/mvnw-runner.mjs -q compile -pl apps/openadt-cli -am -Pdistribution -Dopenadt.distribution=true -f pom.xml && bun run scripts/dev-runtime-classpath.ts", | ||
| "command": "node scripts/mvnw-runner.mjs -q install -pl apps/openadt-cli -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml && bun run scripts/dev-runtime-classpath.ts", | ||
| "cwd": "{workspaceRoot}" | ||
|
Comment on lines
17
to
19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using "options": {
"commands": [
"node scripts/mvnw-runner.mjs -q install -pl apps/openadt-cli -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml",
"bun run scripts/dev-runtime-classpath.ts"
],
"parallel": false,
"cwd": "{workspaceRoot}" |
||
| }, | ||
| "cache": true, | ||
|
|
@@ -26,7 +26,7 @@ | |
| "executor": "nx:run-commands", | ||
| "dependsOn": ["package"], | ||
| "options": { | ||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-cli -am -Pdistribution -Dopenadt.distribution=true -f pom.xml", | ||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-cli -Pdistribution -Dopenadt.distribution=true -f pom.xml", | ||
|
Comment on lines
27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Check if any Maven POMs declare openadt-cli as a dependency
rg -t xml --iglob '**/pom.xml' -C3 '<artifactId>openadt-cli</artifactId>'Repository: abapify/openadt Length of output: 41 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Read the relevant parts of openadt-cli/project.json
echo "---- apps/openadt-cli/project.json (lines 1-120) ----"
nl -ba apps/openadt-cli/project.json | sed -n '1,120p'
# 2) Find comparable project.json files for bootstrap and sap-adt
echo "---- Find project.json under apps/openadt-* ----"
find apps -maxdepth 3 -name project.json | sed -n '1,200p'
# 3) Read relevant sections from bootstrap/sap-adt project.json if present
for f in $(find apps -maxdepth 4 -name project.json | sort); do
if echo "$f" | rg -q 'openadt-(bootstrap|sap-adt)'; then
echo "---- $f (lines 1-160) ----"
nl -ba "$f" | sed -n '1,160p'
fi
done
# 4) Double-check if openadt-cli is referenced in any non-pom config (quick search)
echo "---- Search for openadt-cli references across repo ----"
rg -n --hidden --no-ignore -S "openadt-cli" -g'*.{xml,yml,yaml,json,properties,gradle,kts,sh,mjs,js,pom}' | head -n 200Repository: abapify/openadt Length of output: 174 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- apps/openadt-cli/project.json (lines 1-160) ----"
cat -n apps/openadt-cli/project.json | sed -n '1,160p'
echo "---- Find project.json under apps/openadt-* ----"
find apps -maxdepth 3 -name project.json | sort
for f in $(find apps -maxdepth 4 -name project.json | sort); do
if echo "$f" | rg -q 'openadt-(bootstrap|sap-adt)'; then
echo "---- $f (lines 1-220) ----"
cat -n "$f" | sed -n '1,220p'
fi
done
echo "---- Search for openadt-cli references across repo (limited) ----"
rg -n --hidden --no-ignore -S "openadt-cli" -g'*.{xml,yml,yaml,json,properties,gradle,kts,sh,mjs,js,pom}' | head -n 200Repository: abapify/openadt Length of output: 9113 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- apps/openadt-cli/pom.xml: artifactId/groupId ----"
rg -n --no-heading "<(groupId|artifactId)>" apps/openadt-cli/pom.xml | head -n 80
artifactId="$(rg -n --no-heading "<artifactId>" apps/openadt-cli/pom.xml | head -n 1 | sed -E 's/.*<artifactId>([^<]+)<\/artifactId>.*/\1/' || true)"
echo "Detected artifactId: ${artifactId:-<none>}"
echo "---- Other pom.xml files depending on that artifactId (excluding openadt-cli/pom.xml) ----"
if [ -n "${artifactId}" ]; then
rg -t xml --iglob '**/pom.xml' --glob '!apps/openadt-cli/pom.xml' -n --no-heading "<artifactId>${artifactId}</artifactId>" -C2 || true
fi
echo "---- Check whether any pom references openadt-cli module directory directly ----"
rg -n --no-heading "<module>apps/openadt-cli</module>" -S pom.xml **/pom.xml || trueRepository: abapify/openadt Length of output: 3750 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- apps/openadt-cli/pom.xml (top + dependencies section excerpt) ----"
cat -n apps/openadt-cli/pom.xml | sed -n '1,220p'
echo "---- apps/openadt-cli/pom.xml: dependency coordinates (groupId/artifactId pairs) ----"
rg -n --no-heading "<dependency>" -n apps/openadt-cli/pom.xml >/dev/null || true
python3 - <<'PY'
import re, pathlib
p=pathlib.Path("apps/openadt-cli/pom.xml").read_text()
# crude parse: capture groupId/artifactId inside <dependency> blocks
deps=[]
for m in re.finditer(r"<dependency>\s*(.*?)\s*</dependency>", p, flags=re.S):
block=m.group(1)
gid=re.search(r"<groupId>\s*([^<]+)\s*</groupId>", block)
aid=re.search(r"<artifactId>\s*([^<]+)\s*</artifactId>", block)
scope=re.search(r"<scope>\s*([^<]+)\s*</scope>", block)
if aid:
deps.append((gid.group(1).strip() if gid else None, aid.group(1).strip(), scope.group(1).strip() if scope else None))
print("\n".join([f"{g or ''}:{a} (scope={s or 'none'})" for g,a,s in deps]))
PY
echo "---- Search other module poms for dependency on org.openadt:openadt ----"
rg -t xml --iglob '**/pom.xml' --glob '!apps/openadt-cli/pom.xml' -n "<groupId>org.openadt</groupId>|<artifactId>openadt</artifactId>" -C1
echo "---- Search other module poms for artifactId openadt (quick) ----"
rg -t xml --iglob '**/pom.xml' --glob '!apps/openadt-cli/pom.xml' -n --no-heading "<artifactId>openadt</artifactId>" -C2 || true
echo "---- apps/openadt-cli/pom.xml: test-related plugins ----"
rg -n --no-heading "(maven-surefire-plugin|maven-failsafe-plugin|surefire|failsafe|jacoco|skipTests|testFailure|maven-surefire)" apps/openadt-cli/pom.xml -S || true
echo "---- apps/openadt-cli/pom.xml: shade/assembly configuration ----"
rg -n --no-heading "(maven-shade-plugin|shade|assembly|classifier|repackage|manifest|mainClass|distribution)" apps/openadt-cli/pom.xml -S || trueRepository: abapify/openadt Length of output: 14446 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- Find dependencies on org.openadt:openadt in module poms ----"
rg -t xml --iglob 'apps/*/pom.xml' --glob '!apps/openadt-cli/pom.xml' -n \
"<groupId>org\.openadt</groupId>[\s\S]*?<artifactId>openadt</artifactId>" \
-C2 || true
echo "---- Find any pom dependencies with <artifactId>openadt</artifactId> (show groupId around) ----"
rg -t xml --iglob 'apps/*/pom.xml' -n "<artifactId>openadt</artifactId>" -C3 || true
echo "---- Check if any pom depends on the openadt-cli module artifactId openadt ----"
rg -t xml --iglob '**/pom.xml' --glob '!**/target/**' -n "<artifactId>openadt</artifactId>" -C1 || true
echo "---- Search for openadt-cli as a dependency (module name) ----"
rg -t xml --iglob '**/pom.xml' -n "openadt-cli" -C2 || trueRepository: abapify/openadt Length of output: 1084 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- openadt-cli test sources (files) ----"
find apps/openadt-cli/src/test -type f | head -n 200
echo "---- Search for references to shaded/distribution jar or target paths in openadt-cli tests ----"
rg -n --no-heading "target/|shade|shaded|distribution|openadt.*\\.jar|\\.jar\\b|maven-shade|OpenAdtCommand" apps/openadt-cli/src/test || true
echo "---- openadt-cli surefire/failsafe config in pom.xml ----"
rg -n --no-heading "(maven-surefire-plugin|maven-failsafe-plugin|surefire|failsafe|skipTests|skipITs)" apps/openadt-cli/pom.xml || true
echo "---- Check whether any other module depends on the openadt artifactId openadt (global scan) ----"
rg -t xml --iglob 'apps/*/pom.xml' --glob '!apps/openadt-cli/pom.xml' -n "<artifactId>openadt</artifactId>" -C2 || true
echo "---- Check whether any module depends on org.openadt groupId and artifactId=openadt (global scan) ----"
rg -t xml --iglob 'apps/*/pom.xml' --glob '!apps/openadt-cli/pom.xml' -n "<groupId>org.openadt</groupId>" -C1 | head -n 200Repository: abapify/openadt Length of output: 4147 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate and show mvnw-runner.mjs behavior (args handling)
ls -la scripts/mvnw-runner.mjs || true
sed -n '1,220p' scripts/mvnw-runner.mjs || true
# Also check if any nx target overrides args or wraps -am internally
rg -n "mvnw-runner\.mjs" -S . | head -n 50
# Confirm whether openadt-cli:package has dependsOn and whether openadt-cli:test needs deps
cat -n apps/openadt-cli/project.json | sed -n '1,120p'Repository: abapify/openadt Length of output: 6399 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- package.json scripts ----"
cat -n package.json | sed -n '1,120p'
echo "---- Search CI/workflows for nx test openadt-cli ----"
rg -n "nx\s+test\s+openadt-cli|openadt:test" .github package.json . | head -n 200Repository: abapify/openadt Length of output: 2270 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- Search GitHub workflows for openadt:test or nx test openadt-cli ----"
rg -n "openadt:test|nx\s+test\s+openadt-cli|nx\s+run\s+openadt-cli:test" .github/workflows -S || true
echo "---- Search workflows for openadt-cli compile/package/install targets ----"
rg -n "nx\s+(run\s+)?openadt-cli:(compile|package|test|ensure-dev-jar)|nx\s+(compile|package|test)\s+openadt-cli" .github/workflows -S || true
echo "---- Search workflows for any prior installs of openadt-config/openadt-bootstrap/openadt-sap-adt ----"
rg -n "openadt-(config|bootstrap|sap-adt):" .github/workflows -S || true
echo "---- List workflows ----"
ls -la .github/workflowsRepository: abapify/openadt Length of output: 564 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- .github/workflows/ci.yml ----"
cat -n .github/workflows/ci.yml | sed -n '1,260p'
echo "---- .github/workflows/release.yml ----"
cat -n .github/workflows/release.yml | sed -n '1,260p'Repository: abapify/openadt Length of output: 11644 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- scripts/ci-java-test.sh ----"
cat -n scripts/ci-java-test.sh | sed -n '1,220p'Repository: abapify/openadt Length of output: 883 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- Scan all pom.xml for artifactId openadt (org.openadt module) ----"
rg -t xml --iglob '**/pom.xml' -n "<artifactId>openadt</artifactId>" -C1 || true
echo "---- Scan all pom.xml for groupId org.openadt + artifactId openadt together ----"
rg -t xml --iglob '**/pom.xml' -n "<groupId>org\.openadt</groupId>" -C1 | head -n 200Repository: abapify/openadt Length of output: 3016 Fix
The missing post-test 🤖 Prompt for AI Agents |
||
| "cwd": "{workspaceRoot}" | ||
| }, | ||
| "cache": true, | ||
|
|
@@ -36,7 +36,7 @@ | |
| "package": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-cli -am -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-cli -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Prompt for AI agents |
||
| "cwd": "{workspaceRoot}" | ||
| }, | ||
| "cache": true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ | |||||
| "compile": { | ||||||
| "executor": "nx:run-commands", | ||||||
| "options": { | ||||||
| "command": "node scripts/mvnw-runner.mjs -q compile -pl apps/openadt-config -f pom.xml", | ||||||
| "command": "node scripts/mvnw-runner.mjs -q install -N -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml && node scripts/mvnw-runner.mjs -q install -pl apps/openadt-config -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||||||
| "cwd": "{workspaceRoot}" | ||||||
|
Comment on lines
12
to
14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using "options": {
"commands": [
"node scripts/mvnw-runner.mjs -q install -N -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml",
"node scripts/mvnw-runner.mjs -q install -pl apps/openadt-config -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml"
],
"parallel": false,
"cwd": "{workspaceRoot}" |
||||||
| }, | ||||||
| "cache": true, | ||||||
|
|
@@ -21,7 +21,7 @@ | |||||
| "executor": "nx:run-commands", | ||||||
| "dependsOn": ["compile"], | ||||||
| "options": { | ||||||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-config -f pom.xml", | ||||||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-config -Pdistribution -Dopenadt.distribution=true -f pom.xml && node scripts/mvnw-runner.mjs -q install -pl apps/openadt-config -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ LOW RISK Suggestion: This second Maven invocation is redundant. The 'compile' target already populates the local repository with the required artifacts. Removing this step reduces build overhead.
Suggested change
|
||||||
| "cwd": "{workspaceRoot}" | ||||||
|
Comment on lines
23
to
25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using "options": {
"commands": [
"node scripts/mvnw-runner.mjs -q test -pl apps/openadt-config -Pdistribution -Dopenadt.distribution=true -f pom.xml",
"node scripts/mvnw-runner.mjs -q install -pl apps/openadt-config -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml"
],
"parallel": false,
"cwd": "{workspaceRoot}" |
||||||
| }, | ||||||
| "cache": true, | ||||||
|
|
@@ -32,7 +32,7 @@ | |||||
| "executor": "nx:run-commands", | ||||||
| "dependsOn": ["compile"], | ||||||
| "options": { | ||||||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-config -DskipTests -f pom.xml", | ||||||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-config -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||||||
| "cwd": "{workspaceRoot}" | ||||||
| }, | ||||||
| "cache": true, | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |||||
| "executor": "nx:run-commands", | ||||||
| "dependsOn": ["openadt-config:compile"], | ||||||
| "options": { | ||||||
| "command": "node scripts/mvnw-runner.mjs -q compile -pl apps/openadt-sap-adt -am -f pom.xml", | ||||||
| "command": "node scripts/mvnw-runner.mjs -q install -pl apps/openadt-sap-adt -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||||||
| "cwd": "{workspaceRoot}" | ||||||
| }, | ||||||
| "cache": true, | ||||||
|
|
@@ -22,7 +22,7 @@ | |||||
| "executor": "nx:run-commands", | ||||||
| "dependsOn": ["compile"], | ||||||
| "options": { | ||||||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-sap-adt -am -f pom.xml", | ||||||
| "command": "node scripts/mvnw-runner.mjs -q test -pl apps/openadt-sap-adt -Pdistribution -Dopenadt.distribution=true -f pom.xml && node scripts/mvnw-runner.mjs install -pl apps/openadt-sap-adt -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ LOW RISK Suggestion: The second Maven invocation is redundant. The artifact is already installed in the local repository during the 'compile' phase. Removing this call speeds up the test execution.
Suggested change
|
||||||
| "cwd": "{workspaceRoot}" | ||||||
|
Comment on lines
24
to
26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using "options": {
"commands": [
"node scripts/mvnw-runner.mjs -q test -pl apps/openadt-sap-adt -Pdistribution -Dopenadt.distribution=true -f pom.xml",
"node scripts/mvnw-runner.mjs -q install -pl apps/openadt-sap-adt -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml"
],
"parallel": false,
"cwd": "{workspaceRoot}" |
||||||
| }, | ||||||
| "cache": true, | ||||||
|
|
@@ -33,7 +33,7 @@ | |||||
| "executor": "nx:run-commands", | ||||||
| "dependsOn": ["compile", "openadt-config:package"], | ||||||
| "options": { | ||||||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-sap-adt -am -DskipTests -f pom.xml", | ||||||
| "command": "node scripts/mvnw-runner.mjs -q package -pl apps/openadt-sap-adt -Pdistribution -Dopenadt.distribution=true -DskipTests -f pom.xml", | ||||||
| "cwd": "{workspaceRoot}" | ||||||
| }, | ||||||
| "cache": true, | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -88,6 +88,15 @@ | |||||||||||||||
|
|
||||||||||||||||
| public String webAdapterStatus(String profileId) throws IOException, InterruptedException { | ||||||||||||||||
| String encodedProfileId = URLEncoder.encode(profileId, StandardCharsets.UTF_8); | ||||||||||||||||
| // Try API v3 first (Windows), fall back to v2 (macOS) | ||||||||||||||||
| try { | ||||||||||||||||
| return webAdapterStatusV3(encodedProfileId); | ||||||||||||||||
| } catch (IOException e) { | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Fallback from v3 to v2 catches all IOExceptions, masking genuine v3 errors (auth failures, server errors) by making a second request to v2 Prompt for AI agents |
||||||||||||||||
| return webAdapterStatusV2(encodedProfileId); | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Preserve the original v3 IOException when falling back to v2. If v2 also fails, this currently drops the initial v3 failure context, making root-cause diagnosis harder. Prompt for AI agents
Suggested change
|
||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
89
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve v3 error context when falling back to v2. When v3 fails with Additionally, the broad 🔍 Suggested improvement: Add suppressed exception and logging public String webAdapterStatus(String profileId) throws IOException, InterruptedException {
String encodedProfileId = URLEncoder.encode(profileId, StandardCharsets.UTF_8);
// Try API v3 first (Windows), fall back to v2 (macOS)
try {
return webAdapterStatusV3(encodedProfileId);
} catch (IOException e) {
+ CliLog.info("Secure Login hub API v3 status failed (" + e.getMessage() + "), trying v2 fallback");
+ try {
return webAdapterStatusV2(encodedProfileId);
+ } catch (IOException v2Error) {
+ v2Error.addSuppressed(e);
+ throw v2Error;
+ }
}
}This preserves the v3 error as a suppressed exception and logs the fallback attempt. Apply the same pattern to Note: The same issue and fix apply to the 🤖 Prompt for AI Agents🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Search for tests covering the v2 fallback behavior
# Search for test methods that might cover v2 fallback
rg -n -C5 'slc2/api/(status|login)' --type=java --glob='*Test.java'
# Search for test assertions that check fallback behavior
rg -n -C3 '(webAdapterStatus|loginWebAdapter).*fallback|v2.*fallback|IOException.*v2' --type=java --glob='*Test.java'Repository: abapify/openadt Length of output: 41 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate the main test class for SecureLoginHubClient
fd -i 'SecureLoginHubClientTest.java' -a . || true
fd -i 'SecureLoginHubClient*Test.java' -a . || true
# Find direct references/usages of v2 fallback helpers in tests
rg -n --glob='*Test.java' 'webAdapterStatusV2|loginWebAdapterV2|webAdapterStatusV3|loginWebAdapterV3' . || true
# Search for any stubbing/mocking of slc2/api endpoints for v2 specifically
rg -n --glob='*Test.java' 'slc2/api' . || true
rg -n --glob='*Test.java' 'slc2/api/.*(v2|_v2|version.?2)' . || true
# Search for fallback-related assertions/flow in tests
rg -n --glob='*Test.java' '(fallback|v3 fails|v2 succeeds|catch \(IOException|IOException.*v2)' . || true
# Narrow search to the secure login hub client test files (if present)
TESTS="$(fd -i 'SecureLoginHubClient*Test.java' . -a || true)"
if [ -n "$TESTS" ]; then
rg -n --glob='*Test.java' 'webAdapterStatus|loginWebAdapter' $TESTS || true
fiRepository: abapify/openadt Length of output: 2652 🏁 Script executed: #!/bin/bash
set -euo pipefail
TEST_FILE="apps/openadt-sap-adt/src/test/java/org/openadt/sap/adt/bootstrap/SecureLoginHubClientTest.java"
# Show key parts around the existing assertions
nl -ba "$TEST_FILE" | sed -n '1,220p'
# Targeted searches inside the test file for v2/v3/fallback hints
echo "---- rg v2/v3/fallback in SecureLoginHubClientTest.java ----"
rg -n --glob='*.java' '(webAdapterStatusV[23]|loginWebAdapterV[23]|fallback|v3|v2|slc2/api|/v2|/v3|statusV[23])' "$TEST_FILE" || true
echo "---- Search within the test file for IOException-driven fallback patterns ----"
rg -n --glob='*.java' '(catch\s*\(\s*IOException|throws\s*IOException|IOException)' "$TEST_FILE" || true
# Also find any helper test client setup that might indicate endpoint versions
rg -n --glob='*.java' '(mock|stub|wireMock|server|endpoint|url|baseUrl|host|scheme)' "$TEST_FILE" || trueRepository: abapify/openadt Length of output: 102 🏁 Script executed: #!/bin/bash
set -euo pipefail
TEST_FILE="apps/openadt-sap-adt/src/test/java/org/openadt/sap/adt/bootstrap/SecureLoginHubClientTest.java"
# Show key parts around the existing assertions using cat -n
sed -n '1,220p' "$TEST_FILE" | cat -n
echo "---- rg v2/v3/fallback hints in SecureLoginHubClientTest.java ----"
rg -n --glob='*.java' '(webAdapterStatusV[23]|loginWebAdapterV[23]|fallback|v3|v2|slc2/api|/v2|/v3|statusV[23])' "$TEST_FILE" || true
echo "---- Search within the test file for IOException-driven fallback patterns ----"
rg -n --glob='*.java' '(catch\s*\(\s*IOException|throws\s*IOException|IOException)' "$TEST_FILE" || true
echo "---- Search within the test file for mocking/endpoint/version hints ----"
rg -n --glob='*.java' '(mock|stub|wireMock|server|endpoint|url|baseUrl|host|scheme)' "$TEST_FILE" || trueRepository: abapify/openadt Length of output: 9940 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Search all test sources for v2 (slc2) endpoint usage and fallback mentions
rg -n --glob='*Test.java' 'slc2/api/(status|login)' . || true
rg -n --glob='*Test.java' '(webAdapterStatusV2|loginWebAdapterV2|webAdapterStatusV3|loginWebAdapterV3)' . || true
rg -n --glob='*Test.java' '(webAdapterStatus|loginWebAdapter).*catch\s*\(IOException|fallback|v2|slc2)' . || trueRepository: abapify/openadt Length of output: 260 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Search all test sources for v2 (slc2) endpoint usage
rg -n --glob='*Test.java' 'slc2/api/(status|login)' . || true
# Search all test sources for explicit v2/v3 helper method names
rg -n --glob='*Test.java' '(webAdapterStatusV[23]|loginWebAdapterV[23])' . || true
# Search for fallback wording and IOException patterns without problematic regex
rg -n --glob='*Test.java' 'fallback' . || true
rg -n --glob='*Test.java' 'IOException' . || true
rg -n --glob='*Test.java' 'v2' . || true
rg -n --glob='*Test.java' 'v3' . || trueRepository: abapify/openadt Length of output: 10077 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Search for v2 endpoint paths (secure login hub v2)
rg -n --glob='*Test.java' '/slc2/api/(status|login)' . || true
# Search for v3 endpoint paths (already seen /slc3/api/status in SecureLoginHubClientTest)
rg -n --glob='*Test.java' '/slc3/api/(status|login)' . || true
# Search for direct references to the v2 helper method names
rg -n --glob='*Test.java' 'webAdapterStatusV2|loginWebAdapterV2' . || true
# Search for try/catch patterns mentioning v3->v2 fallback in tests
rg -n --glob='*Test.java' 'webAdapterStatusV3.*catch|loginWebAdapterV3.*catch|fallback to v2|fall back to v2|v2 \\(macOS\\)' . || trueRepository: abapify/openadt Length of output: 211 Add test coverage for SecureLoginHubClient’s v3→v2 fallback paths
Also applies to: 131-138 🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| private String webAdapterStatusV3(String encodedProfileId) throws IOException, InterruptedException { | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Code Duplication |
||||||||||||||||
| URI uri = URI.create(hubBaseUrl + "/slc3/api/status?profileid=" + encodedProfileId); | ||||||||||||||||
| HttpResponse<String> response = httpClient.send( | ||||||||||||||||
| hubRequest(uri).GET().build(), | ||||||||||||||||
|
|
@@ -98,14 +107,37 @@ | |||||||||||||||
| } | ||||||||||||||||
| JsonNode root = objectMapper.readTree(response.body()); | ||||||||||||||||
| JsonNode status = root.path("status"); | ||||||||||||||||
| return status.isTextual() ? status.asText() : "UNKNOWN"; | ||||||||||||||||
|
Check failure on line 110 in apps/openadt-sap-adt/src/main/java/org/openadt/sap/adt/bootstrap/SecureLoginHubClient.java
|
||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| private String webAdapterStatusV2(String encodedProfileId) throws IOException, InterruptedException { | ||||||||||||||||
| URI uri = URI.create(hubBaseUrl + "/slc2/api/status?profileid=" + encodedProfileId); | ||||||||||||||||
| HttpResponse<String> response = httpClient.send( | ||||||||||||||||
| hubRequest(uri).GET().build(), | ||||||||||||||||
| HttpResponse.BodyHandlers.ofString() | ||||||||||||||||
| ); | ||||||||||||||||
| if (response.statusCode() != 200) { | ||||||||||||||||
| throw new IOException("Secure Login hub v2 status failed with HTTP " + response.statusCode()); | ||||||||||||||||
| } | ||||||||||||||||
| JsonNode root = objectMapper.readTree(response.body()); | ||||||||||||||||
| JsonNode status = root.path("status"); | ||||||||||||||||
| return status.isTextual() ? status.asText() : "UNKNOWN"; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| public void loginWebAdapter(String profileId) throws IOException, InterruptedException { | ||||||||||||||||
| loginWebAdapter(profileId, false); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| public void loginWebAdapter(String profileId, boolean browserMonitor) throws IOException, InterruptedException { | ||||||||||||||||
| // Try API v3 first (Windows), fall back to v2 (macOS) | ||||||||||||||||
| try { | ||||||||||||||||
| loginWebAdapterV3(profileId, browserMonitor); | ||||||||||||||||
| } catch (IOException e) { | ||||||||||||||||
| loginWebAdapterV2(profileId, browserMonitor); | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Retain the original v3 IOException in the login fallback path. When the v2 call also throws, the initial v3 failure should be attached (for example as a suppressed exception) so error reporting keeps full context. Prompt for AI agents
Suggested change
|
||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| private void loginWebAdapterV3(String profileId, boolean browserMonitor) throws IOException, InterruptedException { | ||||||||||||||||
| URI uri = URI.create(hubBaseUrl + "/slc3/api/login"); | ||||||||||||||||
| java.util.Map<String, Object> clientConfig = new java.util.LinkedHashMap<>(); | ||||||||||||||||
| clientConfig.put("browserMonitor", browserMonitor); | ||||||||||||||||
|
|
@@ -130,6 +162,31 @@ | |||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| private void loginWebAdapterV2(String profileId, boolean browserMonitor) throws IOException, InterruptedException { | ||||||||||||||||
| URI uri = URI.create(hubBaseUrl + "/slc2/api/login"); | ||||||||||||||||
| java.util.Map<String, Object> clientConfig = new java.util.LinkedHashMap<>(); | ||||||||||||||||
| clientConfig.put("browserMonitor", browserMonitor); | ||||||||||||||||
| clientConfig.put("inactivityTimeout", 0); | ||||||||||||||||
| clientConfig.put("keySize", 2048); | ||||||||||||||||
| clientConfig.put("profileSLWA", profileId); | ||||||||||||||||
| clientConfig.put("localport", 34443); | ||||||||||||||||
| clientConfig.put("autoLogOut", false); | ||||||||||||||||
| java.util.Map<String, Object> payload = new java.util.LinkedHashMap<>(); | ||||||||||||||||
| payload.put("profileid", profileId); | ||||||||||||||||
| payload.put("clientConfig", clientConfig); | ||||||||||||||||
| String body = objectMapper.writeValueAsString(payload); | ||||||||||||||||
| HttpResponse<String> response = httpClient.send( | ||||||||||||||||
| hubRequest(uri) | ||||||||||||||||
| .header("Content-Type", "application/json") | ||||||||||||||||
| .POST(HttpRequest.BodyPublishers.ofString(body)) | ||||||||||||||||
| .build(), | ||||||||||||||||
| HttpResponse.BodyHandlers.ofString() | ||||||||||||||||
| ); | ||||||||||||||||
| if (response.statusCode() < 200 || response.statusCode() >= 300) { | ||||||||||||||||
| throw new IOException("Secure Login hub v2 login failed with HTTP " + response.statusCode()); | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| public void ensureWebAdapterLoggedIn(String profileId) throws IOException, InterruptedException { | ||||||||||||||||
| ensureWebAdapterLoggedIn(profileId, false); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ LOW RISK
Suggestion: The second Maven invocation (
install) is redundant because the 'compile' target already ensures the artifact is installed in the local repository. Removing it optimizes the build cycle.