-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Provide built-in(s) to do conversion between different string encoding types (base64, hex, etc) #7198
Comments
There's another avenue worth exploring: If you're using Wasm, and your Wasm SDK allows you to provide "SDK-dependent" builtins, you can
It's probably the quickest way to get what you want, compared to adding the new builtins as native and Wasm implementations.... Worth trying, at least. |
Yes, we're already doing that. It works, writing tests for policies require extra hoops though. But it would be nice to have it out of box since base64 inputs are very common in web scenarios. |
Personally, I'd go byte conversion way:
Kinda low level but in the end, we're dealing with bytes anyway. |
From the issue description, I'm thinking we could just have |
Yes. It will be the minimum that works. |
👍 I wouldn't mind that change... you see any issues with that @srenatus? |
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue. |
What is the underlying problem you're trying to solve?
When dealing with web stuff it's common to receive non-string inputs as base64 encoded strings. On the other hand, opa built-ins convert non-string stuff into hex strings. This creates issues when comparison is needed, for example:
Describe the ideal solution
Some built-in(s) that enables to do conversion between hex encoded strings and base64 encoded strings.
Maybe something more generic like:
Or something that returns byte array:
Describe a "Good Enough" solution
N/A
Additional Context
N/A
The text was updated successfully, but these errors were encountered: