Commit graph

1,371 commits

Author SHA1 Message Date
ewin
f55be91579
clean up the final diff a bit 2025-03-05 18:19:52 -05:00
ewin
187c5fdf23
Use omitempty consistently on API models 2025-03-05 18:19:38 -05:00
ewin
75936b0c28
check for the correct value in the deletion test 2025-03-05 17:35:40 -05:00
ewin
11c1c837cc
Convert processContentType to free function and remove unused parameter 2025-03-05 17:35:10 -05:00
ewin
b2270e3092
Add test ensuring text and content type are returned when deleting a status 2025-03-05 17:27:28 -05:00
ewin
3872315db0
update other api tests with status content type field 2025-03-05 17:13:02 -05:00
ewin
9384f25dd9
Check content type of API statuses in all tests where text is checked 2025-03-05 16:35:07 -05:00
ewin
b6b0bd7ce7
Update new tests to check content type on API statuses 2025-03-05 16:24:53 -05:00
ewin
83de18aeba
Do include content type on status API model actually
This is mostly important when deleting and redrafting.

The comment on `apimodel.Status.Text` implies that it's not sent except in response to status deletion, but actually this doesn't seem to be the case; it also appears to be present in responses to creations and normal fetches and stuff. So I'm treating `ContentType` the same here.
2025-03-05 16:20:41 -05:00
ewin
f46583be48
Add test to ensure newly created statuses always have content type saved 2025-03-05 15:15:34 -05:00
ewin
8ef301c920
repurpose an existing test status instead of adding a new one to avoid breaking other tests 2025-03-05 14:59:14 -05:00
ewin
e02eb78cec
Add test for handling of statuses with no stored content type 2025-03-05 14:18:31 -05:00
ewin
921ba6481b
Return a value from processContentType instead of modifying the existing status
Fixes an issue that was caught by the test I just added - the recorded edit would be marked with the *new* content type instead of the old one, which is obviously bad
2025-03-05 13:19:39 -05:00
ewin
8634358278
Add test for updating content type in edits 2025-03-05 13:16:38 -05:00
ewin
112e1d6c48
Revert change to StatusContentType swagger annotation
I'm going to include this in a follow-on PR instead.
2025-03-03 17:50:13 -05:00
ewin
1af504408b
Remove unused helper function I copied 2025-03-03 17:23:16 -05:00
ewin
92d363d028
Update StatusSource test 2025-03-03 17:19:51 -05:00
ewin
2ad5e077a7
We don't actually use ContentType on the API status model 2025-03-03 17:12:07 -05:00
ewin
9a60a9f1c2
Set ContentType in more places where Text is set 2025-03-03 17:11:43 -05:00
ewin
0969007c61
Update docs, take care of TODOs 2025-03-03 16:48:24 -05:00
ewin
cd53543ec1
ensure ContentType is updated anywhere Text is 2025-03-03 16:42:04 -05:00
ewin
8eeede9c35
Update API docs
go run github.com/go-swagger/go-swagger/cmd/swagger generate spec --scan-models --exclude-deps --output docs/api/swagger.yaml
2025-03-03 16:18:07 -05:00
ewin
32bc3ef023
Add migration 2025-03-03 15:14:29 -05:00
ewin
e51a787162
Write status content type on create/edit 2025-03-03 15:14:29 -05:00
ewin
49e649068c
Add helpers to convert between API/internal StatusContentType 2025-03-03 15:14:29 -05:00
ewin
da31c5c617
Add ContentType to API models StatusSource and StatusEdit 2025-03-03 15:14:29 -05:00
ewin
2791a9951f
Add ContentType to internal models 2025-03-03 15:14:28 -05:00
tobi
ab7ec43988
[bugfix] Fix app migration (#3868)
* [bugfix] Fix app migration

* use temporary index during migration

* create temporary index for the migration

* include local = true in temporary index

* tweak migration a bit for SPEED
2025-03-03 19:00:44 +01:00
kim
24da574684
[bugfix] fix refreshed additional media info being ignored (#3867)
* fix refreshed additional media info being ignored when force flag already set

* also update to always iterate through all additional info fields

* make similar changes for emoji, even if not necessary, just to keep in-sync
2025-03-03 16:14:27 +00:00
tobi
1b37944f8b
[feature] Refactor tokens, allow multiple app redirect_uris (#3849)
* [feature] Refactor tokens, allow multiple app redirect_uris

* move + tweak handlers a bit

* return error for unset oauth2.ClientStore funcs

* wrap UpdateToken with cache

* panic handling

* cheeky little time optimization

* unlock on error
2025-03-03 15:03:36 +00:00
tobi
8488ac9286
[chore] migrate oauth2 -> codeberg (#3857) 2025-03-02 16:42:51 +01:00
tobi
5d0e3d9c35
[chore] github.com/superseriousbusiness/httpsig -> codeberg.org/superseriousbusiness/httpsig (#3854) 2025-03-02 13:28:38 +01:00
tobi
e2e185d10b
[chore] github.com/superseriousbusiness/activity -> codeberg.org/superseriousbusiness/activity (#3853) 2025-03-02 12:48:00 +01:00
tobi
4c9901fc03
[chore] little frontend tweaks (#3852)
* [chore] little frontend tweaks

* beep boop

* poke

* clarify server time
2025-03-02 11:27:30 +01:00
Xavier Vello
0118e03cda
[feature] Implement CSV import for mutes (#3696)
* Implement CSV import for mutes

* update swagger.yaml

* update documentation

* add ImportTestSuite.TestImportMutes

* fix comment typo
2025-03-01 11:37:40 +01:00
tobi
eb720241da
[feature] Enforce OAuth token scopes (#3835)
* move tokenauth to apiutil

* enforce scopes

* docs

* update test models, remove deprecated "follow"

* file header

* tests

* tweak scope matcher

* simplify...

* fix tests

* log user out of settings panel in case of oauth error
2025-02-26 13:04:55 +01:00
mkljczk
96d39155f2
[docs] Fix swagger operation descriptions (#3830)
* Fix swagger operation descriptions

Signed-off-by: mkljczk <git@mkljczk.pl>

* generate a swagger file

Signed-off-by: mkljczk <git@mkljczk.pl>

---------

Signed-off-by: mkljczk <git@mkljczk.pl>
2025-02-25 12:47:48 +01:00
tobi
fd670c6a27
[feature] Use ETag for robots.txt to prevent mishaps (#3829)
* [feature] Use ETag for robots.txt to prevent mishaps

* check incoming if-none-match header
2025-02-24 11:17:18 +01:00
tobi
8829ee187a
[feature] Add page-specific class per template (#3814)
* [feature] Add page-specific class per template

* cheeky bit cheaper
2025-02-20 15:09:28 +01:00
kim
a03a35a5d6
[bugfix] update fedi api to support multiple separate votes in same multiple choice poll (#3809) 2025-02-20 11:13:07 +01:00
tobi
96716e4f43
[feature] Forward-compatibility with Approval objects (#3807)
* vendor

* [feature] Forward-compatibility with Approval objects

* vendor the thing

* fix leetle bug

* lil syntax tweak for beloved kimb
2025-02-19 18:09:54 +01:00
kim
e220c6a894
adds more code comments and some small code formatting tweaks (#3799) 2025-02-17 11:44:41 +00:00
tobi
5dc8009e30
[chore/performance] Batch migration queries (#3798)
* separate enum migrations into their own individual transactions

* pee poo

* some performance tweaks and adding more comments

* batch

---------

Co-authored-by: kim <grufwub@gmail.com>
2025-02-15 12:43:12 +01:00
tobi
879ca2d2f8
[bugfix] Drop status indices AFTER updating visibility (#3795)
* [bugfix] Drop status indices AFTER updating visibility

* rename to status vis indices just to indicate they're only used in the statuses hook func

---------

Co-authored-by: kim <grufwub@gmail.com>
2025-02-14 12:52:04 +00:00
tobi
dfcb7862a9
[bugfix] Return 404 when web context target status hidden (#3792) 2025-02-13 14:10:13 +01:00
Vyr Cossont
fccb0bc102
[feature] Implement backfilling statuses thru scheduled_at (#3685)
* Implement backfilling statuses thru scheduled_at

* Forbid mentioning others in backfills

* Update error messages & codes

* Add new tests for backfilled statuses

* Test that backfilling doesn't timeline or notify

* Fix check for absence of notification

* Test that backfills do not cause federation

* Fix type of apimodel.StatusCreateRequest.ScheduledAt in tests

* Add config file switch and min date check
2025-02-12 09:49:33 -08:00
kim
37dbf319b1
[performance] improved enum migrations (#3782)
* updates the enum migration to perform a singular update for all values, using an SQL case statement

* fix logging

* fix code comment

* well i guess we'll get rid of the useful but unused function then, linter. fine, i see how it is!

* append to byte buffer instead of WriteString() to shut the linter up (i know you're reading this, linter)
2025-02-11 16:58:44 +01:00
alemi.dev
d0de3ad492
[bug] respect X-Robots-Tag and robots.txt on api/v1/instance and nodeinfo (#3756)
* feat: check X-Robots-Tag

when accessing /api/v1/instance or /nodeinfo endpoints respect
X-Robots-Tag

* chore: go fmt ./...

* Check robots.txt as well, add tests

---------

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
2025-02-11 13:16:14 +01:00
tobi
2c95fd4115
[bugfix] Suggest lowercase username when creating via OIDC (#3780) 2025-02-11 09:42:35 +01:00
tobi
787bdc1488
[feature] make account sign-up / backlog limits configurable (#3768) 2025-02-10 15:46:36 +01:00