-
Notifications
You must be signed in to change notification settings - Fork 1.3k
core(gitea): update authentication method to use AuthorizationHeaderToken for API calls #2142
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
base: main
Are you sure you want to change the base?
core(gitea): update authentication method to use AuthorizationHeaderToken for API calls #2142
Conversation
philipp-horstenkamp
commented
Dec 29, 2025
•
edited by qodo-free-for-open-source-projects
bot
Loading
edited by qodo-free-for-open-source-projects
bot
…ken for API calls
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
|
fixes #2122 |
|
/describe |
PR TypeBug fix Description
Diagram Walkthroughflowchart LR
A["Gitea API Calls"] -->|"Remove token query params"| B["AuthorizationHeaderToken"]
C["PR Description"] -->|"Add last_commit_id"| D["Commit SHA Access"]
E["Label Publishing"] -->|"Use set comparison"| F["Efficient Equality Check"]
G["Test Suite"] -->|"Validate auth headers"| H["Proper Mock Setup"]
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
| ||
| Enhancement |
| ||
| Tests |
|
|
works fine on gitea 1.24.7 |
|
Hey @philipp-horstenkamp, Is this a breaking change? |
|
This is the current syntax. The old one is deprecated. But is sould be backword compatible for a few years. Not sure how long you want / need it backword compatible. |
|
I can find out since what version its compatible. |
|
Looks like it's at least backward compatible until v1.22.0-rc0 which was released on Mar 28, 2024. Change that introduced the warning: |
|
Gotcha 🙏 What do you think? |
PR Type
Bug fix
Description
Replace deprecated query parameter authentication with AuthorizationHeaderToken
Remove manual token extraction and URL parameter appending logic
Update five API methods to use proper auth_settings parameter
Refactor get_file_content to use query_params for ref parameter
Add comprehensive unit tests for authentication header usage
Diagram Walkthrough
File Walkthrough
gitea_provider.py
Replace query parameter auth with AuthorizationHeaderTokenpr_agent/git_providers/gitea_provider.py
API methods
auth_settings=['AuthorizationHeaderToken']parameter to allcall_apicallsget_file_contentto usequery_paramslist for ref parameterinstead of URL string concatenation
logic
test_gitea_provider.py
Add unit tests for AuthorizationHeaderToken authenticationtests/unittest/test_gitea_provider.py
API methods
auth_settings=['AuthorizationHeaderToken']is passedcorrectly