Repository navigation
add support for acl tokens in discovery and config - #80
Conversation
|
So if it doesn't support deregistering with an acl, will this need to wait until |
|
I think this probably needs to wait. Having register without deregister isn't entirely helpful. |
|
@spencergibb turns out we don't need tokens to deregister services, so this should be good to go. I also took some time to test both the discovery and config token functionality, and all checked out. I put some detail on the situation with tokens and the deregister endpoint over on consul-api if you're interested: Ecwid/consul-api#28 Also, let me know if you would like some tests for the acl token functionality, and I can work on a pull request next week. Thank you! |
|
Sounds good. If you get tests by teusday, great. Otherwise I'll merge and you can add tests later in the week. |
|
I think there are a couple of options for testing the ACL functionality. If you want to go a functional route, I setup an example that secures consul with ACLs, registers a service using an allowed ACL, and then verifies the service was registered. Here is the branch: https://github.com/bpgray/spring-cloud-consul/tree/test-discovery-acl Note, that I wasn't able to get this working in Travis CI (it couldn't find the config directory), which I think has something to do with the username/permissions in the .travis.yml. The tests did work for me locally. This example still needs a bit of polish, including needing to add anonymous permissions to register the other test services (currently they are all ACL rejected, although the tests still pass). Another approach would be to use mocks in the testing. It looks like mockito is being using in spring-cloud-config. Let me know if you would like to go that route, and what dependency to use. I probably won't be able to develop the testing further until later in the week, so maybe best to merge this pull request as is. |
|
Functional tests now work on my fork and branch with travis at https://github.com/bpgray/spring-cloud-consul/tree/test-discovery-acl I had to make a couple minor adjustments to .travis.yml to get this working on my fork. Let me know if you like this approach, and I can send a pull request. (I'll revert these adjustments in the pull request so it works in your repo). |
* pull80: add support for acl tokens in discovery and config
|
@bpgray go ahead with a new PR for the integration tests. |
Pull request against #66
This establishes two different acl tokens, one for registering the service in discovery and one for retrieving keys in config.
At that point Ecwid/consul-api does not support tokens for deregistering services. I'll open a new issue with consul-api to address.
Also, I was unable to build this due to some upstream dependencies (spring-integration-bom) not being available.