Dear Jens.
Please can you create a patch as mentioned in
https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING as suggested
in https://github.com/haproxy/haproxy/issues/2281#issuecomment-1721014384
Regards
Alex
On 2023-09-15 (Fr.) 14:57, Jens Popp wrote:
Hi,
currently the method sample_conv_query in sample.c returns an empty value, if
the given json path leads to an json array. There are multiple use cases, where
you need to check the content of an array, e.g., if the array contains a list
of roles and you want to check, if the array contains a certain role (for
OIDC). I propose the simple fix below, to copy the complete array (including
brackets) in the result of the function:
...(Line 4162)
case MJSON_TOK_ARRAY:
// We copy the complete array, including square
brackets into the return buffer
// result looks like:
["manage-account","manage-account-links","view-profile"]
strncpy( trash->area, token, token_size);
trash->data = token_size;
trash->size = token_size;
smp->data.u.str = *trash;
smp->data.type = SMP_T_STR;
return 1;
case MJSON_TOK_NULL:
... (currently Line 4164)
If possible I would also like to fix this in current stable release 2.8.
Changes are also in my fork,
https://github.com/jenspopp/haproxy/blob/master/src/sample.c#L4162-L4171
Any comment / help is appreciated.
Best regards
Jens
[X]
An Elisa camLine Holding GmbH company - www.camline.com
camLine GmbH - Fraunhoferring 9, 85238 Petershausen, Germany
Amtsgericht München HRB 88821
Managing Directors: Frank Bölstler, Evelyn Tag, Bernhard Völker
The content of this message is CAMLINE CONFIDENTIAL. If you are not the
intended recipient, please notify me, delete this email and do not use or
distribute this email.