Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages: Filters: Implement b64 decode #464

Closed
4 tasks done
fallen-up opened this issue Jul 5, 2024 · 1 comment · Fixed by #465
Closed
4 tasks done

Messages: Filters: Implement b64 decode #464

fallen-up opened this issue Jul 5, 2024 · 1 comment · Fixed by #465
Assignees
Labels
area/messages scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Milestone

Comments

@fallen-up
Copy link

fallen-up commented Jul 5, 2024

Issue submitter TODO list

  • I've looked up my issue in FAQ
  • I've searched for an already existing issues here
  • I've tried running main-labeled docker image and the issue still persists there
  • I'm running a supported version of the application which is listed here

Describe the bug (actual behavior)

in the old provectus version we could use groovy script:

String body = value.body.split(/\./)[1]
String unencoded = new String(Base64.decoder.decode(body), 'UTF-8')
unencoded.contains('aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee')

after removing groovy #98 try to do this:
base64decode(record.key.body.split('.')[1]).contains('aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee')

but we get an error:

400
CEL error. Original expression: base64decode(record.key.body.split('.')[1]).contains('aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'). Error message: ERROR: <input>:1:13: undeclared reference to 'base64decode' (in container '') | base64decode(record.key.body.split('.')[1]).contains('aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee') | ............^ ERROR: <input>:1:35: undeclared reference to 'split' (in container '') | base64decode(record.key.body.split('.')[1]).contains('aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee') | ..................................^

Expected behavior

No response

Your installation details

1.0

Steps to reproduce

Screenshots

No response

Logs

No response

Additional context

No response

@fallen-up fallen-up added status/triage Issues pending maintainers triage type/bug Something isn't working labels Jul 5, 2024
@kapybro kapybro bot added status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Jul 5, 2024
@Haarolean Haarolean changed the title Implement built-in methods for b64decode Messages: Filters: Implement b64 decode Jul 5, 2024
@Haarolean Haarolean added type/enhancement En enhancement/improvement to an already existing feature scope/backend Related to backend changes area/messages and removed type/bug Something isn't working status/triage/manual Manual triage in progress labels Jul 5, 2024
@Haarolean Haarolean self-assigned this Jul 5, 2024
@Haarolean Haarolean added this to the 1.1 milestone Jul 6, 2024
@Haarolean Haarolean linked a pull request Jul 7, 2024 that will close this issue
13 tasks
@Haarolean
Copy link
Member

Added encoders and strings
https://github.com/google/cel-java/blob/main/extensions/src/main/java/dev/cel/extensions/README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/messages scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants