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

Enable PDC for Grafana-infinity-datasource #769

Merged
merged 8 commits into from
Feb 22, 2024
Merged

Conversation

leandro-deveikis
Copy link
Contributor

@leandro-deveikis leandro-deveikis commented Feb 19, 2024

Enabling Private Datasource Connect for Infinity

Background

This PR enables support for the secure socks proxy, which is a new feature in Grafana 10. The feature allows datasource connections to be proxied through a socks5 proxy with TLS. This enables Grafana users to connect to datasources that live in different networks than where Grafana is running when they cannot open up ports to the public internet.

Implementation notes:

  • Added frontend configuration to enable PDC (when running locally) at the Network section of the configuration. This will only be shown when running locally, in HG this is disabled and the PDC App adds another configuration (selector for multiple networks).
  • Added proxy configurations in the backend, which are needed to configure the http.Transport object which will be the one connecting to the PDC Server.

Dependency updates:

  • Not needed, plugin-sdk was already updated to the required version.

Won't implement for now:

  • This should be commented in the documentation, but for now I don't see any reason to implement AWS Sigv4 or Azure blob auth as are mostly used as SaaS. Add a comment if this is wrong.

Tests:

  • Test running Grafana locally with mocks:
    • No Authentication:
    • Basic Authentication - JSON, CSV, XML
      • created a basic project to ensure that this is working correctly. Printed the headers in the logs and everything looks fine
      • used local implementation https://github.com/abbot/go-http-auth
    • Bearer Authentication - JSON, CSV, XML
      • Same as basic auth
    • Api Key value Pair - JSON, CSV, XML
      • Same as basic auth
    • Digest Auth - JSON
    • Forward OAuth - Couldnt test but the implementation is the same as Oauth2
    • Oauth2
      - Tested using Azure oauth for logs
  • Test in HG - I don't think this will be possible before releasing, after releasing we will be doing another round of tests before announcing the feature
    • Need to test how the PDC network selector will be shown, not pretty for sure.

@yesoreyeram yesoreyeram linked an issue Feb 19, 2024 that may be closed by this pull request
@leandro-deveikis leandro-deveikis marked this pull request as ready for review February 20, 2024 14:59
@leandro-deveikis leandro-deveikis requested a review from a team as a code owner February 20, 2024 14:59
@yesoreyeram yesoreyeram self-assigned this Feb 21, 2024
Copy link
Collaborator

@yesoreyeram yesoreyeram left a comment

Choose a reason for hiding this comment

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

LGTM. Good one @leandro-deveikis . @zoltanbedi helped me to test this locally and now I added couple of setup things to test this in future.

@leandro-deveikis leandro-deveikis merged commit fb81129 into main Feb 22, 2024
5 checks passed
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.

[Feature Request] Add support for PDC
2 participants