grafana / grafana-infinity-datasource

CSV, JSON, GraphQL, XML and HTML datasource for grafana.
https://grafana.com/docs/plugins/yesoreyeram-infinity-datasource
Apache License 2.0
684 stars 90 forks source link

[BUG] Auth not being used - invalid settings. configure allowed hosts in the authentication section #901

Open bunkiedc opened 5 days ago

bunkiedc commented 5 days ago

Describe the Bug

The plugin is provisioned to not use any auth, but when tested, it complains that the config is invalid, and to configure the "allowed hosts" in the authentication section. When going to the Authentication section, it shows that no-auth is configured.

Steps to reproduce

Set up a provisioned plug-in that doesn't use auth.

Provide steps to reproduce the issue.

Note: bugs will be fixed only if enough information provided to reproduce the issue!

Sample Data

# config file version
apiVersion: 1
datasources:
  - id: 2
    uid: "redacted"
    orgId: 1
    name: "Infinity"
    type: "yesoreyeram-infinity-datasource"
    url: "http://redacted"
    basicAuth: false
    basicAuthUser: ""
    isDefault: false
    jsonData:
      httpHeaderName1: "redacted"
      global_queries: []
      secureQueryName1: ""
    readOnly: true
    secureJsonData:
      httpHeaderValue1: "redacted"

Provide a link for sample data, or provide sample data bellow

Screenshots

Infinity_Invalid_hosts

If applicable, add screenshots to help explain your problem.

Version Details:

Additional context

I've also noticed that there is an additional note that the url is deprecated, but I was not able to find any specific information about that.

Infinity_plugin_misc

bunkiedc commented 4 days ago

I think perhaps I've misunderstood something with your documentation. I think I should have added the host:port to allowedHosts under jsonData:, instead of using the old method of using url: host:port. This appears to remove the error, and I was able to get it working. Please let me know if this is correct. thanks!

apiVersion: 1

datasources:
  - id: 2
    uid: "redacted"
    orgId: 1
    name: "Infinity"
    type: "yesoreyeram-infinity-datasource"
    basicAuth: false
    basicAuthUser: ""
    isDefault: false
    jsonData:
      allowedHosts: 
       - "http://redactedHost:redactedPort"
      httpHeaderName1: "redacted"
      global_queries: []
      secureQueryName1: ""
    readOnly: true
    secureJsonData:
      httpHeaderValue1: "redacted"