-
Notifications
You must be signed in to change notification settings - Fork 83
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
fix(lookup/grafana_dashboard): add custom certs verification logic #356
Conversation
527e3e8
to
fefb2e6
Compare
/cc @rndmh3ro |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #356 +/- ##
===========================================
+ Coverage 23.42% 65.18% +41.76%
===========================================
Files 15 9 -6
Lines 1601 968 -633
Branches 336 133 -203
===========================================
+ Hits 375 631 +256
+ Misses 1219 309 -910
- Partials 7 28 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@Nemental One of the CI Sanity check for development fails for a test file which doesn't belong to my PR. The other Lint problem will be solved by me now. I am not sure why the particular test file for Sanity Develop Job fails? Edit: also I used the wrong number for the fragments file (used issue number instead of PR number) Tasks
|
Hey @shantanoo-desai |
Updatethe two Integration Tests seem to fail with HTTP 429 Too Many Requests on the Grafana Endpoint when trying to retrieve some dashboards. I am assuming the tests would just need to be re-run and nothing from my patch should actually break the tests. |
This fix adds the `validate_certs`, `ca_path` options to the lookup plugin. Both parameters comply with the `get_url` functionality of ansible-core and provides additional utility to perform lookup of dashboards from Grafana instances that are configured with Self-Signed Certificates. `validate_certs` option value defaults to `true` - following the pattern of `url` lookup plugin from the Core. `ca_path` option value is set explicitly when using the plugin else defaults to `None`. closes ansible-collections#346 Signed-off-by: Shantanoo 'Shan' Desai <[email protected]>
The remaining sanity workflow failures are not related with your changes and have already been fixed in #354 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 🥳
SUMMARY
This fix adds the
validate_certs
,ca_path
options to the lookup plugin. Both parameters comply with theget_url
functionality of ansible-core and provides additional utility to perform lookup of dashboards from Grafana instances that are configured with Self-Signed Certificates.validate_certs
option value defaults totrue
- following the pattern ofurl
lookup plugin from the Core.ca_path
option value is set explicitly when using the plugin else defaults toNone
.Fixes #346
ISSUE TYPE
COMPONENT NAME
Lookup Plugin for Grafana Dashboards
ADDITIONAL INFORMATION
Tested with a Grafana Docker image with Self-Signed Certificates as well as a local Certificate Authority. The Local CA along with a self-signed certificate is used to form a
chain.crt
and validated asca_path
option for the plugin.