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

GitLab Source Forbidden, even with API token #1622

Closed
JustScreaMy opened this issue May 15, 2024 · 8 comments
Closed

GitLab Source Forbidden, even with API token #1622

JustScreaMy opened this issue May 15, 2024 · 8 comments
Labels
bug Something isn't working source-specific This bug/feature affects a specific source

Comments

@JustScreaMy
Copy link

Describe the bug
I have my private GitLab repository, and have made a Release with .apk files. After creating and setting up the GitLab Private Access Token and adding the repository url, it throws "Forbidden" error. The Personal Access Token had all permissions set. And I have that ensured i can download the apk files in web browser in the Releases on gitlab too.

To Reproduce

  1. Have a private repository on gitlab.com
  2. Build and apk file using CI and upload it to artifacts
  3. Create a new release with the files in artifacts
  4. Add the repository url to obtainum and get the error

Screenshots and Logs
Logs just say
error: Forbidden

Please complete the following information:

  • Device: Xiaomi 13T
  • OS: HyperOS 1.0.4.0
  • Obtainium Version: v1.1.6
@JustScreaMy JustScreaMy added bug Something isn't working to check Issue has not been reviewed labels May 15, 2024
@JustScreaMy
Copy link
Author

This is actually weird, I have followed the source code to the point of creating my own curl request by the rules of the gitlab app_source and got a correct result, but havent been able to get Forbidden under any circumstances.

@ImranR98
Copy link
Owner

Does the error show up when adding the repo or only when you try to actually install the app? Also keep in mind the error might be due to this: #1489 (comment)

@ImranR98 ImranR98 added needs follow up Further information is requested source-specific This bug/feature affects a specific source and removed to check Issue has not been reviewed labels May 17, 2024
@JustScreaMy
Copy link
Author

JustScreaMy commented May 17, 2024

The error shows up only when adding the repository, but I dont think it is related to #1489 (comment) , because when I tried to construct the request in terminal (with the %2F syntax and the same API key), I get back everything correctly.

@ImranR98
Copy link
Owner

It's possible the headers might be different

@JustScreaMy
Copy link
Author

That could be interesting, because in Gitlab REST API documentation, the 403 Forbidden status code is documented as The request isn’t allowed. For example, the user isn’t allowed to delete a project., which is really specific. I will try to debug this more when I have more time.

@JustScreaMy
Copy link
Author

JustScreaMy commented May 20, 2024

Well, after debugging, I found out that it fetched the releases correctly, but it fails when it tries to download the application (but it doesn't add the app to the list because of that).

The Personal Access Token is used correctly when fetching the releases, but it isn't sent when the .apk file itself should be downloaded.

The solution I think would be to use headers for this case, because that shouldn't break out the apk name resolution from the download url.

@JustScreaMy
Copy link
Author

Just tested the dev version and I was successfully able to install the app correctly. Once merged, this is ready to be closed! Thanks!

ImranR98 added a commit that referenced this issue May 24, 2024
- Bugfix: Include GitLab token in APK request (#1622)
- Bugfix: Don't trim trailing slashes when parsing links (#1625)
- Improve contrast of placeholder icon in dark mode (#1637) 
- Improve app loading times
- Revert a previous change to background downloads
- Add a "clear logs" button
@ImranR98
Copy link
Owner

@ImranR98 ImranR98 removed the TODO Issue to focus on for the next release label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working source-specific This bug/feature affects a specific source
Projects
None yet
Development

No branches or pull requests

2 participants