Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-configure an ObjectDirectoryMapper bean and configure LdapTemplate to use it #44249

Open
jzheaux opened this issue Feb 13, 2025 · 1 comment
Labels
type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Feb 13, 2025

Related to spring-projects/spring-ldap#633, it would be nice if Spring Boot picked up a ObjectDirectoryMapper bean:

@Bean
@ConditionalOnMissingBean(LdapOperations.class)
public LdapTemplate ldapTemplate(LdapProperties properties, ContextSource contextSource, 
        ObjectDirectoryMapper objectDirectoryMapper) {
        // ...
	LdapTemplate ldapTemplate = new LdapTemplate(contextSource);
	ldapTemplate.setObjectDirectoryMapper(objectDirectoryMapper);
	return ldapTemplate;
}

As of Spring LDAP 3.3.0-M2, Spring Boot can import ObjectDirectoryMapperConfiguration to publish a ObjectDirectoryMapper bean.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 13, 2025
@wilkinsona
Copy link
Member

wilkinsona commented Feb 13, 2025

Thanks, @jzheaux. Unfortunately, I'm not sure that we can use ObjectDirectoryMapperConfiguration in Boot as the use of @Fallback will mean that it doesn't quite behave as users might expect. When it backs off due to a user-defined ObjectDirectoryMapper, that information won't be available in the condition evaluation report. I think the converter registration may also require a different approach so that it works consistently in a Boot app as it seems to be sensitive to the conversion service's name at the moment.

@wilkinsona wilkinsona changed the title LdapTemplate bean should pick up a ObjectDirectoryMapper bean Auto-configure an ObjectDirectoryMapper bean and configure LdapTemplate to use it Feb 13, 2025
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 13, 2025
@wilkinsona wilkinsona added this to the 3.x milestone Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants