InseeFr / InseeFr/sugoi-api

:bug: Searching groups on a non existing application result in 500 error

Open
#776 0 comments 0 reactions 1 assignee Claimed by @fjr3o6 View on GitHub
bug ldap store
Dominant language
Java
Stars
6
Forks
10
Avg merge
9h 15m
Merged PRs (30d)
4

Description

When searching groups on a non existing application 500 is returned with error :

```
fr.insee.sugoi.model.exceptions.StoreException: search failed
at fr.insee.sugoi.store.ldap.LdapReaderStore.searchOnLdap(LdapReaderStore.java:345)
at fr.insee.sugoi.store.ldap.LdapReaderStore.searchGroups(LdapReaderStore.java:191)
at fr.insee.sugoi.core.service.impl.GroupServiceImpl.findByProperties(GroupServiceImpl.java:146)
at fr.insee.sugoi.services.controller.GroupController.getGroups(GroupController.java:116)
....
Caused by: com.unboundid.ldap.sdk.LDAPSearchException: Unable to perform the search because base entry 'ou=applitest2_Objets,ou=applitest2,ou=Applications,o=insee,c=fr' does not exist in the server.
at com.unboundid.ldap.sdk.LDAPConnection.search(LDAPConnection.java:3994)
at fr.insee.sugoi.store.ldap.LdapReaderStore.searchOnLdap(LdapReaderStore.java:330)

```
for the example of : /realms/domaine1/applications/applitest2/groups on the embedded test server
An existence check of the app should be done before requesting the ldap. Otherwise a check on groups might be done in the controller.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.