[keycloak-dev] IDs/names for Mapper Type Properties

Vaclav Muzikar vmuzikar at redhat.com
Fri Oct 2 13:36:22 EDT 2015


Hi all,
I'd like to discuss missing @id and @name attributes on UI elements of
Mapper Type Properties (related issue:
https://issues.jboss.org/browse/KEYCLOAK-1885).
This concerns e.g. creating/editing a Client Protocol Mapper. When you
choose the Mapper Type, the following properties (like "Token Claim Name"
in case of "Hardcoded Claim") don't have any @id or @name.
This properties are used on more places all over the Keycloak (the template
is "kc-provider-config.html" in "keycloak-forms-common-themes" module).

At QE we'd like to add @id for every of these elements so we don't need to
use relative XPath locators based on labels, AngularJS
directives/attributes etc. which could be unstable.

The problem is there's no suitable (object) attribute of these properties
to use as HTML @id or @name.
The closest thing to this is the mapperType.property.name but it's using
illegal characters (spaces) for @id in some cases. E.g. "Claim value" uses
the "claim.value" name which is OK but "Claim JSON Type" uses "Claim JSON
Type" name (yes, the name is same as the label) which can't be used in HTML
as @id because of spaces.

I've got some solutions on my mind.

*1) Replacing the spaces on the client site (using AngularJS
controllers)* which
is probably not a nice solution. The Mapper Types (and it's properties) are
used on more than one sites/controllers and I haven't found any global
getter or something like that for Mapper Types which could contain this
replacement code. As far as I know, Mapper Types are fetched using
ServerInfo service. But this service is pretty abstract and simple so I
don't think it's a good idea to do the replacement there.
That means we need to add some getter and rewrite the controllers to use
this getter or copy-paste the replacement code all over the controllers
which is obviously out of the question.

*2) Add a new ID attribute to the REST API* so the ServerInfo service would
distribute this attribute to all controllers and templates.

*3) Change the "name" attributes* so it can be used as @id. Possible
problem could be compatibility and migration of
current  Keycloak installations to the newer version.

Can come upon any other solution? Could you implement any of it?

Thank you!

Best regards,
Václav Muzikář
Keycloak QE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20151002/8cbbc8ac/attachment.html 


More information about the keycloak-dev mailing list