forgejo/services
Lunny Xiao dd30d9d5c0
Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220)
The function `GetByBean` has an obvious defect that when the fields are
empty values, it will be ignored. Then users will get a wrong result
which is possibly used to make a security problem.

To avoid the possibility, this PR removed function `GetByBean` and all
references.
And some new generic functions have been introduced to be used.

The recommand usage like below.

```go
// if query an object according id
obj, err := db.GetByID[Object](ctx, id)
// query with other conditions
obj, err := db.Get[Object](ctx, builder.Eq{"a": a, "b":b})
```
2023-12-07 15:27:36 +08:00
..
actions Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
agit
asymkey Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
attachment
auth Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
automerge
context
convert
cron
externalaccount
feed
forms Fix required error for token name (#28267) 2023-11-29 03:47:05 +00:00
gitdiff
indexer Fix missing issue search index update when changing status (#28325) 2023-12-03 12:22:44 +01:00
issue
lfs Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
mailer
markup
migrations Fix migration panic due to an empty review comment diff (#28334) 2023-12-05 08:29:43 +00:00
mirror
notify
org
packages Fix RPM/Debian signature key creation (#28352) 2023-12-05 00:48:01 +00:00
pull Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
release Fix comment permissions (#28213) 2023-11-25 17:21:21 +00:00
repository Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
secrets Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
task
uinotification
user Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
webhook Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
wiki