-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Private attachments #23071
Comments
Why not use the existing attachment model? Could simply add one more check in |
Just FYI, according to my test, GitHub's issue attachments are also open to public, even in a private repo. I just pasted an image into a private issue: https://user-images.githubusercontent.com/2114189/220891059-1d6e99c6-f906-4e21-9365-0e548ca67a18.png |
I think this has already been implemented by #9340 ? |
Partly. |
Then this should be a part of #3217 ? |
Well… Yesn't.
I see it as a requirement for implementing private issues. |
We close issues that need feedback from the author if there were no new comments for a month. 🍵 |
I think this should remain open. |
Feature Description
At the moment, any attachment you upload on a gitea instance will be publicly available,
i.e. https://try.gitea.io/attachments/a35cb41a-1afe-4415-bb8c-6058e29e9e21.
This is not always a good idea, as sometimes attachments are files that should be hidden from the public, i.e. personal information or security concerns.
This is especially a requirement for private issues, as otherwise no attachments can be safely shared.
Proposal
In addition to the existing upload mechanism that uploads to
/attachments/<UUID>
, we should add a second mechanism that returns404
if the user is not allowed to read this attachment.I can think of two possible implementations for the backend:
/attachments/private/<context>/UUID
to store private attachments, where<context>
can be for example<user>/<repo>/<comment-id>
Then, if no attachment info exists, the attachment is public, and otherwise the user must be the poster of this attachment, or have (at least) read access to issues (and PRs) on this repo.
The edge case
attachmentInfo exists (=> attachment is private) && user is not logged in
should probably still result in not showing the attachment, as a private attachment should always mean "only logged in users can see it", otherwise it could also be public.The problem with this feature are especially two points:
The text was updated successfully, but these errors were encountered: