google / cel-spec

Common Expression Language -- specification and binary representation
https://cel.dev
Apache License 2.0
2.78k stars 222 forks source link

Extract function #222

Closed michalstefanext closed 2 years ago

michalstefanext commented 2 years ago

I am not able to find/figure out, how to use "extract" function (https://cloud.google.com/iam/docs/conditions-attribute-reference#extract). Would you be able to provide some small example or give me some direction at least please? Right now, whatever I try, I always get:

Exception in thread "main" org.projectnessie.cel.tools.ScriptCreateException: check failed: ERROR: :1:22: undeclared reference to 'extract' (in container '')

for this: Script script = scriptHost.buildScript("assertion.arn.extract('{account_arn}/assumed-role')")

I simply am unable to find out, how to define the identifier (account_arn) of extract method.

Thanks!

liubog2008 commented 2 years ago

how about this problem? @michalstefanext