Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions core/src/main/java/io/kestra/plugin/core/debug/Return.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,36 @@ Handy for troubleshooting (the rendered value is logged) or for generating small
"""
),
@Example(
full = true,
code = """
id: compute_header
type: io.kestra.plugin.core.debug.Return
format: >-
{%- if inputs.token is not empty -%}
Bearer {{ inputs.token }}
{%- elseif inputs.username is not empty and inputs.password is not empty -%}
Basic {{ (inputs.username + ':' + inputs.password) | base64encode }}
{%- endif -%}
id: return
namespace: company.team

inputs:
- id: token
type: STRING
required: false
displayName: "API Token"

- id: username
type: STRING
displayName: "Username"
required: false

- id: password
type: STRING
displayName: "Password"
required: false

tasks:
- id: compute_header
type: io.kestra.plugin.core.debug.Return
format: >-
{%- if inputs.token is not empty -%}
Bearer {{ inputs.token }}
{%- elseif inputs.username is not empty and inputs.password is not empty -%}
Basic {{ (inputs.username + ':' + inputs.password) | base64encode }}
{%- endif -%}
"""
)
},
Expand Down
Loading