nickel
nickel copied to clipboard
base64 encoding in stdlib
In #1498 I need to base64 encode some values for inclusion into a kubernetes secret.
Currently I'm doing that with the coreutils base64
command at nix eval time.
I would prefer to express the fact that values get base64 encoded directly in the nickel template.
For that a function in std to base64 encode a string would be ideal.
It would be great if the entire space of possibilities (standard charset, urlsafe charset, padded, unpadded) was available for future purposes.
That's a fair demand and probably cheap to implement. We'd make that a primop relying on a Rust implementation under the hood, for performance reason.
By the way, both your feature requests are arguably beginner-friendly. If you would like to try to tackle them by yourself, I would be happy to provide guidance and review.
By the way, both your feature requests are arguably beginner-friendly. If you would like to try to tackle them by yourself, I would be happy to provide guidance and review.
I would certainly be open to giving it a shot but it'll be quite some time until I will likely be able to get around to working on it.
The dayjob and freelancing is keeping me quite busy :/
Unrelated to your request but for what it's worth, Secret
has a write-only stringData
field that gets merged into data
by the API server https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#secret-v1-core