forgejo/modules
Earl Warren f44830c3cb
[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)
(cherry picked from commit 09db07aeae)
2024-01-22 18:13:42 +00:00
..
actions [CI] Search .forgejo/workflows first 2024-01-22 12:18:31 +00:00
activitypub Upgrade to golangci-lint@v1.55.0 (#27756) 2023-10-24 02:54:59 +00:00
analyze
assetfs
auth [GITEA] Drop sha256-simd in favor of stdlib 2024-01-22 18:13:40 +00:00
avatar [GITEA] Drop sha256-simd in favor of stdlib 2024-01-22 18:13:40 +00:00
base [GITEA] Drop sha256-simd in favor of stdlib 2024-01-22 18:13:40 +00:00
cache Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
charset Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
container
context [GITEA] API commentAssignment() to verify the id belongs 2024-01-22 18:13:42 +00:00
contexttest Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
csv
emoji
eventsource Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
generate
git [GITEA] Find README.md for user profiles case insensitively 2024-01-22 18:13:42 +00:00
gitgraph More db.DefaultContext refactor (#27265) 2023-09-29 12:12:54 +00:00
graceful Suggest to use Type=simple for systemd service (#28717) 2024-01-07 15:18:04 +00:00
hcaptcha
highlight Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
hostmatcher Support allowed hosts for webhook to work with proxy (#27655) 2023-10-18 09:44:36 +00:00
html
httpcache
httplib
indexer [GITEA] Vendor rupture dependency 2024-01-22 13:42:50 +00:00
issue/template
json
label
lfs [GITEA] Drop sha256-simd in favor of stdlib 2024-01-22 18:13:40 +00:00
log
markup [GITEA] Add footnote testing 2024-01-22 18:13:41 +00:00
mcaptcha
metrics
migration
nosql
options
packages Fix some RPM registry flaws (#28782) 2024-01-19 11:37:10 +00:00
paginator
pprof
private [CLI] implement forgejo-cli 2024-01-22 12:18:30 +00:00
process Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
proxy
proxyprotocol
public Refactor CORS handler (#28587) 2023-12-25 20:13:18 +08:00
queue [CI] disable redis test, no redis server yet in CI 2024-01-22 12:18:31 +00:00
recaptcha
references Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
regexplru
repository Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
secret [GITEA] Drop sha256-simd in favor of stdlib 2024-01-22 18:13:40 +00:00
session Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
setting [FEAT] Repository flags 2024-01-22 18:13:42 +00:00
sitemap
ssh Remove SSH workaround (#27893) 2023-11-03 15:21:05 +00:00
storage [CI] Forgejo Actions based CI for PR & branches 2024-01-22 12:18:31 +00:00
structs [GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments 2024-01-22 18:13:42 +00:00
svg
sync
system Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
templates [FEAT] Repository flags 2024-01-22 18:13:42 +00:00
test
testlogger
timeutil Make template DateTime show proper tooltip (#28677) 2024-01-02 20:09:18 +01:00
translation
turnstile
typesniffer
updatechecker Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
upload
uri
user
util [GITEA] Drop sha256-simd in favor of stdlib 2024-01-22 18:13:40 +00:00
validation [GITEA] add option for banning dots in usernames 2024-01-22 14:35:03 +00:00
web [GITEA] Configurable clone methods 2024-01-22 18:13:42 +00:00
webhook Fix schedule tasks bugs (#28691) 2024-01-12 21:50:38 +00:00