summaryrefslogtreecommitdiff
path: root/internal/api
AgeCommit message (Collapse)AuthorFiles
2023-09-11[feature] Support Actor URIs for webfinger queries (#2187)Libravatar Daenney1
* [feature] Support Actor URIs for webfinger queries It's now possible to pass an Actor URI as the resource to query for when doing a webfinger query. The code now extracts the username and domain from the URI. The URI needs to be fully qualified, including having a scheme of http or https to be recognised as such. The acct scheme is handled as we used to, including dealing with an erroneous leading @ on the username. We retain the ability to handle resources without a scheme by parsing them again with the acct scheme if the original parse failed. This can happen due to parsing ambiguities when dealing with a string like user@domain.tld:port. * [bugfix] Remove debugging changes * [chore] Make TestExtractNamestring table-driven * [chore] Unnest Trim and Split for readability
2023-09-07[chore] much improved paging package (#2182)Libravatar kim1
2023-09-04[feature] Store admin actions in the db, prevent conflicting actions (#2167)Libravatar tobi4
2023-08-19[feature] Instance rules (#2125)Libravatar f0x5218
* init instance rules database model, admin api * expose instance rules in public instance api * public /api/v1/instance/rules route * GET ruleById * createRule route * createRule auth check * updateRule * deleteRule * list rules on about page * ruleGet auth * add about page ids for anchors * process and store adding violated rules to reports * admin api models for instance rules * instance rule edit frontend * change rule inputs to textareas * database fixes after rebase (#2124) * remove unused imports * fix db migration column name * fix tests * fix more tests * fix postgres error with wrongly used Ident * add some tests, fiddle with rule model a bit, fix postgres migration * swagger docs --------- Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-08-17[bugfix] fix double firing bun.DB query hooks (#2124)Libravatar kim3
* improve bun.DB wrapping readability + comments, fix double-firing query hooks * fix incorrect code comment placement * fix linter issues * Update internal/db/basic.go * do as the linter commmands ... --------- Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: Daenney <daenney@users.noreply.github.com>
2023-08-11[bugfix] Fix using wrong key for clientID during oauth callback (#2101)Libravatar tobi1
2023-08-11[bugfix] Use custom bluemonday policy to disallow inline img tags (#2100)Libravatar tobi1
2023-08-10[performance] remove last of relational queries to instead rely on caches ↵Libravatar kim2
(#2091)
2023-08-07[chore] Use generic pointer function (#2080)Libravatar Daenney6
This replaces the different $TypePtr functions with a generic implementation.
2023-08-07[feature] Allow full BCP 47 in language inputs (#2067)Libravatar Vyr Cossont3
* Allow full BCP 47 in language inputs Fixes #2066 * Fuse validation and normalization for languages * Remove outdated comment line * Move post language canonicalization test
2023-08-02[bugfix] Rework MultiError to wrap + unwrap errors properly (#2057)Libravatar tobi12
* rework multierror a bit * test multierror
2023-08-02[bugfix] Allow instance accounts to be shown in search results in certain ↵Libravatar tobi1
circumstances (#2053)
2023-07-31[feature] Hashtag federation (in/out), hashtag client API endpoints (#2032)Libravatar tobi18
* update go-fed * do the things * remove unused columns from tags * update to latest lingo from main * further tag shenanigans * serve stub page at tag endpoint * we did it lads * tests, oh tests, ohhh tests, oh tests (doo doo doo doo) * swagger docs * document hashtag usage + federation * instanceGet * don't bother parsing tag href * rename whereStartsWith -> whereStartsLike * remove GetOrCreateTag * dont cache status tag timelineability
2023-07-31[performance] cache follow, follow request and block ID lists (#2027)Libravatar kim2
2023-07-29[feature] Implement markers API (#1989)Libravatar Vyr Cossont5
* Implement markers API Fixes #1856 * Correct import grouping in markers files * Regenerate Swagger for markers API * Shorten names for readability * Cache markers for 6 hours * Update DB ref * Update envparsing.sh
2023-07-27[feature] Support setting private notes on accounts (#1982)Libravatar Vyr Cossont3
* Support setting private notes on accounts * Reformat comment whitespace * Add missing license headers * Use apiutil.ParseID * Rename Note model and cache to AccountNote * Update golden cache config in test/envparsing.sh * Rename gtsmodel/note.go to gtsmodel/accountnote.go * Update AccountNote uniqueness constraint name Now has same prefix as other indexes on this table. --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
2023-07-23[chore] Admin CLI + new account creation refactoring (#2008)Libravatar tobi2
* set maxPasswordLength to 72 bytes, rename validate function * refactor NewSignup * refactor admin account CLI commands * refactor oidc create user * refactor processor create * tweak password change, check old != new password
2023-07-21[bugfix] Return all accounts when list accounts limit <= 0 (#2014)v0.10.0Libravatar tobi4
2023-07-18[bugfix] more robust list timeline invalidation (#1995)v0.10.0-rc3Libravatar kim1
2023-07-13[bugfix] Set Vary header correctly on cache-control (#1988)v0.10.0-rc2Libravatar tobi17
* [bugfix] Set Vary header correctly on cache-control * Prefer activitypub types on AP endpoints * use immutable on file server, vary by range * vary auth on Accept
2023-07-12[bugfix] Properly handle range > content-length (#1979)Libravatar MaeIsBad1
This makes the serveFileRange function return the entire file if suffix-range is larger than content-length in compliance with RFC9110 Co-authored-by: mae <git@badat.dev>
2023-07-07[bugfix] Reorder web view logic, other small fixes (#1954)Libravatar tobi1
2023-07-07[chore/bugfix] Domain block tidying up, Implement first pass of `207 ↵Libravatar tobi6
Multi-Status` (#1886) * [chore/refactor] update domain block processing * expose domain block import errors a lil better * move/remove unused query keys
2023-07-04[chore/bugfix] Break Websockets logic into smaller read/write functions, ↵Libravatar tobi2
don't log expected errors (#1932) * [chore/bugfix] Break Websockets logic into smaller read/write functions, don't log expected errors * tweak * tidy up, use control message
2023-06-22[bugfix/chore] oauth entropy fix + media cleanup tasks rewrite (#1853)Libravatar kim1
2023-06-21[feature] Add partial text search for accounts + statuses (#1836)Libravatar tobi15
2023-06-19[chore] Fix Swagger paths for lists API endpoints (#1904)Libravatar Umar Getagazov7
2023-06-19[bugfix] Parse POST-style forms in the list member removal endpoint (#1903)Libravatar Umar Getagazov1
2023-06-16[bugfix] Accept non-multipart forms for account updates (#1896)Libravatar Umar Getagazov2
* [bugfix] Update Swagger schema per max_profile_fields addition * [bugfix] Accept non-multipart forms for account updates
2023-06-13[chore] Refactor AP authentication, other small bits of tidying up (#1874)Libravatar tobi13
2023-06-13[Frontend] Settings for profile fields (#1885)Libravatar f0x522
* get max emoji size from instance settings * expose (hardcoded) max amount of profile fields in instance api * basic profile field setting * fix profile field hook structure for updates * *twirls mustache* fix ze tests --------- Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2023-06-03[chore] Update versions, fix lint errors (#1860)Libravatar tobi2
2023-06-02[bugfix] Allow lowercase emoji shortcode in frontend (#1851)Libravatar Julian-Samuel Gebühr1
* Replace pinafore with semaphore * Typo * Allow lowercase emoji shortcode in frontend * Fix failing test (corrected expected outcome)
2023-06-02[bugfix] Overwrite API client closed errors with `499 - Client Closed ↵Libravatar tobi1
Request` (#1857) * [bugfix] Overwrite client closed errors with 499 * bleep bloop * review changes
2023-05-28[bugfix/chore] Inbox post updates (#1821)Libravatar tobi2
Co-authored-by: kim <grufwub@gmail.com>
2023-05-28[chore] tidy up media manager, add calling func to errors, build-script ↵Libravatar kim18
improvements (#1835) * media manager tidy-up: de-interface and remove unused PostDataFunc Signed-off-by: kim <grufwub@gmail.com> * remove last traces of media.Manager being an interface Signed-off-by: kim <grufwub@gmail.com> * update error to provide caller, allow tuneable via build tags Signed-off-by: kim <grufwub@gmail.com> * remove kim-specific build script changes Signed-off-by: kim <grufwub@gmail.com> * fix merge conflicts Signed-off-by: kim <grufwub@gmail.com> * update build-script to support externally setting build variables Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
2023-05-25[bugfix/docs] Fix clear notifications API docs (#1831)Libravatar Daenney1
The handler is already hooked to the right path, it's just the docs that were missing the path.
2023-05-25[feature] Add List functionality (#1802)Libravatar tobi44
* start working on lists * further list work * test list db functions nicely * more work on lists * peepoopeepoo * poke * start list timeline func * we're getting there lads * couldn't be me working on stuff... could it? * hook up handlers * fiddling * weeee * woah * screaming, pissing * fix streaming being a whiny baby * lint, small test fix, swagger * tidying up, testing * fucked! by the linter * move timelines to state like a boss * add timeline start to tests using state * invalidate lists
2023-05-21[chore] Replace pinafore with semaphore (#1801)Libravatar Julian-Samuel Gebühr1
* Replace pinafore with semaphore * Typo
2023-05-16[bugfix] Fix NegotiateFormat with multiple accept headers (#1797)Libravatar Daenney2
* [bugfix] Fix NegotiateAccept with multi accept There's a bug in Gin's NegotiateFormat that doesn't handle the presence of multilpe accept headers. This lifts the code from the PR @tsmethurst sent a year ago to Gin into our codebase to fix the issue. * [bugfix] Concat accept header in webfinger Some implementations bug out when there's multiple accept headers, including Gin (see 7050112af1ccc935ec542cb41fa8b07f7357539d). But things seem to work reliably with a single accept header with multiple parts. Fixes: #1793
2023-05-13[frontend] Basic user moderation actions (#1728)Libravatar f0x521
* remove info banner * update swagger definition for AccountAction * basic user view, suspend action * clean up suspended user display * basic user searching * rename User -> Account for clarity * refactor error boundary component to give better info * appease the linter
2023-05-12[bugfix] Ensure account fields can be set by JSON (#1762)Libravatar tobi3
2023-05-12[chore] Prefer JSON errors in API endpoints (#1766)Libravatar Natsu Kagami2
* Default to JSON over HTML for error handling * Change the default error display for web endpoints to html
2023-05-09[bugfix] Don't try to get user when serializing local instance account (#1757)Libravatar tobi1
2023-05-09[feature] Enable federation in/out of profile PropertyValue fields (#1722)Libravatar tobi3
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2023-05-07[bugfix] Punycode fixes (#1743)Libravatar tobi1
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2023-05-06[bugfix] Return languages in api/v1/instance (#1741)Libravatar Daenney2
It turns out that in Masto v2.3.0 the languages key was added to the V1 Instance and that it's effectively mandatory. Though in GtS we don't really have this concept yet, some apps will explode if the languages key is missing altogether. So at least return the empty array on V1 too in the hopes that it makes things work well enough. For history's sake, you can see the attributes that will get serialised in https://github.com/mastodon/mastodon/blob/f877aa9d70d0d600961989b8e97c0e0ce3ac1db6/app/serializers/rest/v1/instance_serializer.rb#L6-L9. Because the attribute does not have a conditional defined for it, there isn't a filter that optionally omits it, or a def languages to modify the behaviour the attribute is effectively always included and serialised. Fixes: #1662
2023-05-06[feature] Implement the preferences client API (#1740)Libravatar Daenney4
This adds the preferences endpoint to our Mastodon Client API implementation. It's a read-only endpoint that returns a number of user preferences. Applications can query these settings when logging in a user (for the first time) to configure themselves.
2023-05-04[bugfix] Serve correct 'application/jrd+json' content type for webfinger ↵Libravatar tobi5
requests (#1738) * [bugfix] Return `application/jrd+json` from webfinger queries * update finger req content-type
2023-05-04[bugfix] Rework notifs to use min_id for paging up (#1734)Libravatar tobi2