Skip to content

[Fix #1778] Refactoring HTTP - #1801

Open
fjtirado wants to merge 6 commits into
open-workflow-specification:mainfrom
fjtirado:Fix_1778
Open

fjtirado wants to merge 6 commits into
open-workflow-specification:mainfrom
fjtirado:Fix_1778

Conversation

@fjtirado

@fjtirado fjtirado commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fix #1778

AuthProviderFactory was changed (method was moved from getAuth to content). Thats breaks backward compatibility, but this will be part of a major release, so it is the right momento to fix that flaw.

@fjtirado
fjtirado force-pushed the Fix_1778 branch 9 times, most recently from 3b967c6 to 5f0090f Compare October 27, 2026 09:54
@fjtirado
fjtirado marked this pull request as ready for review October 27, 2026 09:56
@fjtirado
fjtirado requested review from gmunozfe, mathecruz and ricardozanini and a balanced review from Copilot October 27, 2026 09:56
@fjtirado
fjtirado marked this pull request as draft October 27, 2026 09:59

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.

🟡 Changes recommended

HTTP correctness regressions and a resource-loading deadlock with bounded executors remain unresolved.

11 open issues
What changed in this PR

Refactors HTTP handling for #1778 so external resources can reuse configured workflow/task clients, while retaining a JDK-based transport without Jakarta dependencies.

Changes:

  • Introduces shared HTTP request/response abstractions and integrates resource downloads.
  • Moves HTTP task support and default URI-template resolution into core, with optional Jakarta implementations.
  • Updates authentication interfaces, JSON model conversion, service registrations, and tests.
File Description
README.md Adds URI-template code attribution.
impl/​test/​src/​test/​java/​org/​openworkflow/​sdk/​impl/​test/​OpenAPITest.java Updates cache headers and assertions.
impl/​test/​src/​test/​java/​org/​openworkflow/​sdk/​impl/​test/​HTTPWorkflowDefinitionTest.java Exercises the JDK transport.
impl/​test/​src/​test/​java/​org/​openworkflow/​sdk/​impl/​test/​CustomAuthProviderFactoryOverrideTest.java Adapts custom authentication signatures.
impl/​test/​src/​test/​java/​org/​openworkflow/​sdk/​impl/​auth/​OAuthRequestBuilderTest.java Uses renamed authentication request type.
impl/​template/​src/​main/​resources/​META-INF/​services/​org.openworkflow.sdk.impl.resources.URITemplateResolver Removes old resolver registration.
impl/​template/​pom.xml Removes standalone template module.
impl/​README.md Updates module descriptions.
impl/​pom.xml Removes template module configuration.
impl/​openapi/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​openapi/​OpenAPIExecutorBuilder.java Uses shared request builder.
impl/​openapi/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​openapi/​OpenAPIExecutor.java Executes through shared HTTP abstractions.
impl/​model/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​model/​jackson/​JacksonModelFactory.java Adds JSON-byte deserialization.
impl/​model/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​model/​jackson/​JacksonModel.java Adds JSON-byte serialization.
impl/​jwt-impl/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​jackson/​JacksonModelConverterFactory.java Updates Jakarta converter imports.
impl/​jackson/​pom.xml Removes standalone template dependency.
impl/​http/​src/​main/​resources/​META-INF/​services/​org.openworkflow.sdk.impl.http.WorkflowHttpRequestFactory Registers Jakarta request factory.
impl/​http/​src/​main/​resources/​META-INF/​services/​org.openworkflow.sdk.impl.http.URITemplateResolver Registers relocated Jakarta resolver.
impl/​http/​src/​main/​resources/​META-INF/​services/​org.openworkflow.sdk.impl.executors.CallableTaskBuilder Removes HTTP-module task registration.
impl/​http/​src/​main/​resources/​META-INF/​services/​org.openworkflow.sdk.impl.auth.AccessTokenProviderFactory Updates token-provider registration.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​template/​JaxrsURITemplateResolver.java Relocates Jakarta template resolver.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​JakartaRequestExecutorFactory.java Creates Jakarta requests.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​JakartaRequestExecutor.java Implements Jakarta request execution.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​JakartaHttpResponse.java Adapts Jakarta responses.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​HttpRequestDecorator.java Relocates request decorator interface.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​HttpModelConverter.java Relocates and simplifies conversion interface.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​HttpConverterResolver.java Supports optional execution contexts.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​http/​HttpClientResolver.java Resolves clients with optional contexts.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​auth/​JaxRSAccessTokenProviderFactory.java Passes application into token providers.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​jakarta/​auth/​JaxRSAccessTokenProvider.java Adapts token requests to optional contexts.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​WithoutBodyRequestExecutor.java Removes superseded bodyless executor.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​WithBodyRequestExecutor.java Removes superseded body executor.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​HttpExecutorBuilder.java Removes old Jakarta-specific builder.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​HttpExecutor.java Removes old HTTP-module executor.
impl/​http/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​AbstractRequestExecutor.java Removes superseded execution base.
impl/​http/​pom.xml Depends directly on core and Jakarta.
impl/​core/​src/​main/​resources/​META-INF/​services/​org.openworkflow.sdk.impl.executors.CallableTaskBuilder Registers HTTP tasks in core.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowValueResolver.java Adds optional-context resolution.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowUtils.java Updates secrets and template access.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowModelFactory.java Adds optional JSON deserialization contract.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowModel.java Adds optional JSON serialization contract.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowError.java Supports errors without task context.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowDecorator.java Documents context nullability.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​WorkflowApplication.java Configures HTTP factories and resolver defaults.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​resources/​ResourceLoader.java Passes authentication and execution contexts.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​resources/​HttpResource.java Downloads through configured HTTP factory.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​resources/​DefaultResourceLoader.java Propagates contexts into HTTP resources.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHttpResponse.java Defines shared response contract.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHttpRequestInfoBuilderFactory.java Resolves workflow request configuration.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHttpRequestInfo.java Defines request data and builder.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHTTPRequestHelper.java Centralizes authentication and response handling.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHttpRequestFactory.java Defines pluggable request factory.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​WorkflowHttpRequest.java Defines transport-neutral request invocation.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​URITemplateResolver.java Relocates resolver contract.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​DefaultURITemplateResolver.java Adds dependency-free template expansion.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​DefaultHttpResponse.java Adapts JDK responses.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​DefaultHttpRequestBuilderFactory.java Provides fallback JDK client.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​http/​DefaultHttpRequest.java Implements JDK request execution.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​HttpExecutor.java Executes HTTP tasks through shared factory.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​executors/​http/​CallableTaskHttpExecutorBuilder.java Builds transport-neutral HTTP tasks.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​HttpRequestInfoBuilder.java Builds renamed authentication request type.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​DigestAuthProvider.java Uses shared HTTP for digest challenges.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​CommonOAuthProvider.java Adapts OAuth resolution and factory calls.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​BearerAuthProvider.java Supports optional authentication contexts.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​BasicAuthProvider.java Supports optional authentication contexts.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​AuthRequestBuilder.java Updates authentication request return type.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​AuthProvider.java Revises authentication context contract.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​AuthHttpRequestInfo.java Renames authentication request record.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​AccessTokenProviderFactory.java Adds application to factory contract.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​AccessTokenProvider.java Accepts optional execution contexts.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​auth/​AbstractAuthRequestBuilder.java Returns renamed authentication request type.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​additional/​WorkflowAdditionalObject.java Defines nullable-context factory contract.

Review effort: Balanced

@fjtirado
fjtirado marked this pull request as ready for review October 27, 2026 10:36
Copilot AI balanced review requested due to automatic review settings October 27, 2026 10:36

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.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 12:20

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.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 12:29

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.

@fjtirado

Copy link
Copy Markdown
Collaborator Author

and breaking previously working requests.

🔵 Needs a closer look

Body detection ignores the original Swagger 2 in: body declaration for free-form object schemas, silently discarding configured payloads and breaking previously working requests.

1 open issue

1 resolved since last review

Review effort: Balanced

Body in is considered here

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.

🟡 Changes recommended

The change silently drops Swagger 2 free-form request bodies and reuses GET Digest credentials for HEAD revalidation, causing authentication failures and repeated schema downloads.

1 open issue
1 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

Swagger 2 operations with free-form object bodies can silently drop supplied payloads because body detection overlooks the operation’s original in: body parameters.

2 open issues

Review effort: Balanced

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.

🟡 Changes recommended

Valid legacy HTTP-date values can cause cache revalidation to fail, while null query values are sent as empty strings instead of failing request preparation.

2 open issues
2 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

Eager HTTP client initialization can break application construction without a provider, while unsynchronized shared ServiceLoader access can cause parallel requests to fail or miss decorators.

2 open issues
2 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

When both contexts are present, converter lookup ignores additionalObjectSuppliers, causing HTTP/OpenAPI tasks to fall back to Object.class and lose direct JsonNode conversion.

1 open issue
2 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

The contextual lookup throws when a workflow has no task, preventing client or supplier fallback, and skips registered providers when both contexts are absent despite their documented null-context support.

1 open issue
1 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

HTTP shutdown can block indefinitely because task timeouts leave underlying exchanges active, and the new default URI-template resolver is not exercised by the existing tests.

1 open issue
1 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

Eagerly parsing all server URLs lets an unused fallback template trigger a URI parsing error and block an otherwise valid primary request.

1 open issue
1 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

A shared, non-thread-safe ServiceLoader risks failed or incomplete decorator discovery during concurrent Jakarta requests, and malformed HTTP dates can cause servers to ignore or reject conditional requests.

2 open issues
1 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

The HTTP date formatter uses the JVM’s default locale, which can produce invalid If-Modified-Since headers under non-English locales; specify Locale.US explicitly.

1 open issue
2 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

Shared OAuth/OIDC request-builder state can mix credentials across overlapping token exchanges, while JacksonModelCollection request bodies fail before transport because they lack an asJson() override.

2 open issues
1 resolved since last review

Review effort: Balanced

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.

🔵 Needs a closer look

The cached OAuth/OIDC provider shares mutable credential maps across token exchanges, allowing overlapping requests during rotation to send new secrets to an old issuer.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@mathecruz mathecruz left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @fjtirado it looks nice, I left some comments. I noted a lot of Optional as parameter, maybe we can reconsider these kind of change for the 8.0.0 (at least for the public APIs).

Comment thread impl/README.md Resolved
Comment thread impl/README.md Resolved
Comment thread README.md Resolved

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.

🟡 Changes recommended

The HTTP changes contain a compilation-blocking authentication lambda and can deadlock external resource loading on single-threaded or saturated bounded application executors.

1 open issue

Review effort: Balanced

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.

🔵 Needs a closer look

The HTTP module cannot compile due to an invalid authentication callback, and resource loading can deadlock by waiting for work queued on the same bounded executor.

1 open issue

Review effort: Balanced

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.

🟡 Changes recommended

An invalid authentication callback prevents the HTTP module from compiling, and resource requests queued on the workflow executor can deadlock schema loading.

5 open issues

Review effort: Balanced

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.

🟡 Changes recommended

External-resource loading can deadlock when blocking downloads wait for HTTP requests queued on the same single-threaded or saturated application executor.

4 open issues
4 resolved since last review

Review effort: Balanced

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
…Factory to content

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>

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.

🟡 Changes recommended

The changes bypass custom authentication when no explicit policy is supplied and can deadlock OpenAPI schema downloads on single-thread or saturated executors.

1 open issue
4 resolved since last review

Review effort: Balanced

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>

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.

🔵 Needs a closer look

Resource downloads can deadlock because schema loading synchronously waits for HTTP work queued to the same bounded application executor.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

Schema downloads can deadlock because they block waiting for HTTP requests queued on the same single-thread or saturated application executor.

1 open issue

Review effort: Balanced

…rameters

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>

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.

🔵 Needs a closer look

Requests without an authentication policy can lose factory-provided credentials, and reserved URI template expansions emit illegal characters without encoding, causing URI creation to fail.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor http stack so external resource download reuses configured Http client

3 participants