Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supply optional token for ACL changes #128

Merged
merged 2 commits into from
Jun 2, 2015

Conversation

mdelagrange
Copy link
Contributor

It seems likely that the Consul cluster will not allow the anonymous token to make ACL changes, so it would be nice if you could supply a token with the right privileges. I tried setting that up in this PR. I had to delete the prefetch methods, since they wouldn't have access to the token. However maybe there is a better way to handle it.

@@ -23,14 +16,14 @@ def self.list_resources
uri = URI('http://localhost:8500/v1/acl')
http = Net::HTTP.new(uri.host, uri.port)

path=uri.request_uri + '/list'
path=uri.request_uri + "/list?token=#{acl_api_token}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work when the token is set to an empty string? Like consul tolerate a /list?token= ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's assumed to be the anonymous token.

@solarkennedy
Copy link
Contributor

I am also not an expert on this part of the code (custom providers), but I understand that often the ACLs will not be setup in such a way for puppet to prefetch them.

I don't currently use this ACL code at all, but I would like to. Thank you for your help in getting this ACL code in a more production-ready state!

solarkennedy added a commit that referenced this pull request Jun 2, 2015
Supply optional token for ACL changes
@solarkennedy solarkennedy merged commit 6930561 into voxpupuli:master Jun 2, 2015
@j1n6
Copy link

j1n6 commented Jul 7, 2015

this commit seems to break "ensure" capability of creating ACL resources.

@solarkennedy
Copy link
Contributor

Crap :(

@activars can you pastebin with output?

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.

3 participants