Skip to main content
Question

Using functions within an Auth ID property


Forum|alt.badge.img+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

Rishi
StreamSets Employee
Forum|alt.badge.img
  • StreamSets Employee
  • 96 replies
  • June 28, 2022

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


Bikram
Headliner
Forum|alt.badge.img+1
  • Headliner
  • 486 replies
  • June 29, 2022

@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_


Drew Kreiger
Rock star
Forum|alt.badge.img
  • Senior Community Builder at StreamSets
  • 95 replies
  • July 26, 2022

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


Reply