Skip to content

Allow injecting a custom AuthProviderFactory to let frameworks own authentication#1487

Merged
fjtirado merged 3 commits into
serverlessworkflow:mainfrom
mcruzdev:issue-1486
Jun 26, 2026
Merged

Allow injecting a custom AuthProviderFactory to let frameworks own authentication#1487
fjtirado merged 3 commits into
serverlessworkflow:mainfrom
mcruzdev:issue-1486

Conversation

@mcruzdev

@mcruzdev mcruzdev commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

This pull request allows a framework to inject a own AuthProviderFactory to control how the exchange token is made.

Special notes for reviewers:

Additional information (if needed):

Closes #1486

…thentication

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@mcruzdev mcruzdev requested a review from fjtirado as a code owner June 25, 2026 01:55
Copilot AI review requested due to automatic review settings June 25, 2026 01:55

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

This PR makes authentication resolution pluggable by allowing a WorkflowApplication to be configured with a custom AuthProviderFactory, enabling frameworks (e.g., Quarkus) to supply the Authorization header and bypass the SDK’s built-in OAuth2/OIDC token exchange when desired.

Changes:

  • Introduces AuthProviderFactory as an interface and adds DefaultAuthProviderFactory to preserve current default behavior.
  • Wires auth resolution through WorkflowApplication.authProviderFactory() in the HTTP executor path and resource loading path.
  • Adds a test verifying that a framework-provided factory can inject an auth header and that no token exchange is performed.

Reviewed changes

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

Show a summary per file
File Description
impl/test/src/test/java/io/serverlessworkflow/impl/test/CustomAuthProviderFactoryOverrideTest.java Adds an integration-style test covering factory override behavior and ensuring no OAuth token exchange occurs.
impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/HttpExecutorBuilder.java Switches HTTP auth provider resolution to use the application’s injected factory.
impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowApplication.java Adds an AuthProviderFactory field, builder setter, and accessor for injection + defaulting.
impl/core/src/main/java/io/serverlessworkflow/impl/resources/ResourceLoader.java Routes endpoint-auth resolution through the application’s injected factory.
impl/core/src/main/java/io/serverlessworkflow/impl/auth/DefaultAuthProviderFactory.java Extracts the previous static factory behavior into the default implementation.
impl/core/src/main/java/io/serverlessworkflow/impl/auth/AuthProviderFactory.java Converts factory from static utility class to injectable interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowApplication.java Outdated
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Copilot AI review requested due to automatic review settings June 25, 2026 17:11

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

@fjtirado fjtirado merged commit 00ef882 into serverlessworkflow:main Jun 26, 2026
3 checks passed
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.

Allow injecting a custom AuthProviderFactory to let frameworks own authenticatio

3 participants