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

Fixes #24749: Disabled LDAP users can still login and use Rudder #5615

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class AppConfigAuth extends ApplicationContextAware {
* Map an user from XML user config file
*/
@Bean def rudderXMLUserDetails: UserDetailsContextMapper = {
new RudderXmlUserDetailsContextMapper(RudderConfig.rudderUserListProvider)
new RudderXmlUserDetailsContextMapper(rudderUserDetailsService)
}

// userSessionLogEvent must not be lazy, because not used by anybody directly
Expand Down Expand Up @@ -432,7 +432,7 @@ class RudderInMemoryUserDetailsService(val authConfigProvider: UserDetailListPro
/**
* Spring context mapper
*/
class RudderXmlUserDetailsContextMapper(authConfigProvider: UserDetailListProvider) extends UserDetailsContextMapper {
class RudderXmlUserDetailsContextMapper(userDetailsService: UserDetailsService) extends UserDetailsContextMapper {
// we are not able to try to save user in the XML file
def mapUserToContext(user: UserDetails, ctx: DirContextAdapter): Unit = ()

Expand All @@ -441,11 +441,7 @@ class RudderXmlUserDetailsContextMapper(authConfigProvider: UserDetailListProvid
username: String,
authorities: Collection[? <: GrantedAuthority]
): UserDetails = {
authConfigProvider.authConfig.users
.getOrElse(
username,
RudderUserDetail(RudderAccount.User(username, ""), UserStatus.Disabled, Set(Role.NoRights), ApiAuthorization.None)
)
userDetailsService.loadUserByUsername(username)
}
}

Expand Down