Skip to content

Fix ACL token propagation for Consul events - #1042

Merged
ryanjbaxter merged 3 commits into
spring-cloud:mainfrom
yashdotdev13:fix/709-acl-token-events
Nov 3, 2026
Merged

ryanjbaxter merged 3 commits into
spring-cloud:mainfrom
yashdotdev13:fix/709-acl-token-events

Conversation

@yashdotdev13

Copy link
Copy Markdown
Contributor

Summary

Fixes [#709](#709) by propagating the Consul ACL token to event firing API calls.

Previously, the ACL token was not included when firing Consul events, causing requests to fail when ACL enforcement was enabled.

Changes

  • Added ACL token support to ConsulBinderProperties.
  • Enabled configuration properties binding in ConsulBinderConfiguration.
  • Updated EventService to pass the ACL token when firing events.
  • Updated ConsulSendingHandler to include the ACL token in outbound event messages.
  • Added regression tests for ACL token propagation in EventService and ConsulSendingHandler.

Testing

  • ./mvnw -pl spring-cloud-consul-binder -am test
  • All tests passed.

Closes #709

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>

@ryanjbaxter ryanjbaxter 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.

eventList should also pass the token. The tests should also cover eventList, the watch call, the default token, and property binding

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@yashdotdev13

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback!

I have updated the implementation to propagate the ACL token to both the eventList and watch calls. I've also added tests covering ACL token propagation for fire, eventList, and watch operations.

The binder module tests are passing now. Please take another look when you get a chance.

}

public String getAclToken() {
return this.properties != null ? this.properties.getAclToken() : null;

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.

If this.properties.getAclToken() is an empty string I think we should return null as well to maintain the previous behavior

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@yashdotdev13

Copy link
Copy Markdown
Contributor Author

Thanks for pointing this out! I've made the change and added a test for it. All binder tests are passing now.

@ryanjbaxter
ryanjbaxter merged commit 9bdfb83 into spring-cloud:main Nov 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACL token is not sent with events

3 participants