phillipj / gitlab-search

Command line tool to search for contents in GitLab repositories
MIT License
304 stars 37 forks source link

crash when no rights to crawl the whole tree #39

Open oXidFoX opened 1 year ago

oXidFoX commented 1 year ago

Context:

On a self hosted gitlab (15.9.3), consider this tree:

/public_group/
/private_group/sub_private_group1/sub_deep_private_group1/
/private_group/sub_private_group2/

I get granted access to sub_deep_private_group1.

I search something, with debug mode activated.

Bug:

Something exploded! Error: Request failed with status code 401

I don't know why, but the very first GET /api/v4/groups?per_page=100 we can see on debug mode return some groups I don't have access to (in my example it will return public_group private_group sub_private_group1 sub_deep_private_group1).

So when the next GET try to get the projects on all these groups, that ends with a 401 or 404 on inaccessible groups (private_group and sub_private_group1) and makes gitlab-search crash.

Expected:

No crash and search results! And either ignore these inaccessible groups or display a warning.

Because as it is right now I can't use this tool anymore :(

phillipj commented 10 months ago

Thanks for reporting 👍🏻 Good for other people to know too, in case they're struggling with the same,

Since I'm no longer using this tool, or have the time to work on the fixes necessary, I'll be fully honest and let you know this wont be fixed -- at least not by me. A proven fix can ofcourse by submitted by anyone else since this is open source afterall.