Skip to content

Commit

Permalink
[ENH] ✨ allow to add realm description on ui-side
Browse files Browse the repository at this point in the history
Signed-off-by: Donatien Eneman <[email protected]>
  • Loading branch information
Donatien26 authored and micedre committed Aug 2, 2021
1 parent 9643887 commit 9edea43
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
public class GlobalKeysConfig {

public static final String REALM = "realm";
public static final String REALM_DESCRIPTION = "description";

public static final String USERSTORAGE = "userStorage";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ inseepropriete: applicationMapping$name:ou,String,rw
inseepropriete: groupMapping$name:cn,String,rw
inseepropriete: groupMapping$description:description,String,rw
inseepropriete: groupMapping$users:uniquemember,list_user,rw
inseepropriete: description$Le profil domaine2


dn: cn=monUserStorage,cn=Profil_domaine2_WebServiceLdap,cn=profil-contact-WebServicesLdap,ou=We
bServicesLdap_Objets,ou=WebServicesLdap,ou=Applications,o=insee,c=fr
Expand Down Expand Up @@ -210,6 +212,7 @@ description: domaine2
dn: cn=Profil_domaine1_WebServiceLdap,cn=profil-contact-WebServicesLdap,ou=We
bServicesLdap_Objets,ou=WebServicesLdap,ou=Applications,o=insee,c=fr
cn: Profil_domaine1_WebServiceLdap
description: Le profil domaine2<br/>Test <b>html</b> in description
objectclass: inseeOrganizationalRole
inseepropriete: ldapUrl$localhost
inseepropriete: ldapPort$10389
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spring.main.allow-bean-definition-overriding=true
logging.level.root=Info
logging.level.root=INFO


## LOADERCONFIG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public static Realm mapFromSearchEntry(SearchResultEntry searchResultEntry) {
Realm realm = new Realm();
// this means we can't have _ in a realm name !
realm.setName(searchResultEntry.getAttributeValue("cn").split("_")[1]);
realm.addProperty(
GlobalKeysConfig.REALM_DESCRIPTION, searchResultEntry.getAttributeValue("description"));
String[] inseeProperties = searchResultEntry.getAttributeValues("inseepropriete");
for (String inseeProperty : inseeProperties) {
String[] property = inseeProperty.split("\\$", 2);
Expand All @@ -54,6 +56,7 @@ public static Realm mapFromSearchEntry(SearchResultEntry searchResultEntry) {
realm.addProperty(GlobalKeysConfig.APP_MANAGED_ATTRIBUTE_PATTERNS_LIST, property[1]);
} else if (property[0].equalsIgnoreCase("sort_key")) {
realm.addProperty(LdapConfigKeys.SORT_KEY, property[1]);

} else if (property[0].equalsIgnoreCase("groupMapping")
|| property[0].equalsIgnoreCase("applicationMapping")) {
if (!realm.getMappings().containsKey(property[0])) {
Expand Down

0 comments on commit 9edea43

Please sign in to comment.