Skip to content

fix: send API token on workflow gRPC calls - #1710

Draft
somaz94 wants to merge 1 commit into
dapr:masterfrom
somaz94:fix/workflow-api-token
Draft

somaz94 wants to merge 1 commit into
dapr:masterfrom
somaz94:fix/workflow-api-token

Conversation

@somaz94

@somaz94 somaz94 commented Sep 22, 2026

Copy link
Copy Markdown

Description

dapr workflow list, history, purge and rerun failed with Unauthenticated against a sidecar secured with an API token, even with DAPR_API_TOKEN exported.

The workflow client dialed its own gRPC connection next to the SDK client, so it never got the SDK interceptor that attaches the dapr-api-token header. It now reuses the SDK client's connection, the same way dapr workflow run and the event commands already do. This covers both self-hosted and Kubernetes mode.

Closing the SDK client in Cancel now also closes that shared connection, which was never closed before. In Kubernetes mode the port-forward is stopped if connecting fails.

I added a test that starts a fake sidecar with DAPR_API_TOKEN set and checks that the token arrives on a workflow call. It fails on master and passes with this change. go test ./pkg/... and golangci-lint run ./pkg/workflow/... are clean locally.

Issue reference

Please reference the issue this PR will close: #1700

Checklist

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: somaz <genius5711@gmail.com>
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.

Dapr workflow commands in Kubernetes mode fail with Unauthenticated against sidecars secured with a api-token-secret

1 participant