+
-```yaml title="http_user_pass_template.yaml"
-apiVersion: canaries.flanksource.com/v1
-kind: Canary
-metadata:
- name: http-basic-auth-url
- namespace: canaries
-spec:
- http:
- - name: test-url-via-env
- # The URL can be templated from arbitrary values using the env field and $(.) syntax
- url: $(.url)
- env:
- - name: url
- value: https://hello:world2@httpbin.demo.aws.flanksource.com/basic-auth/hello/world2
- - name: test-basic-via-env
- # the url can be constructed from multiple variables
- url: https://$(.user):$(.pass)@httpbin.demo.aws.flanksource.com/basic-auth/hello/world
- templateBody: true
- body: |
- {{. | toJSONPretty " " }}
- responseCodes: [200]
- env:
- - name: user
- value: hello
- - name: pass
- value: world
+```yaml title="http_user_pass_template.yaml" file=../../../modules/canary-checker/fixtures/minimal/http_auth_url_pass.yaml
```
diff --git a/canary-checker/docs/reference/1-sql.mdx b/canary-checker/docs/reference/1-sql.mdx
index 823dd01..2fd1300 100644
--- a/canary-checker/docs/reference/1-sql.mdx
+++ b/canary-checker/docs/reference/1-sql.mdx
@@ -8,33 +8,7 @@ import { AzureSqlServer} from "@flanksource/icons/mi"
This check connects to a specified Postgres database, run a query against it and verify the results.
-```yaml
-apiVersion: canaries.flanksource.com/v1
-kind: Canary
-metadata:
- name: postgres-check
-spec:
- interval: 30
- postgres: # or mysql, mssql
- - name: postgres schemas check
- url: "postgres://$(username):$(password)@postgres.default.svc:5432/postgres?sslmode=disable"
- username:
- valueFrom:
- secretKeyRef:
- name: postgres-credentials
- key: USERNAME
- password:
- valueFrom:
- secretKeyRef:
- name: postgres-credentials
- key: PASSWORD
- query: SELECT current_schemas(true)
- display:
- template: |
- {{- range $r := .results.rows }}
- {{- $r.current_schemas}}
- {{- end}}
- results: 1
+```yaml file=../../../modules/canary-checker/fixtures/datasources/postgres.yaml
```