Skip to content

Conversation

NucleoFusion
Copy link
Contributor

@NucleoFusion NucleoFusion commented Sep 17, 2025

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.

This command allows to ping the ldap server from the cli

Signed-off-by: bupd <[email protected]>
Copy link

codecov bot commented Sep 17, 2025

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 (9ea44c0).
⚠️ Report is 47 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.

@bupd bupd mentioned this pull request Sep 24, 2025
4 tasks
Signed-off-by: NucleoFusion <[email protected]>
Signed-off-by: NucleoFusion <[email protected]>
@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
Copy link
Collaborator

@bupd bupd left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@Copilot Copilot AI left a comment

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.

NucleoFusion and others added 2 commits September 30, 2025 18:42
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Nucleo Fusion <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Nucleo Fusion <[email protected]>
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.

3 participants