Skip to content

feature: rebasing and working on LDAP commands#550

Merged
bupd merged 15 commits into
goharbor:mainfrom
NucleoFusion:feat/ldap
Oct 7, 2025
Merged

feature: rebasing and working on LDAP commands#550
bupd merged 15 commits into
goharbor:mainfrom
NucleoFusion:feat/ldap

Conversation

@NucleoFusion

@NucleoFusion NucleoFusion commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR introduces LDAP commands to the CLI, enhancing Harbor's capabilities by allowing the management and import of LDAP users directly through the command line interface.

The addition of LDAP commands follows the recent integration of configuration commands #114 into the CLI. The configuration commands provide a foundational framework that allows administrators to set and manage Harbor configurations from the command line. By building on this foundation, the LDAP commands leverage the existing configuration setup, ensuring that user management aligns seamlessly with the configured LDAP settings.

Added Commands:

  • ldap ping - Test and refactor if required
    • ping the ldap server testing the connection.
  • ldap search - test and refactor if required
    • search the ldap users with id.
  • ldap import
    • import users with their id.

Conclusion:

This enhancement significantly improves the operational efficiency and capabilities of Harbor's CLI. It makes LDAP user management more accessible, quicker, and more integrated.

Signed-off-by: bupd <bupdprasanth@gmail.com>
This command allows to ping the ldap server from the cli

Signed-off-by: bupd <bupdprasanth@gmail.com>
@codecov

codecov Bot commented Sep 17, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 3.12500% with 124 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.70%. Comparing base (60ad0bd) to head (88a1838).
⚠️ Report is 49 commits behind head on main.

Files with missing lines Patch % Lines
pkg/api/ldap_handler.go 0.00% 51 Missing ⚠️
cmd/harbor/root/ldap/ping.go 0.00% 31 Missing ⚠️
cmd/harbor/root/ldap/import.go 0.00% 16 Missing ⚠️
cmd/harbor/root/ldap/cmd.go 0.00% 13 Missing ⚠️
cmd/harbor/root/ldap/search.go 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #550      +/-   ##
=========================================
- Coverage   10.99%   6.70%   -4.29%     
=========================================
  Files         173     258      +85     
  Lines        8671   15379    +6708     
=========================================
+ Hits          953    1031      +78     
- Misses       7612   14241    +6629     
- Partials      106     107       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
@bupd bupd mentioned this pull request Sep 24, 2025
4 tasks
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
@NucleoFusion NucleoFusion marked this pull request as ready for review September 24, 2025 08:57
@NucleoFusion NucleoFusion changed the title [WIP] feature: rebasing and working on LDAP commands feature: rebasing and working on LDAP commands Sep 30, 2025
@bupd bupd self-requested a review September 30, 2025 13:09
@Vad1mo Vad1mo requested review from Copilot and removed request for bupd September 30, 2025 13:10

@bupd bupd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces LDAP commands to the Harbor CLI, enabling administrators to manage and import LDAP users directly through the command line interface. The implementation builds on the existing configuration framework to provide seamless integration with Harbor's LDAP settings.

  • Adds new LDAP API handlers for user search, server ping, user import, and group search operations
  • Implements three CLI commands: ldap ping, ldap search, and ldap import for LDAP server management
  • Updates documentation with comprehensive man pages and CLI documentation for all new LDAP commands

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

File Description
pkg/api/ldap_handler.go New API handlers for LDAP operations including user search, server ping, user import, and group search
cmd/harbor/root/ldap/*.go CLI command implementations for ldap ping, search, and import subcommands
cmd/harbor/root/cmd.go Integration of LDAP commands into the main CLI structure
doc/ Documentation updates including man pages and CLI docs for all new LDAP commands

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread cmd/harbor/root/ldap/import.go Outdated
Comment thread cmd/harbor/root/ldap/import.go Outdated
NucleoFusion and others added 2 commits September 30, 2025 18:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Nucleo Fusion <148791547+NucleoFusion@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Nucleo Fusion <148791547+NucleoFusion@users.noreply.github.com>
@NucleoFusion NucleoFusion requested a review from bupd October 4, 2025 06:12
bupd added 3 commits October 7, 2025 18:40
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>

@bupd bupd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm, good to merge

bupd added 2 commits October 8, 2025 02:30
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
@bupd bupd merged commit d914b73 into goharbor:main Oct 7, 2025
7 of 9 checks passed
@qcserestipy qcserestipy mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants