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

Fix user retrieved from token late #33786

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

thoscut
Copy link

@thoscut thoscut commented Mar 4, 2025

In case an user is pulling from a LFS repository, the user should be retrieved from the token. This happens already in the current code, but after using an empty user variable for retrieving the permissions for the user on the specific repository.
The incorrect order seems to only impact the logged messages:

rvices/lfs/server.go:547:authenticate() [T] Trying GetUserRepoPermission for user <User nil> in repo <Repository

Otherwise it doesn't seem to impact pulls or pushed.

The pull request fixes this behaviour and had been tested locally already.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 4, 2025
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 4, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 4, 2025
@wxiaoguang
Copy link
Contributor

Thank you for the PR, I haven't looked into the problem and have no idea whether there was any real problem. But the CI reports a lot of failed tests.

@wxiaoguang wxiaoguang marked this pull request as draft March 4, 2025 14:34
@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Mar 4, 2025
@wxiaoguang
Copy link
Contributor

Do you have more ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants