[ 
https://issues.apache.org/jira/browse/CAMEL-18802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17644660#comment-17644660
 ] 

Claus Ibsen edited comment on CAMEL-18802 at 12/8/22 8:31 AM:
--------------------------------------------------------------

Adding a new function base64-key you can use for this, so it should be

{code}
serviceAccountKey: "{{base64-key:?serviceAccountKey}}"
{code}

An alternative is to have key: as a special prefix that refers to a property key

{code}
serviceAccountKey: "{{base64:key:?serviceAccountKey}}"
{code}

{code}
serviceAccountKey: "{{base64:?serviceAccountKey}}"
{code}

And then if you want to decode a specific value we can have decode: as prefix 
instead

{code}
serviceAccountKey: "{{base64:decode:Q2FtZWw==}}"
{code}



was (Author: davsclaus):
Adding a new function base64-key you can use for this, so it should be

{code}
serviceAccountKey: "{{base64-key:?serviceAccountKey}}"
{code}

> Optional properties: if encoded the optional doesn't have any effect
> --------------------------------------------------------------------
>
>                 Key: CAMEL-18802
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18802
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Andrea Cosentino
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 3.20.0
>
>
> Suppose you have something like:
> {code:java}
>   template:
>     from:
>       uri: "google-storage://{{bucketNameOrArn}}"
>       parameters:
>         autoCreateBucket: "{{autoCreateBucket}}"
>         serviceAccountKey: "base64:{{serviceAccountKey}}"
>         deleteAfterRead: "{{deleteAfterRead}}"
> {code}
> and you want to have serviceAccountKey as optional parameter. If you prefix 
> the parameter with '?', like
> {code:java}
>   template:
>     from:
>       uri: "google-storage://{{bucketNameOrArn}}"
>       parameters:
>         autoCreateBucket: "{{autoCreateBucket}}"
>         serviceAccountKey: "base64:{{?serviceAccountKey}}"
>         deleteAfterRead: "{{deleteAfterRead}}"
> {code}
> We'll try to encode the value anyway, even if not specified.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to