Skip to content

Unilogin error - #189

Merged
Zenzus merged 5 commits into
masterfrom
unilogin-error
Jul 7, 2026
Merged

Zenzus merged 5 commits into
masterfrom
unilogin-error

Conversation

@Acto-review

@Acto-review Acto-review commented Jul 6, 2026 •

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Support issuing JWTs even when no institutions are available for compatible employee users.
    • Added structured flow tracing across institution resolution, JWT issuance, and logout.
  • Bug Fixes
    • Improved institution resolution with deduplication and safer fallback handling.
    • Enhanced role mapping (including employee compatibility) and improved Find2Learn role fallback.
    • Logout now uses an id_token hint when available; improved cache-miss handling and HTTPS cookie security.
  • Tests
    • Added unit tests for role/institution mapping and flow-tracing helpers.
  • Chores
    • Updated WSDL/XSD assets and build downloads to avoid unnecessary re-fetching.

Jonas Hein added 2 commits January 14, 2026 12:12
Introduce detailed logging for the UniLogin authentication process, providing better visibility into the flow and failure points.
Implement institution deduplication and a fallback mechanism for employee roles, ensuring users without explicit institution affiliations can still authenticate successfully. This addresses inconsistencies in UniLogin's UserInfo and SOAP responses.
```
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds UniLogin tracing, session-based logout handling, employee-compatible JWT issuance without institutions, JSON alias support for incoming UniLogin payloads, and new SOAP WSDL resources with build and controller updates.

Changes

UniLogin flow trace, role handling, and SOAP contract updates

Layer / File(s) Summary
Trace helper utility
sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTrace.java, sso/src/test/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTraceTest.java
Adds structured trace helpers for session ids, token prefixes, uniid storage, and institution id extraction, with tests for the helper methods.
JSON alias mappings
sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/InstitutionTilknytning.java, sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/UserInfoResponse.java
Extends Jackson mappings so alternate incoming JSON property names resolve onto the existing institution fields.
Callback institution resolution
sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java
Stores the OIDC id_token in session, logs introspection and uniid handling, resolves institutions from UserInfo with SOAP fallback and deduplication, and adds the no-institution employee-compatible branch.
Employee-compatible JWT issuance
sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java
Adds direct JWT issuance without an institution, tightens institution name lookup, rewrites role-source selection, updates logout redirects to use id_token_hint, and extends cache retrieval with session-aware tracing.
Role parsing and dedup helpers
sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java, sso/src/test/java/dk/acto/fafnir/sso/provider/UniLoginRoleMappingTest.java
Normalizes role parsing, adds MEDARBEJDER handling, introduces employee-compatibility helpers and institution deduplication logic, and covers the role and dedup cases with unit tests.
Controller org selection and logout
sso/src/main/java/dk/acto/fafnir/sso/service/controller/UniLoginController.java
Adds trace logging to org selection and post-org handling, enables direct JWT issuance when no institutions exist, changes logout cookie security based on FAFNIR_URL, and refactors logout completion to track token source and use the new cache lookup.
SOAP resources and download wiring
.gitignore, sso/build.gradle.kts, sso/src/main/resources/wsdl/*
Removes WSDL ignore rules, guards WSDL download tasks when files already exist, and adds full WsiBruger and WsiInst WSDL contracts with their messages, bindings, services, and endpoints.

Estimated code review effort: 4 (Complex) | ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague and does not describe the main changes in the PR. Rename it to a specific summary such as 'Improve UniLogin SSO flow, logout handling, and WSDL schema support.'
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch unilogin-error

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java (1)

381-420: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return a failure result here instead of throwing
sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java:409-418 — UniLoginController.postOrg() calls this directly, and there’s no controller exception handler here, so a missing institution name becomes a 500 instead of the normal failure redirect. Return AuthenticationResult.failure(...) here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java` around
lines 381 - 420, In callbackWithInstitution on UniLoginProvider, replace the
RuntimeException paths for missing institution name/UserInfo with an
AuthenticationResult.failure(...) return so UniLoginController.postOrg() can
follow the normal failure redirect instead of surfacing a 500. Keep the existing
lookup flow (parameter, UserInfoResponse from session, then
getInstitutionFromId), but when the institution cannot be resolved, return a
failure result with the same error context rather than throwing.
🧹 Nitpick comments (2)
sso/src/test/java/dk/acto/fafnir/sso/provider/UniLoginRoleMappingTest.java (1)

28-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant test cases.

ensureEmployeeLoginRole_addsFallbackWhenRolesEmptyAndAktorgruppeMedarbejder (lines 28-33) and fixA_emptyRolesWithMedarbejderAktorgruppe_yieldsCompatibleEmployeeRole (lines 105-110) exercise the identical input (empty roles, "Medarbejder" aktorgruppe) and both assert the presence of Medarbejder@EMPLOYEE. Consider merging the hasFind2LearnCompatibleEmployeeRole assertion into the first test and removing the duplicate, and giving it a descriptive name instead of the "fixA" placeholder.

♻️ Suggested consolidation
     `@Test`
     void ensureEmployeeLoginRole_addsFallbackWhenRolesEmptyAndAktorgruppeMedarbejder() {
         Set<UserRole> result = UniLoginProvider.ensureEmployeeLoginRole(Set.of(), "Medarbejder");

         assertThat(roleStrings(result)).containsExactly("Medarbejder@EMPLOYEE");
+        assertThat(UniLoginProvider.hasFind2LearnCompatibleEmployeeRole(result)).isTrue();
     }

And remove the fixA_... test entirely.

Also applies to: 105-110

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sso/src/test/java/dk/acto/fafnir/sso/provider/UniLoginRoleMappingTest.java`
around lines 28 - 33, The two tests in UniLoginRoleMappingTest cover the same
empty-roles plus "Medarbejder" scenario, so consolidate the assertions into
ensureEmployeeLoginRole_addsFallbackWhenRolesEmptyAndAktorgruppeMedarbejder and
remove the duplicate
fixA_emptyRolesWithMedarbejderAktorgruppe_yieldsCompatibleEmployeeRole test. If
needed, keep the compatibility assertion in the remaining test and rename it to
a descriptive, non-placeholder name so the intent is clear.
sso/src/test/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTraceTest.java (1)

9-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for rememberUniid/uniidFromSession round-trip and log().

Existing tests cover the pure helpers well but skip the session-mutating helpers (rememberUniid + uniidFromSession) and log() itself, both of which are central to this PR's debugging goal.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@sso/src/test/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTraceTest.java`
around lines 9 - 44, Add tests for the session-based helpers and logging path in
UniLoginFlowTraceTest: cover the rememberUniid/uniidFromSession round-trip by
storing a uniid in a session and asserting it can be read back, and add a log()
test that exercises the trace output using the existing UniLoginFlowTrace
methods. Use the unique symbols rememberUniid, uniidFromSession, and log() to
locate the implementation, and verify the behavior with a real or mocked session
as appropriate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTrace.java`:
- Around line 40-64: Sanitize the UniLogin trace output in UniLoginFlowTrace.log
before emitting it to log.info. The current message builder writes uniid,
aktoer_gruppe, and all extra map entries directly, so update log() to escape or
strip control characters and apply redaction/truncation for identity-like
fields, using the existing sessionId()/tokenPrefix() style as a guide. Make sure
every value appended in UniLoginFlowTrace.log is normalized before concatenation
so externally derived data cannot forge log lines or expose raw identifiers.

In `@sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java`:
- Around line 1036-1071: The single-item fast path in deduplicateInstitutions
returns the lone Institution without validating its id, so a null or blank id
can still flow into callbackWithInstitution() and later fail in the role lookup
path. Update deduplicateInstitutions in UniLoginProvider to apply the same
invalid-id filtering before returning a size-1 list, so only institutions with a
non-null, non-blank id are preserved and returned.

In
`@sso/src/main/java/dk/acto/fafnir/sso/service/controller/UniLoginController.java`:
- Around line 166-172: The logout handling in UniLoginController does not
actually clear the fafnir_logout_token cookie, only the session attribute
logout_token. Update the comment to match the real behavior, or if you want true
cookie clearing, add an HttpServletResponse parameter and expire the cookie
there before calling provider.retrieveJwtFromCache(token, uniid, session). Keep
the one-time token cache removal behavior unchanged.

---

Outside diff comments:
In `@sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java`:
- Around line 381-420: In callbackWithInstitution on UniLoginProvider, replace
the RuntimeException paths for missing institution name/UserInfo with an
AuthenticationResult.failure(...) return so UniLoginController.postOrg() can
follow the normal failure redirect instead of surfacing a 500. Keep the existing
lookup flow (parameter, UserInfoResponse from session, then
getInstitutionFromId), but when the institution cannot be resolved, return a
failure result with the same error context rather than throwing.

---

Nitpick comments:
In
`@sso/src/test/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTraceTest.java`:
- Around line 9-44: Add tests for the session-based helpers and logging path in
UniLoginFlowTraceTest: cover the rememberUniid/uniidFromSession round-trip by
storing a uniid in a session and asserting it can be read back, and add a log()
test that exercises the trace output using the existing UniLoginFlowTrace
methods. Use the unique symbols rememberUniid, uniidFromSession, and log() to
locate the implementation, and verify the behavior with a real or mocked session
as appropriate.

In `@sso/src/test/java/dk/acto/fafnir/sso/provider/UniLoginRoleMappingTest.java`:
- Around line 28-33: The two tests in UniLoginRoleMappingTest cover the same
empty-roles plus "Medarbejder" scenario, so consolidate the assertions into
ensureEmployeeLoginRole_addsFallbackWhenRolesEmptyAndAktorgruppeMedarbejder and
remove the duplicate
fixA_emptyRolesWithMedarbejderAktorgruppe_yieldsCompatibleEmployeeRole test. If
needed, keep the compatibility assertion in the remaining test and rename it to
a descriptive, non-placeholder name so the intent is clear.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e52a5e0-236a-4662-882a-f42db4d96bdd

📥 Commits

Reviewing files that changed from the base of the PR and between 4d35801 and 900d080.

📒 Files selected for processing (7)
  • sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java
  • sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/InstitutionTilknytning.java
  • sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTrace.java
  • sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/UserInfoResponse.java
  • sso/src/main/java/dk/acto/fafnir/sso/service/controller/UniLoginController.java
  • sso/src/test/java/dk/acto/fafnir/sso/provider/UniLoginRoleMappingTest.java
  • sso/src/test/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTraceTest.java

Comment on lines +40 to +64
public static void log(String step, Branch branch, String uniid, HttpSession session, Map<String, Object> extra) {
StringBuilder message = new StringBuilder("UniLogin trace: step=")
.append(step)
.append(" branch=")
.append(branch)
.append(" uniid=")
.append(uniid != null ? uniid : "-")
.append(" session=")
.append(sessionId(session));

if (session != null) {
Object aktoerGruppe = session.getAttribute("aktoer_gruppe");
if (aktoerGruppe != null) {
message.append(" aktoer_gruppe=").append(aktoerGruppe);
}
}

if (extra != null) {
for (Map.Entry<String, Object> entry : extra.entrySet()) {
message.append(' ').append(entry.getKey()).append('=').append(entry.getValue());
}
}

log.info(message.toString());
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Sanitize/redact identity fields before writing to the trace log.

log() concatenates uniid, aktoer_gruppe, and all extra values directly into a single string with no escaping. Two concerns:

  • Log forging (CWE-117): if any of these externally-derived values (uniid, institution names/ids from UniLogin) contain \r/\n, an attacker-influenced value could inject forged log lines.
  • This helper is now the central logging point wired into essentially every step of the UniLogin flow (per the stack context), so it persistently logs the user identifier (uniid) and aktoer_gruppe at INFO level across many call sites, expanding the surface area for exposing a personal identifier in logs.

Consider stripping/escaping control characters and truncating/pseudonymizing uniid similar to how sessionId()/tokenPrefix() already truncate session ids and tokens.

🔒 Suggested sanitization
     public static void log(String step, Branch branch, String uniid, HttpSession session, Map<String, Object> extra) {
+        String safeUniid = sanitize(uniid);
         StringBuilder message = new StringBuilder("UniLogin trace: step=")
             .append(step)
             .append(" branch=")
             .append(branch)
             .append(" uniid=")
-            .append(uniid != null ? uniid : "-")
+            .append(safeUniid)
             .append(" session=")
             .append(sessionId(session));

         if (session != null) {
             Object aktoerGruppe = session.getAttribute("aktoer_gruppe");
             if (aktoerGruppe != null) {
-                message.append(" aktoer_gruppe=").append(aktoerGruppe);
+                message.append(" aktoer_gruppe=").append(sanitize(aktoerGruppe.toString()));
             }
         }

         if (extra != null) {
             for (Map.Entry<String, Object> entry : extra.entrySet()) {
-                message.append(' ').append(entry.getKey()).append('=').append(entry.getValue());
+                message.append(' ').append(entry.getKey()).append('=')
+                    .append(sanitize(String.valueOf(entry.getValue())));
             }
         }

         log.info(message.toString());
     }
+
+    private static String sanitize(String value) {
+        if (value == null) {
+            return "-";
+        }
+        return value.replaceAll("[\\r\\n]", "_");
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static void log(String step, Branch branch, String uniid, HttpSession session, Map<String, Object> extra) {
StringBuilder message = new StringBuilder("UniLogin trace: step=")
.append(step)
.append(" branch=")
.append(branch)
.append(" uniid=")
.append(uniid != null ? uniid : "-")
.append(" session=")
.append(sessionId(session));
if (session != null) {
Object aktoerGruppe = session.getAttribute("aktoer_gruppe");
if (aktoerGruppe != null) {
message.append(" aktoer_gruppe=").append(aktoerGruppe);
}
}
if (extra != null) {
for (Map.Entry<String, Object> entry : extra.entrySet()) {
message.append(' ').append(entry.getKey()).append('=').append(entry.getValue());
}
}
log.info(message.toString());
}
public static void log(String step, Branch branch, String uniid, HttpSession session, Map<String, Object> extra) {
String safeUniid = sanitize(uniid);
StringBuilder message = new StringBuilder("UniLogin trace: step=")
.append(step)
.append(" branch=")
.append(branch)
.append(" uniid=")
.append(safeUniid)
.append(" session=")
.append(sessionId(session));
if (session != null) {
Object aktoerGruppe = session.getAttribute("aktoer_gruppe");
if (aktoerGruppe != null) {
message.append(" aktoer_gruppe=").append(sanitize(aktoerGruppe.toString()));
}
}
if (extra != null) {
for (Map.Entry<String, Object> entry : extra.entrySet()) {
message.append(' ').append(entry.getKey()).append('=')
.append(sanitize(String.valueOf(entry.getValue())));
}
}
log.info(message.toString());
}
private static String sanitize(String value) {
if (value == null) {
return "-";
}
return value.replaceAll("[\\r\\n]", "_");
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@sso/src/main/java/dk/acto/fafnir/sso/provider/unilogin/UniLoginFlowTrace.java`
around lines 40 - 64, Sanitize the UniLogin trace output in
UniLoginFlowTrace.log before emitting it to log.info. The current message
builder writes uniid, aktoer_gruppe, and all extra map entries directly, so
update log() to escape or strip control characters and apply
redaction/truncation for identity-like fields, using the existing
sessionId()/tokenPrefix() style as a guide. Make sure every value appended in
UniLoginFlowTrace.log is normalized before concatenation so externally derived
data cannot forge log lines or expose raw identifiers.

Comment thread sso/src/main/java/dk/acto/fafnir/sso/provider/UniLoginProvider.java
Comment on lines 166 to +172
// Clear the token from session and cookie
if (session != null) {
session.removeAttribute("logout_token");
}

// Retrieve the JWT from cache using one-time token
String jwt = provider.retrieveJwtFromCache(token);
String jwt = provider.retrieveJwtFromCache(token, uniid, session);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Cookie is not cleared despite the comment. The comment states the token is cleared "from session and cookie", but only session.removeAttribute("logout_token") runs — the fafnir_logout_token cookie is never expired and lingers in the browser for its 5‑minute maxAge. Since this handler has no HttpServletResponse to overwrite the cookie, either correct the comment or add a response param to expire it. Note the one-time token is also removed from cache during retrieveJwtFromCache, so any retry with the stale cookie will fail regardless.

✏️ Minimal fix: align the comment with actual behavior
-        // Clear the token from session and cookie
+        // Clear the token from session (the one-time token is also removed from cache below,
+        // so the backup cookie becomes inert even though it is not explicitly expired here)
         if (session != null) {
             session.removeAttribute("logout_token");
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Clear the token from session and cookie
if (session != null) {
session.removeAttribute("logout_token");
}
// Retrieve the JWT from cache using one-time token
String jwt = provider.retrieveJwtFromCache(token);
String jwt = provider.retrieveJwtFromCache(token, uniid, session);
// Clear the token from session (the one-time token is also removed from cache below,
// so the backup cookie becomes inert even though it is not explicitly expired here)
if (session != null) {
session.removeAttribute("logout_token");
}
// Retrieve the JWT from cache using one-time token
String jwt = provider.retrieveJwtFromCache(token, uniid, session);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@sso/src/main/java/dk/acto/fafnir/sso/service/controller/UniLoginController.java`
around lines 166 - 172, The logout handling in UniLoginController does not
actually clear the fafnir_logout_token cookie, only the session attribute
logout_token. Update the comment to match the real behavior, or if you want true
cookie clearing, add an HttpServletResponse parameter and expire the cookie
there before calling provider.retrieveJwtFromCache(token, uniid, session). Keep
the one-time token cache removal behavior unchanged.

Jonas Hein added 2 commits July 6, 2026 16:03
Removes a bypass that allowed a list with a single institution to be returned without ID validation. This ensures institutions with null or blank IDs are always filtered, regardless of list size.
Embeds WSDL definitions for WsiBruger and WsiInst services directly into the repository.
This ensures consistent and reproducible builds, reducing reliance on external WSDL endpoints and enabling offline compilation. The build script now only downloads WSDLs if they are not already present.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sso/src/main/resources/wsdl/wsibruger_v6.wsdl`:
- Around line 5-7: The WSDL still depends on remote UniLogin XSDs via external
schemaLocation URLs, so vendor those schemas locally and update
wsibruger_v6.wsdl to reference classpath-relative resources instead. Make the
change in the WSDL imports used by UniLoginProvider and WsiBruger so startup no
longer relies on network access; if needed, add an XML catalog to resolve the
imported namespaces to the local XSDs.

In `@sso/src/main/resources/wsdl/wsiinst_v5.wsdl`:
- Around line 5-7: The WsiInst WSDL still imports XSDs from live UniLogin URLs,
which leaves service construction dependent on network availability. Update the
imports in wsiinst_v5.wsdl to resolve locally by vendoring the referenced
schemas and switching schemaLocation to relative local paths, or wire in an XML
catalog so new WsiInst(wsdlURL, SERVICE) can resolve ws-common.xsd and
wsiinst-ws.xsd offline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 030fdc12-275e-49a8-86c4-36b807e24588

📥 Commits

Reviewing files that changed from the base of the PR and between 1fb9261 and ec163ba.

📒 Files selected for processing (4)
  • .gitignore
  • sso/build.gradle.kts
  • sso/src/main/resources/wsdl/wsibruger_v6.wsdl
  • sso/src/main/resources/wsdl/wsiinst_v5.wsdl
💤 Files with no reviewable changes (1)
  • .gitignore

Comment thread sso/src/main/resources/wsdl/wsibruger_v6.wsdl Outdated
Comment thread sso/src/main/resources/wsdl/wsiinst_v5.wsdl Outdated
Embeds referenced XSD files for WsiBruger and WsiInst services directly into the repository.
The WSDL definitions are updated to reference these local schema files instead of external URLs.
This completes the vendoring of UniLogin service definitions, further enhancing build consistency and resilience against external service changes or network issues affecting schema endpoints.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sso/build.gradle.kts`:
- Around line 163-165: The genWsiInst task is missing the
downloadXsdSchemaCommon dependency, so its Wsdl2Java inputs can be incomplete
when run standalone. Update the genWsiInst task configuration in
build.gradle.kts to include downloadXsdSchemaCommon alongside the existing
downloadXsdWsCommon, downloadXsdWsiInst, and downloadXsdWsiinstSchema
dependencies. Use genWsiBruger as the reference pattern for how the transitive
schema dependency should be declared.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48a7ca12-a8fe-4d54-afcd-70294c062fdf

📥 Commits

Reviewing files that changed from the base of the PR and between ec163ba and d0fabd4.

📒 Files selected for processing (9)
  • sso/build.gradle.kts
  • sso/src/main/resources/wsdl/common/schema-common.xsd
  • sso/src/main/resources/wsdl/common/ws-common.xsd
  • sso/src/main/resources/wsdl/wsibruger-schema.xsd
  • sso/src/main/resources/wsdl/wsibruger-ws.xsd
  • sso/src/main/resources/wsdl/wsibruger_v6.wsdl
  • sso/src/main/resources/wsdl/wsiinst-schema.xsd
  • sso/src/main/resources/wsdl/wsiinst-ws.xsd
  • sso/src/main/resources/wsdl/wsiinst_v5.wsdl
🚧 Files skipped from review as they are similar to previous changes (2)
  • sso/src/main/resources/wsdl/wsiinst_v5.wsdl
  • sso/src/main/resources/wsdl/wsibruger_v6.wsdl

Comment thread sso/build.gradle.kts
Comment on lines +163 to +165
dependsOn(tasks.getByName("downloadXsdWsCommon"))
dependsOn(tasks.getByName("downloadXsdWsiInst"))
dependsOn(tasks.getByName("downloadXsdWsiinstSchema"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

genWsiInst is missing a downloadXsdSchemaCommon dependency.

wsiinst-schema.xsd imports common/schema-common.xsd directly, and wsiinst_v5.wsdl transitively needs it via common/ws-common.xsd's include. genWsiBruger correctly depends on downloadXsdSchemaCommon (Line 150) for the equivalent transitive need, but genWsiInst does not. If this task runs standalone before the checked-in XSD is present (e.g. after deleting generated resources), Wsdl2Java code generation would fail on an unresolved common/schema-common.xsd import.

🛠️ Proposed fix
     dependsOn(tasks.getByName("downloadWSDLWsiInst"))
     dependsOn(tasks.getByName("downloadXsdWsCommon"))
+    dependsOn(tasks.getByName("downloadXsdSchemaCommon"))
     dependsOn(tasks.getByName("downloadXsdWsiInst"))
     dependsOn(tasks.getByName("downloadXsdWsiinstSchema"))
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dependsOn(tasks.getByName("downloadXsdWsCommon"))
dependsOn(tasks.getByName("downloadXsdWsiInst"))
dependsOn(tasks.getByName("downloadXsdWsiinstSchema"))
dependsOn(tasks.getByName("downloadXsdWsCommon"))
dependsOn(tasks.getByName("downloadXsdSchemaCommon"))
dependsOn(tasks.getByName("downloadXsdWsiInst"))
dependsOn(tasks.getByName("downloadXsdWsiinstSchema"))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sso/build.gradle.kts` around lines 163 - 165, The genWsiInst task is missing
the downloadXsdSchemaCommon dependency, so its Wsdl2Java inputs can be
incomplete when run standalone. Update the genWsiInst task configuration in
build.gradle.kts to include downloadXsdSchemaCommon alongside the existing
downloadXsdWsCommon, downloadXsdWsiInst, and downloadXsdWsiinstSchema
dependencies. Use genWsiBruger as the reference pattern for how the transitive
schema dependency should be declared.

@Zenzus
Zenzus merged commit 2b4f569 into master Jul 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants