ditto icon indicating copy to clipboard operation
ditto copied to clipboard

JWT placeholder resolving does not correctly expand nested arrays

Open thjaeckle opened this issue 7 months ago • 0 comments

Question #1984 brought up an issue with the jwt placeholder.

Given the following JWT:

{
  "authorization": {
    "permissions": [
      {
        "scopes": [ "device.read" ],
        "resource_set_id": "123456"
      },
      {
        "scopes": [  "device.read", "device.write" ],
        "resource_set_id": "987654"
      }
    ]
  }
}

And given the following placeholder:

{{ jwt:authorization/permissions/scopes }}

It would be expected that this resolves to:

issuer:device.read
issuer:device.write

Due to the nature of "flattening" arrays. This however does not work, it resolves to no subjects at all..

The JWT placeholder implementation currently seems to only "flatten" arrays at top level.

It should work "recursively", in arbitrary nested JsonObject / JsonArray constellations.

thjaeckle avatar Jul 18 '24 09:07 thjaeckle