add private Git repository authentication for MCPRegistry#3577
add private Git repository authentication for MCPRegistry#3577ChrisJBurns wants to merge 9 commits intomainfrom
MCPRegistry#3577Conversation
Add support for authenticating with private Git repositories in the
MCPRegistry CRD. This enables syncing registry data from private
GitHub, GitLab, and Bitbucket repositories using HTTP Basic Auth.
Changes:
- Add GitAuthConfig type to MCPRegistry CRD with username and
passwordSecretRef fields
- Generate config for registry-server with git.auth.username and
git.auth.passwordFile settings
- Mount password secrets at /secrets/{secretName}/ in registry-api pod
- Add comprehensive unit tests for config generation and pod template
- Add integration tests for Git authentication scenarios
- Update documentation with examples and best practices
- Create new example: mcpregistry-git-private.yaml
This integrates with the private Git authentication support added in
toolhive-registry-server PR #420.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Make the key field required in passwordSecretRef for git authentication, matching the validation behavior of the secret name field. This ensures explicit configuration rather than relying on defaults. Also removes redundant "git source without auth is valid" test as this case is already covered by other tests. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Remove "git registry without auth has no git auth volume" test as this case is already covered by existing tests that verify no volumes are present when git auth is not configured. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Since the key field is now validated as required in buildGitAuthConfig(), remove the dead code that defaulted to "password" when key was empty. - Update WithGitAuthMount to return early if key is empty - Change test to verify no volume is created when key is empty - Remove unused gitAuthPasswordFileName constant Co-Authored-By: Claude Opus 4.5 <[email protected]>
Remove "should not mount git auth volume for public repository without auth" integration test as this case is already covered by existing tests that verify no volumes are present when git auth is not configured. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The Git authentication is already thoroughly tested in the dedicated "Git Authentication" Describe block, which covers single auth secret, multiple auth secrets scenarios. The Entry in the table-driven test was redundant. Co-Authored-By: Claude Opus 4.5 <[email protected]>
deploy/charts/operator-crds/files/crds/toolhive.stacklok.dev_mcpregistries.yaml
Fixed
Show fixed
Hide fixed
deploy/charts/operator-crds/templates/toolhive.stacklok.dev_mcpregistries.yaml
Fixed
Show fixed
Hide fixed
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3577 +/- ##
=======================================
Coverage 65.61% 65.61%
=======================================
Files 407 407
Lines 40246 40295 +49
=======================================
+ Hits 26407 26441 +34
- Misses 11779 11792 +13
- Partials 2060 2062 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MCPRegistry
Signed-off-by: Chris Burns <[email protected]>
- Correct the password file mount path in REGISTRY.md to show the configurable key (was hardcoded to "password") - Document volume naming idempotency in WithGitAuthMount godoc Co-Authored-By: Claude Opus 4.5 <[email protected]>
Large PR justification has been provided. Thank you!
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
Summary
Add support for authenticating with private Git repositories in the MCPRegistry CRD. This enables syncing registry data from private GitHub, GitLab, and Bitbucket repositories using HTTP Basic Auth.
Changes
CRD Updates
GitAuthConfigtype to MCPRegistry CRD withusernameandpasswordSecretReffieldspasswordSecretRefrequires bothnameandkeyfields (no defaults)Registry Server Configuration
git.auth.usernameandgit.auth.passwordFilesettings/secrets/{secretName}/in the registry-api podTesting
Documentation
docs/arch/06-registry-system.mdwith Git authentication detailsdocs/operator/crd-api.mdwith new CRD fieldscmd/thv-operator/REGISTRY.mdwith usage examplesexamples/operator/mcp-registries/mcpregistry-git-private.yamlUsage Example
Test Plan
config_test.go)podtemplatespec_test.go)deployment_test.go)Related
This integrates with the private Git authentication support added in toolhive-registry-server.
Ref: stacklok/toolhive-registry-server#439
Large PR Justification