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

[refactor] Unify the export of user data via API #15144

Merged
merged 7 commits into from
Mar 27, 2021

Conversation

6543
Copy link
Member

@6543 6543 commented Mar 24, 2021

this make sure no private information is leaked by accident

close #14446

@6543 6543 added type/refactoring Existing code has been cleaned up. There should be no new functionality. modifies/api This PR adds API routes or modifies them labels Mar 24, 2021
@6543 6543 added this to the 1.15.0 milestone Mar 24, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 25, 2021
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

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

Generally go prefers the context of an operation to be the first argument to a function - which would suggest that the doer should be the first argument - however, I can see how confusing that would be.

My suspicion is that instead of passing round a *models.User as the doer it should be some kind of context (this could even be a context.Context which just gets cast as a grant/permission context or uses GetValue(...) to get the grant/permission context from it) which expresses the permissions complex for actions - however, we do no have a consistent system for this kind of thing at present.

Therefore I approve this as it is clearly less confusing than our current crap.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 27, 2021
@6543 6543 merged commit 290cf75 into go-gitea:master Mar 27, 2021
@6543 6543 deleted the refactor_simplify_ToUser branch March 27, 2021 16:45
@6543 6543 mentioned this pull request Mar 27, 2021
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API does not consistently return User properties
4 participants