Skip to content

Fix session cookie SameSite regression and harden webapps XML mapping test - #2930

Merged
kthoms merged 3 commits into
feature/2874-activate-sb-int-testsfrom
copilot/fix-webapps-spring-boot-module-failures
May 12, 2026
Merged

kthoms merged 3 commits into
feature/2874-activate-sb-int-testsfrom
copilot/fix-webapps-spring-boot-module-failures

Conversation

Copilot AI commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Investigated the CI failure in PR 2884 and fixed a branch regression that dropped SameSite=Lax from session cookies in one spring-boot webapp path. Also stabilized a webapps test that could fail in restricted network environments due to external DTD resolution.

  • Session cookie regression fix

    • Restored explicit SameSite enforcement fallback in SessionCookieFilter so responses that do not trigger output-stream paths still receive configured cookie attributes.
  • Webapps test hardening

    • Updated QuerySessionFactoryTest to resolve MyBatis DTD locally from classpath instead of relying on network access.

Example snippet (core behavior fix):

try {
  filterChain.doFilter(httpServletRequest, responseProxy);
} finally {
  responseProxy.ensureSameSiteCookies();
}

Changed Templates

  • webapps/assembly/src/main/java/org/operaton/bpm/webapp/impl/security/filter/SessionCookieFilter.java
  • webapps/assembly/src/test/java/org/operaton/bpm/webapp/impl/db/QuerySessionFactoryTest.java

Documentation Checklist

Operation Metadata

  • operationId is unchanged from the existing value (if modifying an existing endpoint)
  • tag exactly matches a name in the main.ftl "tags" array
  • summary is 3–10 words, uses an approved verb, has no HTTP method label, no articles, no trailing punctuation
  • deprecated = true is set if and only if the operation is deprecated

Descriptions

  • Description starts with an active-voice verb phrase (not "This endpoint...", not "Returns...")
  • No Java class or interface names appear (ProcessDefinition interface, RuntimeService, etc.)
  • No hardcoded documentation URLs — all links use ${docsUrl}
  • For List endpoints: cross-reference to the Count endpoint is present
  • Security considerations are documented if the endpoint executes custom code or modifies access controls
  • Deprecation notice follows the formula: **Deprecated:** <reason>. Use <alternative> instead.

Parameters

  • All path parameters have required = true
  • All path parameters explain the ID format and how to obtain it
  • All date parameters explicitly state ISO 8601 format
  • All enum parameters list every accepted value with its effect in the prose description
  • All boolean parameters explain both the true and false (or default) effect
  • The final parameter in the list has last = true

Request Body

  • All POST/PUT/PATCH endpoints have @lib.requestBody unless the endpoint accepts no body
  • All POST/PUT/PATCH endpoints have at least one request body example
  • Example summaries follow the formula: <METHOD> /<path> (optionally with a disambiguating label)
  • Example IDs use realistic formats (key:version:uuid for process definitions, UUIDs for instances)
  • Example variables use the typed-value format {"type": "String", "value": "...", "valueInfo": {}}

Responses

  • All 200 responses have at least one response example
  • 204 responses have no dto or examples
  • 400 descriptions are specific about the invalid condition (not just "Bad Request")
  • 401 and 403 descriptions use the standard boilerplate with ${docsUrl} link
  • 404 descriptions name the missing resource type and the identifier field
  • The final response in the list has last = true

FreeMarker Syntax

  • Template compiles without errors: ./mvnw clean package -pl engine-rest/engine-rest-openapi -DskipTests
  • No hardcoded version strings in documentation URLs
  • Backticks inside desc strings are escaped as \`
  • No trailing commas in generated JSON (verify by inspecting the output spec after build)

Registration

  • The endpoint path is registered in the endpoints map in main.ftl (for new endpoints)
  • The tag name appears in the "tags" array in main.ftl (for new tags)
  • CMMN fields (caseInstanceId, caseExecutionId, caseDefinitionId) are marked deprecated = true

@github-actions github-actions Bot added lang:java Pull requests that update Java code scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI database Features and issues related to the persistence layer api:rest Changes affecting the REST API scope:model-api Changes to the BPMN, CMMN, DMN, XML model APIs. scope:external-task-client-java Changes to the Java external task client. scope:ldap Changes to the LDAP integration. scope:quarkus Changes to the Quarkus extension. scope:spin Changes to the Spin library. scope:spring-boot Changes to the Spring Boot starter. scope:webapp Changes affecting the legacy webapps. scope:build Changes affecting the build, e.g. Maven configuration, shell scripts. scope:db_schema Issues and changes affecting the database schema. scope:tests Changes affecting only test code scope:juel Changes to the JUEL implementation scope:connect Issues & changes related to the connect API and connectors labels May 12, 2026
@kthoms
kthoms marked this pull request as ready for review May 12, 2026 04:13
Copilot AI review requested due to automatic review settings May 12, 2026 04:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a regression where SameSite=Lax could be dropped from session cookies in certain webapp response paths, and improves the robustness of a MyBatis XML mapping test in environments without external network access.

Changes:

  • Ensure SameSite attributes are applied after the filter chain completes via ensureSameSiteCookies() rather than relying on flushBuffer().
  • Add a local SAX EntityResolver in QuerySessionFactoryTest to resolve the MyBatis DTD from the classpath.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
webapps/assembly/src/main/java/org/operaton/bpm/webapp/impl/security/filter/SessionCookieFilter.java Ensures SameSite cookie attributes are applied in a finally block via an explicit wrapper call.
webapps/assembly/src/test/java/org/operaton/bpm/webapp/impl/db/QuerySessionFactoryTest.java Resolves the MyBatis DTD locally during XML parsing to avoid network-dependent failures.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@kthoms
kthoms merged commit 54c4d34 into feature/2874-activate-sb-int-tests May 12, 2026
3 checks passed
@kthoms
kthoms deleted the copilot/fix-webapps-spring-boot-module-failures branch May 12, 2026 07:11
@kthoms kthoms removed the scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI label May 19, 2026
@kthoms kthoms removed database Features and issues related to the persistence layer api:rest Changes affecting the REST API scope:model-api Changes to the BPMN, CMMN, DMN, XML model APIs. scope:external-task-client-java Changes to the Java external task client. scope:ldap Changes to the LDAP integration. scope:quarkus Changes to the Quarkus extension. scope:spin Changes to the Spin library. scope:spring-boot Changes to the Spring Boot starter. scope:webapp Changes affecting the legacy webapps. scope:build Changes affecting the build, e.g. Maven configuration, shell scripts. scope:db_schema Issues and changes affecting the database schema. scope:tests Changes affecting only test code scope:juel Changes to the JUEL implementation scope:connect Issues & changes related to the connect API and connectors labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants