Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14069 from opf/chore/ldap-sync-login
Update users using their LDAP attributes when logging in
- Loading branch information
Showing
17 changed files
with
499 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Ldap | ||
class PostLoginSyncService < BaseService | ||
attr_reader :user, :update_attributes | ||
|
||
def initialize(ldap, user:, attributes:) | ||
super(ldap) | ||
|
||
@user = user | ||
@update_attributes = attributes | ||
end | ||
|
||
private | ||
|
||
def perform | ||
synchronize_user_attributes(user, update_attributes) | ||
rescue StandardError => e | ||
Rails.logger.error { "Failed to synchronize user after login #{ldap.name}: #{e.message}" } | ||
ServiceResult.failure(message: "Failed to synchronize user #{user.login}: #{e.message}") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.