-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: Refactor ldap-sync + implement new sync sources #49
Conversation
This is the first proposition for how to approach extending the ldap-sync. Here, using a partner's endpoint to get the emails of users that they want us to delete from Zitadel, we wouldn't need LDAP at all. The library One thing I am pondering -> if taking this approach and sidestepping the LDAP altogether, this might eventually become a |
Yeah, that's the idea. For situations where the deactivate-only source is used, LDAP isn't relevant. I'm also fairly certain that method exists already, I think I used it in tests?
Yep, we agreed to rename this to I think the primary difficulty is finding the correct level of abstraction for the "source" concept. Maybe it's enough to just implement lots of Tests will also likely become more complex. For this particular source, wiremock is probably the way to go, but for others we'll probably need other docker test environments, which should be launched when appropriate with test groups so that the services don't interfere with each other. |
Okay, makes perfect sense then :) |
I think the better approach would be to not separate trait DataSource {
async fn get_data() -> Stream<DataEntry>; // or Vec
}
fn asdf() {
let changes = match config.source {
Ldap => LdapSource::new().get_data(),
Endpoint => Endpoint::new().get_data(),
};
...
} However if we want to combine a few sources, that might be tricky: struct DataSourcesConfig {
get_new: DataSource,
get_updated: DataSource,
get_deleted: DataSource,
} |
Major changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going in the right direction, sorry, I know you're not done but had a skim through since I saw the most recent comment
6f3edb9
to
5081d0e
Compare
The provided api spec for deactivation endpoint is extremely client specific, I think we should either name that data source using client name (like |
Thanks for the comments. Valid points, good perspectives. I like how it's crystalizing. Will come up with next version soon-ish. |
I will nudge the next version in a slightly new direction. To give it a fresh perspective. Because when we step back for a moment, do we really think that having a trait for unifying the sources actually makes sense? Consider the fact that the sources are too diverse. They can supply a completely different matrix of data combinations. At this moment, we have only two sources, and already now it's tangled with Let me present a simplified solution tomorrow and you will let me know how you feel about it. |
There is a question we need to address. So, UKT provides us with a list of email we should delete from Zitadel. In We have three methods to get users at the moment in
I assume this might change quite soon, when the But the question remains for this PR: is supplying an email to Is there a way to test this in a real environment to be sure? |
Maybe abstracting over identifiers can be an option? enum Id {
Login(String),
Nick(String),
Id(String),
} or enum IdType { Login, Nick, Id }
type Id = (String, IdType) But it has to be tested whether this possible to implement |
@sirewix I don't want to discuss the implementation in
It most probably will work, because this is a code that has been in the
|
So I pushed a new version. This is a solution that makes more sense to me. That is:
Please have a look and hopefully this makes sense to you as well. |
Another question - is it necessary to update |
I added CSV Source support as well as per /issues/52 |
Pending: e2e tests for new sources. |
I have setup the connection and the mail is used as loginname |
Thanks for the confirmation, Niklas 👍 |
f3b5c70
to
4e5d0c5
Compare
4e5d0c5
to
ae94c48
Compare
LCOV of commit
|
74b7c35
to
c60bd80
Compare
LGTM except few nits 👍 |
9b2bf19
to
62fe051
Compare
Closes #2373