Skip to content

Use special characters / template parameters / escape sequences in default values of custom attribute #227

@marcel-sachtleben

Description

@marcel-sachtleben

Version
Latest Docker Image (Container SHA: sha256:5987992f57267ae4360b82caa40b2eb90598560e51f6826926f8f385cbcec52b)

Describe the bug
When I use default attributes with labels, values and defaults, I am neither able to use pre-defined variables like {first_name} or {last_name} nor can I use special characters like ":" since it is already the delimiter of the triplet "attribute:label:default"

How can I escape special characters and make default template substitution work?

Example 1:
LDAP_ACCOUNT_ADDITIONAL_ATTRIBUTES: "mailHomeDirectory:Mail Home Directory:/var/mail/alpha-architect.com/{first_name}.{last_name}"

If I use e.g.
First Name = Marcel
Last Name = Sachtleben

it will still fill the value "var/mail/alpha-architect.com/{first_name}.{last_name}" without replacing the template parameters.

I have tried escaping "{" and "}" with backslash \ and I have also tried adding a "$" in front of the curly braces with no success.

Example 2:
LDAP_ACCOUNT_ADDITIONAL_ATTRIBUTES: "mailStorageDirectory:Mail Storage Directory:maildir:~/mail"

Problem here is that the default value "maildir:~/mail" contains a colon ":" which I have no idea, how to escape.
Backslash is treated as normal character.

Meaning, the value is set to "maildir" because it cuts the last part with ":~/mail".
Probably the code is splitting by ":" and uses the first 3 parts, ignoring the 4th part in this case.

Can you please give me a solution to be able to use default template variables and special characters in custom attributes default values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions