|
I understand the motivation, but I don't quite understand why we'd use YAML for this instead of JSON to solve the problem. The fundamental problem is that there's no nested structure in the config file. You can introduce it with JSON, a much simpler notation. The important thing is just that we need nested hierarchical objects in config files, and not just a flat keyvalue list of dumb string values. JSON would meet that goal. I just personally find YAML very difficult and line-indent-oriented, and there's too many ways to write the same thing. I mean, this would be the same thing in JSON, which seems to be a similar gain over the original.
{
|
"userToDNMapping": [
|
{
|
"match": "(ldapz_kerberos1)@LDAPTEST.10GEN.CC",
|
"substitution": "cn={0},ou=org,dc=domain,dc=example"
|
},
|
{
|
"match": "(ldapz_kerberos2@LDAPTEST.10GEN.CC)",
|
"ldapQuery": "ou=org,dc=domain,dc=example??one?krbPrincipalName={0}"
|
}
|
]
|
}
|
|
|
Today userToDNMapping works like:
userToDNMapping: '[{match: "(ldapz_kerberos1)@LDAPTEST.10GEN.CC", substitution: "cn={0},ou=org,dc=domain,dc=example"},{match: "(ldapz_kerberos2@LDAPTEST.10GEN.CC)", ldapQuery: "ou=org,dc=domain,dc=example??one?krbPrincipalName={0}"}]'
|
With this change it would resemble:
userToDNMapping:
|
-
|
match: "(ldapz_kerberos1)@LDAPTEST.10GEN.CC"
|
substitution: "cn={0},ou=org,dc=domain,dc=example"
|
-
|
match: "(ldapz_kerberos2@LDAPTEST.10GEN.CC)"
|
ldapQuery: "ou=org,dc=domain,dc=example??one?krbPrincipalName={0}"
|
|