-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82f6534
commit d8d2ed6
Showing
2 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,8 @@ spec: | |
{field: "responseContent", description: "Expected response content", scheme: "string"}, | ||
{field: "thresholdMillis", description: "Request timeout", default: 5000, scheme: "int"}, | ||
{field: "maxSSLExpiry", description: "Max SSL expiry days", scheme: "int"}, | ||
{field: "insecureSkipVerify", description: "Skip TLS verification", scheme: "bool"} | ||
{field: "insecureSkipVerify", description: "Skip TLS verification", scheme: "bool"}, | ||
{field: "env", description: "Setup environment variables that are accessible while templating", scheme: "[]EnvVar"}, | ||
]}/> | ||
### TLS Config | ||
|
@@ -68,6 +69,14 @@ spec: | |
</details> | ||
### OAuth | ||
<Fields rows={[ | ||
{field: "tokenURL", description: "URL for OAuth Token", scheme: "string"}, | ||
{field: "scope", description: "Scope for OAuth token request", scheme: "[]string"}, | ||
{field: "params", description: "Parameters for OAuth", scheme: "map[string]string"}, | ||
]}/> | ||
### Result Variables | ||
Result variables can be used in `test`, `display` and `transform` [expressions](../concepts/expressions) | ||
|
@@ -107,9 +116,7 @@ spec: | |
</div> | ||
</details> | ||
|
||
### OAuth | ||
|
||
### Template Body Variables | ||
## Template Body Variables | ||
|
||
| Name | Scheme | | ||
| ----------------------------- | ------------------- | | ||
|
@@ -129,6 +136,37 @@ Eg: In the following spec, the vars `my_secret_path` and `my_secret_var`, define | |
</div> | ||
</details> | ||
|
||
<details summary="Templating authentication from env variables"> | ||
<div> | ||
```yaml title="http_user_pass_template.yaml" | ||
apiVersion: canaries.flanksource.com/v1 | ||
Check failure on line 142 in canary-checker/docs/reference/1-http.mdx GitHub Actions / vale[vale] canary-checker/docs/reference/1-http.mdx#L142
Raw output
|
||
kind: Canary | ||
metadata: | ||
name: http-basic-auth-url | ||
namespace: canaries | ||
spec: | ||
http: | ||
- name: test-url-via-env | ||
# The URL can be templated from arbritrary values using the env field and $(.) syntax | ||
Check failure on line 150 in canary-checker/docs/reference/1-http.mdx GitHub Actions / vale[vale] canary-checker/docs/reference/1-http.mdx#L150
Raw output
|
||
url: $(.url) | ||
env: | ||
- name: url | ||
value: https://hello:[email protected]/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 | ||
``` | ||
</div> | ||
|
||
See <CommonLink to="gotemplate" anchor="escaping">Escaping variables</CommonLink> | ||
|
||
## Metrics | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters