forgejo/modules
Earl Warren 09db07aeae
[GITEA] API commentAssignment() to verify the id belongs
Instead of repeating the tests that verify the ID of a comment
is related to the repository of the API endpoint, add the middleware
function commentAssignment() to assign ctx.Comment if the ID of the
comment is verified to be related to the repository.

There already are integration tests for cases of potential unrelated
comment IDs that cover some of the modified endpoints which covers the
commentAssignment() function logic.

* TestAPICommentReactions - GetIssueCommentReactions
* TestAPICommentReactions - PostIssueCommentReaction
* TestAPICommentReactions - DeleteIssueCommentReaction
* TestAPIEditComment - EditIssueComment
* TestAPIDeleteComment - DeleteIssueComment
* TestAPIGetCommentAttachment - GetIssueCommentAttachment

The other modified endpoints do not have tests to verify cases of
potential unrelated comment IDs. They no longer need to because they
no longer implement the logic to enforce this. They however all have
integration tests that verify the commentAssignment() they now rely on
does not introduce a regression.

* TestAPIGetComment - GetIssueComment
* TestAPIListCommentAttachments - ListIssueCommentAttachments
* TestAPICreateCommentAttachment - CreateIssueCommentAttachment
* TestAPIEditCommentAttachment - EditIssueCommentAttachment
* TestAPIDeleteCommentAttachment - DeleteIssueCommentAttachment

(cherry picked from commit d414376d74)
2024-01-15 16:51:46 +00:00
..
actions [CI] Search .forgejo/workflows first 2024-01-15 13:26:55 +00:00
activitypub
analyze
assetfs
auth [GITEA] Drop sha256-simd in favor of stdlib 2024-01-15 16:11:57 +00:00
avatar [GITEA] Drop sha256-simd in favor of stdlib 2024-01-15 16:11:57 +00:00
base [GITEA] Drop sha256-simd in favor of stdlib 2024-01-15 16:11:57 +00:00
cache
charset
container
context [GITEA] API commentAssignment() to verify the id belongs 2024-01-15 16:51:46 +00:00
contexttest
csv
doctor [GITEA] new doctor check: fix-push-mirrors-without-git-remote (#1853) 2024-01-15 16:11:59 +00:00
emoji
eventsource
generate
git [GITEA] Find README.md for user profiles case insensitively 2024-01-15 16:51:45 +00:00
gitgraph
graceful
hcaptcha
highlight
hostmatcher
html
httpcache
httplib
indexer [GITEA] Vendor rupture dependency 2024-01-15 15:45:14 +00:00
issue/template
json
label
lfs [GITEA] Drop sha256-simd in favor of stdlib 2024-01-15 16:11:57 +00:00
log
markup [GITEA] Add footnote testing 2024-01-15 16:47:16 +00:00
mcaptcha
metrics
migration
nosql
options
packages
paginator
pprof
private
process
proxy
proxyprotocol
public
queue [CI] disable redis test, no redis server yet in CI 2024-01-15 13:26:55 +00:00
recaptcha
references
regexplru
repository
secret [GITEA] Drop sha256-simd in favor of stdlib 2024-01-15 16:11:57 +00:00
session
setting [FEAT] Repository flags 2024-01-15 16:51:45 +00:00
sitemap
ssh
storage [CI] Forgejo Actions based CI for PR & branches 2024-01-15 13:26:56 +00:00
structs [GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments 2024-01-15 16:51:45 +00:00
svg
sync
system
templates [FEAT] Repository flags 2024-01-15 16:51:45 +00:00
test
testlogger
timeutil
translation
turnstile
typesniffer
updatechecker
upload
uri
user
util [GITEA] Drop sha256-simd in favor of stdlib 2024-01-15 16:11:57 +00:00
validation [GITEA] add option for banning dots in usernames 2024-01-15 16:11:57 +00:00
web [GITEA] Configurable clone methods 2024-01-15 16:48:44 +00:00
webhook