terraform-provider-keycloak icon indicating copy to clipboard operation
terraform-provider-keycloak copied to clipboard

Declarative User Profile : Annotations & validator config as Json

Open jermarchand opened this issue 2 years ago • 1 comments

Hello,

In "Declarative User Profile", Annotations and Validators are not just map[string]string, it should be map[string]interface{}

In Terraform, an attribut (in a map) for a resource cannot be String or Object in the same time (Generics missing ;))

With this PR, the workaround I propose is to serialize the object as a Json string.

Hope this will help

jermarchand avatar Jul 07 '22 09:07 jermarchand

Also, when I use an object as a key for an annotation, like this:

    annotations = {
      bar = jsonencode({
        "hello" = "world"
      })
    }

it ends up looking like this on the keycloak side:

image

That doesn't seem right to me, is this something you'd expect?

Hi @mrparkers It seems OK to me, it is just a display limitation on Keycloak side, but we see it's an object and then can go to JSON editor to get more details ?

daviddelannoy avatar Aug 05 '22 10:08 daviddelannoy

Sorry for nagging but is there any progress on this one? We need to be able to create a profile attribute which have a list as validator configuration and an object as annotation. It is for a select input with given options.

Anything we can do to help out?

Thanks

nickej avatar Aug 19 '22 08:08 nickej

Hi @mrparkers

Do you plan to make a new tag soon ? We require this feature and would like to use it :)

Thanks

daviddelannoy avatar Oct 10 '22 16:10 daviddelannoy