mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
72fcd514f2
When evaluating arithmetic operations, numbers are converted from json.Number to big.Float and back again. Currently the conversion back to json.Number uses the big.Float Text() method with the 'g' format. This causes integers with 7 or more digits to be represented with a decimal point and exponent. This can be problematic when creating JWT tokens with "iat" and "exp" timestamps, as apparently some JWT parsing libraries do not handle NumericDate values formatted with decimal point and exponent. Instead, modify the FloatToNumber() conversion method to avoid the exponent format for numbers which are integers. Fixes #6013. Signed-off-by: Kenneth Jenkins <kjenkins@pomerium.com>