forgejo/routers/repo
Antoine GIRARD 8b24073713 Only serve attachments when linked to issue/release and if accessible by user (#9340)
* test: add current attachement responses

* refactor: check if attachement is linked and accessible by user

* chore: clean TODO

* fix: typo attachement -> attachment

* revert un-needed go.sum change

* refactor: move models logic to models

* fix TestCreateIssueAttachment which was wrongly successful

* fix unit tests with unittype added

* fix unit tests with changes

* use a valid uuid format for pgsql int. test

* test: add unit test TestLinkedRepository

* refactor: allow uploader to access unlinked attachement

* add missing blank line

* refactor: move to a separate function repo.GetAttachment

* typo

* test: remove err test return

* refactor: use repo perm for access checking generally + 404 for all reject
2020-01-05 01:20:08 +02:00
..
activity.go
attachment.go
blame.go
branch.go
commit.go
compare.go
download.go
editor.go
editor_test.go
http.go
issue.go
issue_dependency.go
issue_label.go
issue_label_test.go
issue_lock.go
issue_stopwatch.go
issue_timetrack.go
issue_watch.go
lfs.go
main_test.go
middlewares.go
milestone.go
pull.go
pull_review.go
release.go
release_test.go
repo.go [Fix] Release attachment should use DownloadURL() not Name (#9529) 2019-12-28 23:33:13 +00:00
search.go
setting.go
setting_protected_branch.go
settings_test.go
topic.go
view.go
webhook.go
wiki.go
wiki_test.go