Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added /gitproxy API endpoint #2550

Merged
merged 6 commits into from
Oct 2, 2023
Merged

Added /gitproxy API endpoint #2550

merged 6 commits into from
Oct 2, 2023

Conversation

enrichman
Copy link
Member

@enrichman enrichman commented Sep 5, 2023

This PR adds the /gitproxy endpoint.

This endpoint will proxy some of the Github and Gitlab APIs. If a gitconfig ID is provided then this will be used to enrich the request (with the token, or skipping the SSL verification, or custom certificates).

@enrichman enrichman linked an issue Sep 5, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Files Coverage Δ
internal/api/v1/router.go 100.00% <ø> (ø)
helpers/cahash/cahash.go 53.84% <0.00%> (-33.66%) ⬇️
internal/api/v1/gitproxy/gitproxy.go 87.19% <87.19%> (ø)

... and 20 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@enrichman
Copy link
Member Author

As discussed internally we need to check if there was an error regarding the Gitlab search endpoint:

https://github.com/rancher/dashboard/blob/b9180782e23fb67edb7d53dc9769c60573799434/shell/store/gitlab.js#L67-L71

This seems to point to a projects/${ repo }/repository/branches/${ branch } but it should probably be projects/${ username }%2F${ repo }/repository/branches/${ branch }.

@torchiaf is on it 👍

@enrichman
Copy link
Member Author

Adding one more insight. I was trying to use the Gitlab /search/repositories API but it seems to be unknown:

{"error":"404 Not Found"}

Reading the Gitlab doc it should be just /search, but it seems to be an authenticated endpoint.

{"message":"401 Unauthorized"}

Maybe that's the reason because of the error? Maybe the search on Gitlab needs a token, and so it was not available?

By the way I'm not sure where the search API is used (Gitlab or Github). Any help about this? @richard-cox @torchiaf

@enrichman enrichman changed the title [WIP] Added gitproxy endpoint Added gitproxy endpoint Sep 11, 2023
@enrichman enrichman marked this pull request as ready for review September 11, 2023 14:50
@enrichman enrichman requested a review from a team as a code owner September 11, 2023 14:50
@enrichman enrichman self-assigned this Sep 11, 2023
@enrichman enrichman added the kind/enhancement New feature or request label Sep 11, 2023
@enrichman enrichman modified the milestones: v1.10.0, v1.11.0 Sep 11, 2023
Copy link
Contributor

@andreas-kupries andreas-kupries left a comment

Choose a reason for hiding this comment

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

LGTM

@enrichman enrichman merged commit a2e9652 into main Oct 2, 2023
16 checks passed
@enrichman enrichman deleted the 2490-add-git-proxy-endpoint branch October 2, 2023 09:52
@andreas-kupries andreas-kupries changed the title Added gitproxy endpoint Added /gitproxy endpoint Nov 29, 2023
@enrichman enrichman changed the title Added /gitproxy endpoint Added /gitproxy API endpoint Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add git proxy endpoint
3 participants