Skip to content

feat: add private repository support with PAT and SSH authentication#206

Merged
vbelouso merged 4 commits intoRHEcosystemAppEng:mainfrom
vbelouso:feat-private-repo
Mar 9, 2026
Merged

feat: add private repository support with PAT and SSH authentication#206
vbelouso merged 4 commits intoRHEcosystemAppEng:mainfrom
vbelouso:feat-private-repo

Conversation

@vbelouso
Copy link
Copy Markdown
Collaborator

@vbelouso vbelouso commented Feb 26, 2026

Add support for private GitHub repository authentication using PAT and SSH keys.

Changes:

  • Credential-based git authentication (PAT and SSH)
  • Graceful fallback when credentials expire or CA bundle missing
  • Enhanced GitHub API with user tokens for language detection
  • Ecosystem fallback when API returns no languages

Review together with RHEcosystemAppEng/agent-morpheus-client#138

Testing:

  1. For testing, you need an accessible private repository with your PAT/SSH

And a minimal SBOM, for example, as in the attachment
Update metadata.component.name and metadata.properties with the actual values.
eiq-private-clone-test.json

  1. A test instance is available in the OpenShift project daboogie-eiq-private

Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
Copy link
Copy Markdown
Collaborator

@zvigrinberg zvigrinberg left a comment

Choose a reason for hiding this comment

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

Hi @vbelouso
The solution is great, and meeting all expectations.

Please see my comments.

vbelouso added 2 commits March 2, 2026 11:58
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
@vbelouso vbelouso requested a review from zvigrinberg March 2, 2026 11:06
Copy link
Copy Markdown
Collaborator

@zvigrinberg zvigrinberg left a comment

Choose a reason for hiding this comment

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

@vbelouso LGTM , Very good job!.
Please only merge after the client side is ready for merge as well...

Thank you!.

@zvigrinberg
Copy link
Copy Markdown
Collaborator

zvigrinberg commented Mar 4, 2026

@vbelouso Not critical, But when i tested it locally, i couldn't do it, without adding this piece of code

diff --git a/src/exploit_iq_commons/utils/credential_client.py b/src/exploit_iq_commons/utils/credential_client.py
index b611421..3ca339e 100644
--- a/src/exploit_iq_commons/utils/credential_client.py
+++ b/src/exploit_iq_commons/utils/credential_client.py
@@ -187,8 +187,12 @@ def fetch_and_decrypt_credential(
 
     logger.info("Fetching credential: credential_id=%s", credential_id)
 
-    ca_bundle = os.environ.get("CLIENT_CA_BUNDLE", "/app/certs/service-ca.crt")
-    verify_ssl = _validate_ca_bundle(ca_bundle)
+    if url.startswith("https"):
+        ca_bundle = os.environ.get("CLIENT_CA_BUNDLE", "/app/certs/service-ca.crt")
+        verify_ssl = _validate_ca_bundle(ca_bundle)
+    else:
+        verify_ssl = False
+
 
     try:
         response = requests.get(url, headers=headers, timeout=10, verify=verify_ssl)

and without adding the following 2 environment variables before running the agent

CLIENT_JWT_TOKEN=dummy_token
CLIENT_BACKEND_URL=http://localhost:8080

I Would suggest commenting out the above piece of code I've added and add comment about that this is essential for debugging or invoking the agent locally for analysis of private git repositories, and on the way, add another comment with these 2 env vars required for that purpose.

Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
@vbelouso vbelouso force-pushed the feat-private-repo branch from 248c164 to 5669258 Compare March 8, 2026 10:00
@vbelouso
Copy link
Copy Markdown
Collaborator Author

vbelouso commented Mar 8, 2026

/test vulnerability-analysis-on-pr

3 similar comments
@vbelouso
Copy link
Copy Markdown
Collaborator Author

vbelouso commented Mar 8, 2026

/test vulnerability-analysis-on-pr

@vbelouso
Copy link
Copy Markdown
Collaborator Author

vbelouso commented Mar 9, 2026

/test vulnerability-analysis-on-pr

@vbelouso
Copy link
Copy Markdown
Collaborator Author

vbelouso commented Mar 9, 2026

/test vulnerability-analysis-on-pr

@vbelouso vbelouso merged commit ce310fc into RHEcosystemAppEng:main Mar 9, 2026
1 check passed
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.

2 participants