Skip to content

[consul] Enable ACL authentication#521

Merged
zippolyte merged 7 commits intomasterfrom
hippo/consul_acl
Jul 10, 2017
Merged

[consul] Enable ACL authentication#521
zippolyte merged 7 commits intomasterfrom
hippo/consul_acl

Conversation

@zippolyte
Copy link
Copy Markdown
Contributor

@zippolyte zippolyte commented Jul 5, 2017

What does this PR do?

Enable ACL authentication by passing the header X-Consul-Token to the request. See https://www.consul.io/api/index.html#acls

Motivation

Feature request

Versioning

  • Bumped the version check in manifest.json
  • Updated CHANGELOG.md

Additional Notes

Will need to modify the flare so that the token in the yaml is sanitized.

@zippolyte zippolyte added this to the 5.15 milestone Jul 5, 2017
@zippolyte zippolyte force-pushed the hippo/consul_acl branch 2 times, most recently from 83f6fc5 to d5bb79c Compare July 5, 2017 22:38
@hush-hush hush-hush modified the milestones: 5.16, 5.15 Jul 10, 2017
@olivielpeau olivielpeau self-assigned this Jul 10, 2017
@olivielpeau olivielpeau assigned truthbk and unassigned olivielpeau Jul 10, 2017
@olivielpeau olivielpeau removed their request for review July 10, 2017 15:23
Copy link
Copy Markdown
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small issue with the test - can you double-check that? Nice job 👍

Comment thread consul/check.py Outdated
acl_token = instance.get('acl_token', None)

headers = {}
if acl_token is not None:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be, I don't think we need to check if it's not None...

if acl_token:
     # blah...

Comment thread consul/ci/consul.rake
sh %( docker run -d --expose 8301 --expose 8500 -p 8500:8500 --name #{container_name_1} \
sh %( docker create --expose 8301 --expose 8500 -p 8500:8500 --name #{container_name_1} \
consul:#{consul_version} agent -dev -bind=0.0.0.0 -client=0.0.0.0 )
sh %( docker cp #{__dir__}/server.json #{container_name_1}:/consul/config/server.json )
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job with the test infastructure setup! 🍰

Comment thread consul/test_consul.py Outdated
try:
self.run_check(config)
except HTTPError as e:
if e.errno == 403:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zippolyte we should actually assert the e.errno == 403 to confirm the test is working as expected, otherwise if there were no exception, this test would also pass although the acl_token was actually bad.

Copy link
Copy Markdown
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now! Good one 👍

@zippolyte zippolyte modified the milestones: 5.15, 5.16 Jul 10, 2017
@zippolyte zippolyte merged commit f276b19 into master Jul 10, 2017
@zippolyte zippolyte deleted the hippo/consul_acl branch July 10, 2017 20:06
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.

4 participants