Skip to content

Validate task's auth being referencing a not defined use.authentications#1491

Open
mcruzdev wants to merge 1 commit into
serverlessworkflow:mainfrom
mcruzdev:fix-unresolved-auth-reference
Open

Validate task's auth being referencing a not defined use.authentications#1491
mcruzdev wants to merge 1 commit into
serverlessworkflow:mainfrom
mcruzdev:fix-unresolved-auth-reference

Conversation

@mcruzdev

Copy link
Copy Markdown
Collaborator

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

Special notes for reviewers:

Additional information (if needed):

Closes #1490

@mcruzdev mcruzdev requested a review from fjtirado as a code owner June 26, 2026 13:44
Copilot AI review requested due to automatic review settings June 26, 2026 13:44

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 adds a fail-fast validation for workflows that reference an authentication by name via authentication.use when that name is not defined under use.authentications, addressing issue #1490’s “silent unauthenticated request” behavior.

Changes:

  • Add a regression test asserting an undefined authentication reference throws an IllegalArgumentException during workflow definition build.
  • Add validation in the HTTP callable task executor builder to verify referenced authentication names exist in use.authentications.

Reviewed changes

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

File Description
impl/test/src/test/java/io/serverlessworkflow/impl/test/UndefinedAuthReferenceTest.java Adds a regression test covering undefined authentication.use references for HTTP call tasks.
impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/CallableTaskHttpExecutorBuilder.java Introduces validation to reject undefined authentication references before configuring HTTP task execution.

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

@mcruzdev mcruzdev force-pushed the fix-unresolved-auth-reference branch from 9494478 to bab60b2 Compare June 26, 2026 14:13
Copilot AI review requested due to automatic review settings June 26, 2026 14:15
@mcruzdev mcruzdev force-pushed the fix-unresolved-auth-reference branch from bab60b2 to 9c4c253 Compare June 26, 2026 14:15

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 1 out of 1 changed files in this pull request and generated 1 comment.

@mcruzdev mcruzdev force-pushed the fix-unresolved-auth-reference branch from 9c4c253 to 8736cd1 Compare June 26, 2026 15:00
Copilot AI review requested due to automatic review settings June 26, 2026 15:15

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +23 to +28
public class AuthenticationUtils {

private AuthenticationUtils() {}

public static void checkAuthentication(
Workflow workflow, ReferenceableAuthenticationPolicy auth) {
@mcruzdev mcruzdev force-pushed the fix-unresolved-auth-reference branch from 1be6855 to c47dc3d Compare June 26, 2026 16:51
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Copilot AI review requested due to automatic review settings June 26, 2026 17:57
@mcruzdev mcruzdev force-pushed the fix-unresolved-auth-reference branch from c47dc3d to e8242d8 Compare June 26, 2026 17:57

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 2 out of 2 changed files in this pull request and generated no new comments.

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.

Referencing an undefined authentication via .use silently sends request unauthenticated

3 participants