Skip to content

Support for Java arrays in Native Types #1059

@dteleguin

Description

@dteleguin

Kudos to the team for releasing the amazing and long-awaited feature 👏

I would like to emphasize the importance of supporting Java arrays. This might become an issue when integrating CEL into software having a mature and stable data model. For example, JSON Web Token, a structure central to OAuth and OpenID Connect, is modeled in Keycloak as a Jackson-annotated value class. The audience parameter, which supports multiple values, is modeled as String[]. When trying to register the JsonWebToken with CEL, I'm getting the following error:

ERROR: Unsupported type for property 'audience' in class org.keycloak.representations.JsonWebToken
ERROR: Unsupported Java type for CEL mapping: [Ljava.lang.String;

As a workaround, I can parse the string representation of the JWT into a Protobuf Value, which is redundant and adds extra overhead. Also, I doubt we can convince Keycloak to change the type to List as it would be a huge breaking change to Keycloak and existing extensions. That said, it would be very nice to have a native support for Java arrays other than byte[] (for Keycloak, String[] in the first place).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions