Title: Consul.Session should support tokens · Issue #170 · python-consul/python-consul · GitHub
Open Graph Title: Consul.Session should support tokens · Issue #170 · python-consul/python-consul
X Title: Consul.Session should support tokens · Issue #170 · python-consul/python-consul
Description: The methods under Consul.Session do not work on a system with ACLs enabled and the default ACL policy is deny. This happens even if the token is set in consul.Consul() as self.agent.token is not passed in the params to the http client. P...
Open Graph Description: The methods under Consul.Session do not work on a system with ACLs enabled and the default ACL policy is deny. This happens even if the token is set in consul.Consul() as self.agent.token is not pa...
X Description: The methods under Consul.Session do not work on a system with ACLs enabled and the default ACL policy is deny. This happens even if the token is set in consul.Consul() as self.agent.token is not pa...
Opengraph URL: https://github.com/python-consul/python-consul/issues/170
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Consul.Session should support tokens","articleBody":"The methods under `Consul.Session` do not work on a system with ACLs enabled and the default ACL policy is `deny`. This happens even if the token is set in `consul.Consul()` as `self.agent.token` is not passed in the params to the http client.\r\n\r\nPossible fix:\r\n\r\n```\r\ndiff -ruN python-consul-0.7.2.orig/consul/base.py python-consul-0.7.2/consul/base.py\r\n--- python-consul-0.7.2.orig/consul/base.py\t2017-08-26 09:35:57.000000000 +0200\r\n+++ python-consul-0.7.2/consul/base.py\t2017-09-04 13:56:13.897000258 +0200\r\n@@ -1679,6 +1679,8 @@\r\n dc = dc or self.agent.dc\r\n if dc:\r\n params['dc'] = dc\r\n+ if self.agent.token:\r\n+ params['token'] = self.agent.token\r\n data = {}\r\n if name:\r\n data['name'] = name\r\n@@ -1716,6 +1718,8 @@\r\n dc = dc or self.agent.dc\r\n if dc:\r\n params['dc'] = dc\r\n+ if self.agent.token:\r\n+ params['token'] = self.agent.token\r\n return self.agent.http.put(\r\n CB.bool(),\r\n '/v1/session/destroy/%s' % session_id,\r\n@@ -1757,6 +1761,8 @@\r\n dc = dc or self.agent.dc\r\n if dc:\r\n params['dc'] = dc\r\n+ if self.agent.token:\r\n+ params['token'] = self.agent.token\r\n if index:\r\n params['index'] = index\r\n if wait:\r\n@@ -1787,6 +1793,8 @@\r\n dc = dc or self.agent.dc\r\n if dc:\r\n params['dc'] = dc\r\n+ if self.agent.token:\r\n+ params['token'] = self.agent.token\r\n if index:\r\n params['index'] = index\r\n if wait:\r\n@@ -1824,6 +1832,8 @@\r\n dc = dc or self.agent.dc\r\n if dc:\r\n params['dc'] = dc\r\n+ if self.agent.token:\r\n+ params['token'] = self.agent.token\r\n if index:\r\n params['index'] = index\r\n if wait:\r\n@@ -1850,6 +1860,8 @@\r\n dc = dc or self.agent.dc\r\n if dc:\r\n params['dc'] = dc\r\n+ if self.agent.token:\r\n+ params['token'] = self.agent.token\r\n return self.agent.http.put(\r\n CB.json(one=True, allow_404=False),\r\n '/v1/session/renew/%s' % session_id,\r\n```","author":{"url":"https://github.com/akissa","@type":"Person","name":"akissa"},"datePublished":"2017-09-04T11:57:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/170/python-consul/issues/170"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:531be0c6-49f7-8092-54b0-b5df358d9cca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B018:2F76D:48E790C:5D9FE4A:6975F50E |
| html-safe-nonce | f17c81476510a3b961ec1dd1b7e8da1b3fc63cf440fa7f2500d82d778221ed5e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDE4OjJGNzZEOjQ4RTc5MEM6NUQ5RkU0QTo2OTc1RjUwRSIsInZpc2l0b3JfaWQiOiI3MTQ5MjU1ODU5NDkzMDA4NjU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 720481681454b21fc6700c88ee93df227aaab3b3c76b8a1b9380b6a8d1b2ed04 |
| hovercard-subject-tag | issue:255020304 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-consul/python-consul/170/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a696234bfdf9e2b424b11d492aecef2db0ac5cc032a9a2a67d54291e196e6a65/python-consul/python-consul/issues/170 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a696234bfdf9e2b424b11d492aecef2db0ac5cc032a9a2a67d54291e196e6a65/python-consul/python-consul/issues/170 |
| og:image:alt | The methods under Consul.Session do not work on a system with ACLs enabled and the default ACL policy is deny. This happens even if the token is set in consul.Consul() as self.agent.token is not pa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | akissa |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2bce766e7450b03e00b2fc5badd417927ce33a860e78cda3e4ecb9bbd1374cc6 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-consul/python-consul git https://github.com/python-consul/python-consul.git |
| octolytics-dimension-user_id | 143416393 |
| octolytics-dimension-user_login | python-consul |
| octolytics-dimension-repository_id | 24473148 |
| octolytics-dimension-repository_nwo | python-consul/python-consul |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24473148 |
| octolytics-dimension-repository_network_root_nwo | python-consul/python-consul |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fcca2b8ef702b5f7f91427a6e920fa44446fe312 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width