Title: Add handler parameter to pushgateway functions to permit HTTP AUTH etc. (refs issue #60) by rossigee · Pull Request #126 · prometheus/client_python · GitHub
Open Graph Title: Add handler parameter to pushgateway functions to permit HTTP AUTH etc. (refs issue #60) by rossigee · Pull Request #126 · prometheus/client_python
X Title: Add handler parameter to pushgateway functions to permit HTTP AUTH etc. (refs issue #60) by rossigee · Pull Request #126 · prometheus/client_python
Description: Takes the branch by @tim-seoss (PR #120), fixes a minor regression, moves the default handler code out to be more easily re-used/adapted, and adds a basic unit test for a custom handler. A simple handler function for adding Basic Auth might then look like this... #!/usr/bin/python import os, base64 from prometheus_client.handlers.base import handler as default_handler def handler(url, method, timeout, headers, data): '''Handler that implements HTTP Basic Auth using environment variables 'PUSHGW_USERNAME' and 'PUSHGW_PASSWORD'.''' username = os.environ['PUSHGW_USERNAME'] password = os.environ['PUSHGW_PASSWORD'] auth_value = "{0}:{1}".format(username, password) auth_header = "Basic {0}".format(base64.b64encode(bytes(auth_value))) headers.append(['Authorization', auth_header]) default_handler(url, method, timeout, headers, data) @brian-brazil - your thoughts?
Open Graph Description: Takes the branch by @tim-seoss (PR #120), fixes a minor regression, moves the default handler code out to be more easily re-used/adapted, and adds a basic unit test for a custom handler. A simple h...
X Description: Takes the branch by @tim-seoss (PR #120), fixes a minor regression, moves the default handler code out to be more easily re-used/adapted, and adds a basic unit test for a custom handler. A simple h...
Opengraph URL: https://github.com/prometheus/client_python/pull/126
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:db19ac4d-2156-587a-8949-289dc0c81c54 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | DC86:E82BE:11ADA4E:16DDDF3:699081E7 |
| html-safe-nonce | 93ec643065a6e7141d997939fdc8c196896bb1f97bf6f450f2d5a6a6acf78176 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzg2OkU4MkJFOjExQURBNEU6MTZERERGMzo2OTkwODFFNyIsInZpc2l0b3JfaWQiOiIxNjk3Njc2NzU0MjY3NzAxNzM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 61d977216539ab8c9ea069e03f47d5f67e91fd70bd116222d65df08c3afab831 |
| hovercard-subject-tag | pull_request:101587252 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/prometheus/client_python/pull/126/checks |
| twitter:image | https://avatars.githubusercontent.com/u/5194485?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5194485?s=400&v=4 |
| og:image:alt | Takes the branch by @tim-seoss (PR #120), fixes a minor regression, moves the default handler code out to be more easily re-used/adapted, and adds a basic unit test for a custom handler. A simple h... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/prometheus/client_python git https://github.com/prometheus/client_python.git |
| octolytics-dimension-user_id | 3380462 |
| octolytics-dimension-user_login | prometheus |
| octolytics-dimension-repository_id | 30618733 |
| octolytics-dimension-repository_nwo | prometheus/client_python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 30618733 |
| octolytics-dimension-repository_network_root_nwo | prometheus/client_python |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width