diff --git a/docs/integrations/platforms/infisical-agent.mdx b/docs/integrations/platforms/infisical-agent.mdx index 883d248ae73..0133fc8bfde 100644 --- a/docs/integrations/platforms/infisical-agent.mdx +++ b/docs/integrations/platforms/infisical-agent.mdx @@ -47,19 +47,19 @@ The secret template functions is what you will use to fetch resources such as st - + ```bash - secret "" "environment-slug" "" "" + listSecrets "" "environment-slug" "" "" ``` ```bash example-template-usage-1 - {{- with secret "6553ccb2b7da580d7f6e7260" "dev" "/" `{"recursive": false, "expandSecretReferences": true}` }} + {{- with listSecrets "6553ccb2b7da580d7f6e7260" "dev" "/" `{"recursive": false, "expandSecretReferences": true}` }} {{- range . }} {{ .Key }}={{ .Value }} {{- end }} {{- end }} ``` ```bash example-template-usage-2 - {{- with secret "da8056c8-01e2-4d24-b39f-cb4e004b8d44" "staging" "/" `{"recursive": true, "expandSecretReferences": true}` }} + {{- with listSecrets "da8056c8-01e2-4d24-b39f-cb4e004b8d44" "staging" "/" `{"recursive": true, "expandSecretReferences": true}` }} {{- range . }} {{- if eq .SecretPath "/"}} {{ .Key }}={{ .Value }} @@ -72,7 +72,7 @@ The secret template functions is what you will use to fetch resources such as st - **Function name**: `secret` + **Function name**: `listSecrets` **Description**: This function can be used to render the full list of secrets within a given project, environment and secret path. @@ -83,6 +83,43 @@ The secret template functions is what you will use to fetch resources such as st + + ```bash + listSecretsByProjectSlug "" "environment-slug" "" "" + ``` + ```bash example-template-usage-1 + {{- with listSecretsByProjectSlug "my-project" "dev" "/" `{"recursive": false, "expandSecretReferences": true}` }} + {{- range . }} + {{ .Key }}={{ .Value }} + {{- end }} + {{- end }} + ``` + ```bash example-template-usage-2 + {{- with listSecretsByProjectSlug "my-project" "staging" "/" `{"recursive": true, "expandSecretReferences": true}` }} + {{- range . }} + {{- if eq .SecretPath "/"}} + {{ .Key }}={{ .Value }} + {{- else}} + {{ .SecretPath }}/{{ .Key }}={{ .Value }} + {{- end}} + {{- end }} + {{- end }} + ``` + + + + **Function name**: `listSecretsByProjectSlug` + + **Description**: This function can be used to render the full list of secrets within a given project slug, environment and secret path. + + An optional JSON argument is also available. It includes the properties `recursive`, which defaults to false, and `expandSecretReferences`, which defaults to true and expands the returned secrets. + + + **Returns**: A list of secret objects, each with the following keys `Key, WorkspaceId, Value, SecretPath, Type, ID, and Comment` + + + + ```bash getSecretByName "" "" "" "" @@ -104,19 +141,19 @@ The secret template functions is what you will use to fetch resources such as st - + ```bash - dynamic_secret "" "" "" "" "" + dynamicSecret "" "" "" "" "" ``` ```bash example-redis-dynamic-secret - {{ with dynamic_secret "aaa-o7en-s5qm" "dev" "/" "redis" "1m" }} + {{ with dynamicSecret "aaa-o7en-s5qm" "dev" "/" "redis" "1m" }} {{ .DB_USERNAME }}={{ .DB_PASSWORD }} {{- end }} ``` - **Function Name**: `dynamic_secret` + **Function Name**: `dynamicSecret` **Description**: This function can be used to render a dynamic secret lease credentials. The credentials are automatically renewed before they expire, ensuring that the rendered credentials are always up-to-date. @@ -465,11 +502,11 @@ templates: command: ./reload-app.sh ``` -The secret template below will be used to render the secrets with the key and the value separated by `=` sign. You'll notice that a custom function named `secret` is used to fetch the secrets. -This function takes the following arguments: `secret "" "" ""`. +The secret template below will be used to render the secrets with the key and the value separated by `=` sign. You'll notice that a custom function named `listSecrets` is used to fetch the secrets. +This function takes the following arguments: `listSecrets "" "" ""`. ```text my-dot-ev-secret-template -{{- with secret "6553ccb2b7da580d7f6e7260" "dev" "/" }} +{{- with listSecrets "6553ccb2b7da580d7f6e7260" "dev" "/" }} {{- range . }} {{ .Key }}={{ .Value }} {{- end }}