Files
releases/topdown/builtins
Kenneth Jenkins 72fcd514f2 topdown: Format integer numbers without exponent
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>
2023-06-20 11:32:36 -07:00
..