Files
Charlie Egan 14ff052432 builtins: Marshal JWT encode sign inputs as JSON
Fixes https://github.com/open-policy-agent/opa/issues/6925

This change modifies the `io.jwt.encode_sign` built-in to marshal the
parameters as JSON before signing the JWT. The previous implementation
was using String(), which was a sort of pseudo-JSON that was almost
correct but used the wrong JSON syntax for the set type.

I have chosen to marshal the headers in the same way as the payload as
the 'crit' header can also be an array type. I marshal the signature the
same way for consistency with the other two.

Signed-off-by: Charlie Egan <charlie@styra.com>
2024-08-15 09:02:21 -07:00
..
2023-08-31 12:29:49 +02:00