[PR #106] [MERGED] feat: add LDAP sync #954

Closed
opened 2025-10-08 00:20:21 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/106
Author: @kmendell
Created: 1/12/2025
Status: Merged
Merged: 1/19/2025
Merged by: @stonith404

Base: mainHead: ldap-sync


📝 Commits (10+)

  • ad4356b feat: ldap sync begin work
  • 965191c feat(ldap-sync): add go-ldap
  • b6c4c0d feat(ldap-sync): add env varibles for ldap
  • 9eccfa3 feat(ldap-sync): add env varibles for ldap
  • 324d83b feat(ldap-sync): updated .env.example with ldap config
  • a4f281e feat(ldap-sync): added basic ldapInit() function
  • 577de76 feat(ldap-sync): added query function
  • 6fda6f4 feat(ldap-sync): added a few error checks for my testing
  • c019676 feat(ldap-sync): updated .env.example
  • 0dda254 feat(ldap-sync): updated readme with the ldap env vars so far

📊 Changes

46 files changed (+911 additions, -111 deletions)

View changed files

📝 README.md (+2 -1)
📝 backend/.env.example (+1 -1)
📝 backend/.gitignore (+2 -1)
📝 backend/go.mod (+8 -5)
📝 backend/go.sum (+90 -0)
📝 backend/internal/bootstrap/router_bootstrap.go (+5 -1)
📝 backend/internal/common/env_config.go (+2 -1)
📝 backend/internal/common/errors.go (+17 -1)
📝 backend/internal/controller/app_config_controller.go (+13 -0)
📝 backend/internal/controller/user_controller.go (+4 -3)
📝 backend/internal/controller/user_group_controller.go (+1 -1)
📝 backend/internal/dto/app_config_dto.go (+26 -12)
📝 backend/internal/dto/user_dto.go (+2 -0)
📝 backend/internal/dto/user_group_dto.go (+3 -0)
backend/internal/job/ldap_job.go (+39 -0)
📝 backend/internal/model/app_config.go (+18 -2)
📝 backend/internal/model/user.go (+1 -0)
📝 backend/internal/model/user_group.go (+2 -1)
📝 backend/internal/service/app_config_service.go (+67 -4)
backend/internal/service/ldap_service.go (+261 -0)

...and 26 more files

📄 Description

PoC of users from ldap so far, Drafting this PR for code review first, and we can continue on from there.

TODO

  • If a user is removed from LDAP the user does not get deleted in pocket-id dbc8e38229
  • Add a LDAP Claim for Admin Rights in Pocket ID 3443d4a711
  • Admins Shouldn't be able to Delete users synced from LDAP in the UI? Maybe they should?
  • We need to create the Postgres migration for the LDAP ID and GROUP ID value in the DB. f3cc45d918
  • Fix the initial setup because it doesn't work anymore.
    • This should be fixed now that ldap is not enabled by ENV Variables, so no users will get synced on launch.
  • Add and edit e2e tests
  • Merge and Bump version and Release

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/106 **Author:** [@kmendell](https://github.com/kmendell) **Created:** 1/12/2025 **Status:** ✅ Merged **Merged:** 1/19/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `ldap-sync` --- ### 📝 Commits (10+) - [`ad4356b`](https://github.com/pocket-id/pocket-id/commit/ad4356b9fa8b6f5e1008bff5f26dec15cded672b) feat: ldap sync begin work - [`965191c`](https://github.com/pocket-id/pocket-id/commit/965191c53736d53b0800480c54d6aedab230d0b6) feat(ldap-sync): add go-ldap - [`b6c4c0d`](https://github.com/pocket-id/pocket-id/commit/b6c4c0d5611d776462004b41bfdc28b150a394af) feat(ldap-sync): add env varibles for ldap - [`9eccfa3`](https://github.com/pocket-id/pocket-id/commit/9eccfa3473f256764c76613bad3762daa2346712) feat(ldap-sync): add env varibles for ldap - [`324d83b`](https://github.com/pocket-id/pocket-id/commit/324d83b1c6dc5c83e6f6b78270810323d3141d18) feat(ldap-sync): updated .env.example with ldap config - [`a4f281e`](https://github.com/pocket-id/pocket-id/commit/a4f281e8792e5119293d70e1bacf82b4f313fde7) feat(ldap-sync): added basic ldapInit() function - [`577de76`](https://github.com/pocket-id/pocket-id/commit/577de76bd7b47c0d17a4b7d7e2ec942cca37810a) feat(ldap-sync): added query function - [`6fda6f4`](https://github.com/pocket-id/pocket-id/commit/6fda6f4a1ad9702be75d84feecf02fb5fa1f437c) feat(ldap-sync): added a few error checks for my testing - [`c019676`](https://github.com/pocket-id/pocket-id/commit/c019676c02dadab61a2a5676c2c79c523b67d99b) feat(ldap-sync): updated .env.example - [`0dda254`](https://github.com/pocket-id/pocket-id/commit/0dda25498fefbbd5a21f99d65c2508ff40dc406c) feat(ldap-sync): updated readme with the ldap env vars so far ### 📊 Changes **46 files changed** (+911 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -1) 📝 `backend/.env.example` (+1 -1) 📝 `backend/.gitignore` (+2 -1) 📝 `backend/go.mod` (+8 -5) 📝 `backend/go.sum` (+90 -0) 📝 `backend/internal/bootstrap/router_bootstrap.go` (+5 -1) 📝 `backend/internal/common/env_config.go` (+2 -1) 📝 `backend/internal/common/errors.go` (+17 -1) 📝 `backend/internal/controller/app_config_controller.go` (+13 -0) 📝 `backend/internal/controller/user_controller.go` (+4 -3) 📝 `backend/internal/controller/user_group_controller.go` (+1 -1) 📝 `backend/internal/dto/app_config_dto.go` (+26 -12) 📝 `backend/internal/dto/user_dto.go` (+2 -0) 📝 `backend/internal/dto/user_group_dto.go` (+3 -0) ➕ `backend/internal/job/ldap_job.go` (+39 -0) 📝 `backend/internal/model/app_config.go` (+18 -2) 📝 `backend/internal/model/user.go` (+1 -0) 📝 `backend/internal/model/user_group.go` (+2 -1) 📝 `backend/internal/service/app_config_service.go` (+67 -4) ➕ `backend/internal/service/ldap_service.go` (+261 -0) _...and 26 more files_ </details> ### 📄 Description PoC of users from ldap so far, Drafting this PR for code review first, and we can continue on from there. ## TODO - [x] If a user is removed from LDAP the user does not get deleted in pocket-id https://github.com/stonith404/pocket-id/pull/106/commits/dbc8e3822935da149570c7fbab9cf2553fcc1056 - [x] Add a LDAP Claim for Admin Rights in Pocket ID https://github.com/stonith404/pocket-id/pull/106/commits/3443d4a7112079c9b3d7a06da9a77acd65fba02e - [x] Admins Shouldn't be able to Delete users synced from LDAP in the UI? Maybe they should? - [x] We need to create the Postgres migration for the LDAP ID and GROUP ID value in the DB. https://github.com/stonith404/pocket-id/pull/106/commits/f3cc45d918517448c580a03c540c9118ccd51ad0 - [x] Fix the initial setup because it doesn't work anymore. - This should be fixed now that ldap is not enabled by ENV Variables, so no users will get synced on launch. - [x] Add and edit e2e tests - [ ] Merge and Bump version and Release --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-08 00:20:22 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#954