-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor LDAP sync to sync service structure #340
Draft
JustSamuel
wants to merge
5
commits into
develop
Choose a base branch
from
refactor/user-sync-service
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
JustSamuel
force-pushed
the
refactor/user-sync-service
branch
from
September 30, 2024 00:17
a7fc805
to
28aa07a
Compare
Yoronex
reviewed
Sep 30, 2024
JustSamuel
force-pushed
the
refactor/user-sync-service
branch
10 times, most recently
from
October 2, 2024 14:04
4a524be
to
446691f
Compare
JustSamuel
changed the title
Refactor user sync service
Refactor LDAP sync to sync service structure
Oct 2, 2024
JustSamuel
force-pushed
the
refactor/user-sync-service
branch
from
October 6, 2024 20:45
cc05292
to
72f2e5b
Compare
JustSamuel
force-pushed
the
refactor/user-sync-service
branch
from
November 16, 2024 20:07
72f2e5b
to
7e88c03
Compare
JustSamuel
force-pushed
the
refactor/user-sync-service
branch
2 times, most recently
from
November 18, 2024 16:15
57d63f2
to
ef207b5
Compare
JustSamuel
force-pushed
the
refactor/user-sync-service
branch
from
November 20, 2024 13:17
ef207b5
to
24c9f3c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR changes the syncing of users to a user-first syncing. This means that instead of having different services scattered throughout the codebase, we focus on having a single interface that can be implemented and used in the general user sync.
A
sync-service
should implement async
,fetch
anddown
function. It can also be decided to override theguard
function if needed. The new syncing structure is as follows:The
user-sync-service
is akin to a compound design pattern and takes an array of services to use. Each of these services implements thesync
function, enabling the user to be synced with an external service. Thissync
has a result object which can indicate one of the following:A bad sync can be the case that the user does no longer exist in LDAP or the GEWISDB.
After the user has been synced by all the services, the following happens:
down
a user if all services returned a bad sync, or else do nothing.down
is the function which should clean up or remove data related to the user entity. For the LDAP sync this will be removing the LDAPAuthentication entry, but for the GEWISDB sync this will mean deactivating the user in SudoSOS as no longer existing in the GEWISDB is a reason to be deactivated. This bring us to the following question:Currently
down
is only called when all syncs are bad. Is this desired?Take the cases that a user becomes inactive and removed from AD. The LDAP sync will start to report bad syncs. This could be grounds to remove the user from the LDAP table. However only calling
down
when all syncs report bad feels safer as it makes for a build in safeguard. This is exceptionally clear from the other case, where a user is removed from GEWISDB but still exists in AD. This is strange, and we would expect a user to also be removed from LDAP. However if they are still in AD, they could still "login", meaning that removing their whole SudoSOS account could potentially lead to a duplicate being created if they login with LDAP.Therefore I am more inclined to go with the "all syncs should report bad" option. In the end, everything will still be cleaned. It will just take a bit longer with the safer route.
Related issues/external references
#330
Types of changes