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

Password field in datasource #184

Closed
JorundMartinsen opened this issue Oct 20, 2021 · 2 comments
Closed

Password field in datasource #184

JorundMartinsen opened this issue Oct 20, 2021 · 2 comments

Comments

@JorundMartinsen
Copy link

The documentation states that passwords are not retrieved for datasources, and I should provide the password manually.

After editing the secureJson.password field and applying, Grafana still doesn't show a password.
This could be an issue with grafana api, but when inspecting the network request, the api seems to be similar.

Any suggestions?

Grafana version: 8.1.2
Grizzly version: dev-v0.1.0-47-gc7b2395
grr apply resources/datasources/datasource-aDgYk2Hnk.yaml

My datasource yaml. Edited to keep my secrets secret :)

apiVersion: grizzly.grafana.com/v1alpha1
kind: Datasource
metadata:
    name: aDgYk2Hnk
spec:
    access: proxy
    basicAuth: false
    basicAuthPassword: ""
    basicAuthUser: ""
    database: myDb
    id: 1
    isDefault: true
    jsonData:
        postgresVersion: 1200
        sslmode: require
        timescaledb: true
        tlsAuth: true
        tlsAuthWithCACert: true
        tlsConfigurationMethod: file-path
        tlsSkipVerify: false
    name: PostgreSQL
    orgId: 1
    readOnly: false
    secureJsonFields:
        password: myPass
    type: postgres
    typeLogoUrl: ""
    uid: aDgYk2Hnk
    url: localhost:5432
    user: myUser
    version: 13
    withCredentials: false
@malcolmholmes
Copy link
Collaborator

could it simply be because it should be secureJsonData not secureJsonFields?

@JorundMartinsen
Copy link
Author

JorundMartinsen commented Oct 21, 2021

Could be.
I'll test tomorrow

-- Edit
It was secureJsonData. Following yaml works

apiVersion: grizzly.grafana.com/v1alpha1
kind: Datasource
metadata:
    name: aDgYk2Hnk
spec:
    access: proxy
    basicAuth: false
    basicAuthPassword: ""
    basicAuthUser: ""
    database: myDb
    id: 1
    isDefault: true
    jsonData:
        postgresVersion: 1200
        sslmode: require
        timescaledb: true
        tlsAuth: true
        tlsAuthWithCACert: true
        tlsConfigurationMethod: file-path
        tlsSkipVerify: false
    name: PostgreSQL
    orgId: 1
    readOnly: false
    secureJsonData:
        password: myPass
    secureJsonFields:
        password: true
    type: postgres
    typeLogoUrl: ""
    uid: aDgYk2Hnk
    url: localhost:5432
    user: myUser
    version: 13
    withCredentials: false

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

No branches or pull requests

2 participants