Question

Using functions within an Auth ID property

  • 27 June 2022
  • 3 replies
  • 40 views

Userlevel 3
Badge +1

Hi there,

 

Can I use pipeline:user() in auth ID property in START JOBS Stage (Origin or Processor) ?

Example: 

${pipeline:user() == "819339ee-e7bc-XXX-bdef-XXXXXXXXX145@XXXX" 

credential:get("aws","all","ch/dev/secret&key") : 
credential:get("aws","all","ch/prod/secret&key")}

 

Validation is successful but the condition block always goes to retrieve “ch/prod/secret&key” even when the condition should evaluate to true.

====

Maybe I shouldn’t use the pipeline:user() function when I use a credential function as discussed in the documentation here,

https://docs.streamsets.com/portal/platform-datacollector/latest/datacollector/UserGuide/Configuration/CredentialStores.html#concept_bt1_bpj_r1b

 

Snippet from the documentation,

Important: When you use a credential function in a stage property, the function must be the only value defined in the property. For example, you cannot include another function or a literal value along with the credential function.

 

Can someone confirm this ?

 

Cheers,

Srini


3 replies

Userlevel 3
Badge

@Srinivasan Sankar AFAIK, you can not use it as stated in documentation.

Userlevel 3
Badge +1

@Srinivasan Sankar 

Can you please try the below code in your pipeline and check if it helps.

 

${str:matches(pipeline:user(),"f819339ee-e7bc-XXX-bdef-XXXXXXXXX145@XXXX") ? "Yes" : "No"}

I tried this code and i am getting “Yes” if it matches else “No”

 

Thanks & Regards,

Bikram_

Userlevel 5
Badge

@Srinivasan Sankar was Rishi’s and Bikram’s suggestions helpful? If so, Please mark one of them “best answer”.

Reply