-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add LDAP group sync to Teams, fixes #1395 #16299
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
Add LDAP group sync to Teams, fixes #1395 #16299
Conversation
@svenseeberg can you resolve conflicts :) PS: since its a pull from an org we maintainer cant apply code suggestions or resolve conflicts. if you need help just tell us. |
Right, should not be an issue. We will take care of rebasing on the current main branch. |
b6a6605
to
d7c98f0
Compare
I'll also look into the linting errors. |
|
you dont have to hurry we are currently in feature-freeze ... :) & we need some tests for this code |
d7c98f0
to
50ae1e1
Compare
Are there any specific requirements for the tests? Mocking an LDAP server is somewhat complicated ;-) However, we could easily test the functions that do not interact with the LDAP server. |
well we have unit tests who test selve contained functions or easy to moke on ... and we have integration tests: and we have a running ldap to test against (https://drone.gitea.io/go-gitea/gitea/41501/2/5) |
I guess we can work with that :-) |
We have some LDAP tests already which use a docker container for the LDAP. |
89335ed
to
28ba4d1
Compare
Codecov Report
@@ Coverage Diff @@
## main #16299 +/- ##
==========================================
+ Coverage 45.74% 46.14% +0.39%
==========================================
Files 831 839 +8
Lines 92178 92563 +385
==========================================
+ Hits 42171 42712 +541
+ Misses 43249 43066 -183
- Partials 6758 6785 +27
Continue to review full report at Codecov.
|
4b5e3d5
to
1e9b4dd
Compare
* Add setting for a JSON that maps LDAP groups to Org Teams. * Add log trace when removing or adding team members. * Sync is being run on login and periodically. * Existing group filter settings are reused. Co-authored-by: Giuliano Mele <mele@integreat-app.de> Co-authored-by: Sven Seeberg <mail@sven-seeberg.de>
e643649
to
cc27419
Compare
@6543 we updated our pull request an included tests. Can you please review? |
* Adding and removing team members. * Sync not existing LDAP group. * Login with broken group map JSON. Co-authored-by: Giuliano Mele <mele@integreat-app.de> Co-authored-by: Sven Seeberg <mail@sven-seeberg.de>
cc27419
to
673df99
Compare
5c705aa
to
023fd52
Compare
Thank you for your review @6543
Thanks in advance for your feedback |
Co-authored-by: Sven Seeberg <mail@sven-seeberg.de> Co-authored-by: Giuliano Mele <mele@integreat-app.de>
023fd52
to
3a032cc
Compare
@svenseeberg can you resolve conflicts :) (just do a merge of main and resolve - rebase or squash not required since pull's are squash-merged anyway) |
3a032cc
to
e311175
Compare
Oh sorry, I read this comment after I merged the PR. I added @wxiaoguang and @6543 as collaborators to our repo. |
Since the main branch has changed a lot (including the lint rules), there are some new work to do. Give me some more time. |
Fixing ... |
@wxiaoguang yes you did not adjust the tests appropriate |
ok two things need to be done:
@svenseeberg thanks - that will help :) |
Just tried the latest build and I can confirm that it works |
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.
tests PASS localy
🚀 |
Thank you all for your work on this! |
* giteaofficial/main: Send mail to issue/pr assignee/reviewer also when OnMention is set (go-gitea#18707) Reduce CI go module downloads, add make targets (go-gitea#18708) Add number in queue status to monitor page (go-gitea#18712) Fix source code line highlighting (go-gitea#18729) Fix forked repositories missed tags (go-gitea#18719) [skip ci] Updated translations via Crowdin Fix release typo (go-gitea#18728) Display template path of current page in dev mode (go-gitea#18717) Separate the details links of commit-statuses in headers (go-gitea#18661) Add LDAP group sync to Teams, fixes go-gitea#1395 (go-gitea#16299) Change git.cmd to RunWithContext (go-gitea#18693)
Is there a way to debug this feature? It doesn't create any Organizations for me with the latest Docker image. |
Actually this feature is not included, orgs and teams have to be created manually |
Has anybody written a short manual/tutorial on how to use this feature? |
This file contains an example for the Team Group Map field with the expected JSON format |
To elaborate a little on the previous answer: You need to have created the organizations and teams before you can sync LDAP users into them. To create the config and JSON you need to make sure that you have the following information:
|
Hi @svenseeberg ! First of all, thank you for your awesome work on this! 👏 Is it possible somehow to dynamically map LDAP nested groups as organizations and teams? Eg:
And later if I create a new main group, and a subgroup (in both LDAP and Gitea) and a new member in LDAP attach that user to the team in Gitea? |
I don't think that this can currently be done. The options for configuring the LDAP queries are very limited. |
If anyone's interested, I implemented an external solution to do this: |
* Add setting for a JSON that maps LDAP groups to Org Teams. * Add log when removing or adding team members. * Sync is being run on login and periodically. * Existing group filter settings are reused. * Adding and removing team members. * Sync not existing LDAP group. * Login with broken group map JSON.
fixes #1395