summaryrefslogtreecommitdiff
path: root/internal/ap
AgeCommit message (Collapse)AuthorFiles
2025-02-19[feature] Forward-compatibility with Approval objects (#3807)Libravatar tobi3
* vendor * [feature] Forward-compatibility with Approval objects * vendor the thing * fix leetle bug * lil syntax tweak for beloved kimb
2025-01-28[bugfix] Allow processing null ID emojis (#3702)Libravatar tobi2
* [bugfix] Allow processing null ID emojis * document emojis * blah * typo * array thingy
2025-01-23[feature] Serve bot accounts over AP as Service instead of Person (#3672)Libravatar tobi3
* pepis * oopsie doopsie * bollocks
2024-12-05[feature] add support for receiving federated status edits (#3597)Libravatar kim3
* add support for extracting Updated field from Statusable implementers * add support for status edits in the database, and update status dereferencer to handle them * remove unused AdditionalInfo{}.CreatedAt * remove unused AdditionalEmojiInfo{}.CreatedAt * update new mention creation to use status.UpdatedAt * remove mention.UpdatedAt, fixes related to NewULIDFromTime() change * add migration to remove Mention{}.UpdatedAt field * add migration to add the StatusEdit{} table * start adding tests, add delete function for status edits * add more of status edit migrations, fill in more of the necessary edit delete functionality * remove unused function * allow generating gotosocial compatible ulid via CLI with `go run ./cmd/gen-ulid` * add StatusEdit{} test models * fix new statusedits sql * use model instead of table name * actually remove the Mention.UpdatedAt field... * fix tests now new models are added, add more status edit DB tests * fix panic wording * add test for deleting status edits * don't automatically set `updated_at` field on updated statuses * flesh out more of the dereferencer status edit tests, ensure updated at field set on outgoing AS statuses * remove media_attachments.updated_at column * fix up more tests, further complete the dereferencer status edit tests * update more status serialization tests not expecting 'updated' AS property * gah!! json serialization tests!! * undo some gtscontext wrapping changes * more serialization test fixing :smiling_face_with_tear: * more test fixing, ensure the edit.status_id field is actually set :facepalm: * fix status edit test * grrr linter * add edited_at field to apimodel status * remove the choice of paging on the timeline public filtered test (otherwise it needs updating every time you add statuses ...) * ensure that status.updated_at always fits chronologically * fix more serialization tests ... * add more code comments * fix envparsing * update swagger file * properly handle media description changes during status edits * slight formatting tweak * code comment
2024-11-25[performance] convert enum strings to ints (#3558)Libravatar kim1
* convert statuses.visibility and notifications.notification_type columns from type string -> int for performance / space savings * fix test trying to compare string to int * fix instance count query using string literal instead of gtsmodel const type * ensure a default value is always set * also migrate the account settings and sin bin status tables * initialize maps outside loops and place into singular enum mapping creation func * use int16 for enum types * update sinbinstatus creation to be from a snapshot at initial creation * add snapshot of poll type at creation time
2024-10-08[feature] Distribute + ingest Accepts to followers (#3404)Libravatar tobi1
2024-09-17[bugfix] Fix incorrect policy value parsing (#3315)Libravatar tobi1
2024-08-13[bugfix] relax missing preferred_username, instead using webfingered ↵Libravatar kim1
username (#3189) * support no preferred_username, instead using webfingered username * add tests for the new preferred_username behaviour
2024-07-26[feature] Federate interaction policies + Accepts; enforce policies (#3138)Libravatar tobi8
* [feature] Federate interaction policies + Accepts; enforce policies * use Acceptable type * fix index * remove appendIRIStrs * add GetAccept federatingdb function * lock on object IRI
2024-06-11[bugfix] Deref stats async, serve stub collections if handshaking (#2990)v0.16.0-rc2Libravatar tobi2
* [bugfix] Deref stats async, allow peek if handshaking * don't return totalItems when handshaking or hiding collections * use GetLimit() * use StubAccountStats
2024-04-16[feature/performance] Store account stats in separate table (#2831)Libravatar tobi2
* [feature/performance] Store account stats in separate table, get stats from remote * test account stats * add some missing increment / decrement calls * change stats function signatures * rejig logging a bit * use lock when updating stats
2024-04-02[chore] Try to parse public key as both Actor + bare key (#2710)Libravatar tobi2
* [chore] Try to parse public key as both Actor + bare key * fix weird test fail
2024-04-02[feature] Option to hide followers/following (#2788)Libravatar tobi2
2024-03-13[feature] Process outgoing Move from clientAPI (#2750)Libravatar tobi1
* prevent moved accounts from taking create-type actions * update move logic * federate move out * indicate on web profile when an account has moved * [docs] Add migration docs section * lock while checking + setting move state * use redirectFollowers func for clientAPI as well * comment typo * linter? i barely know 'er! * Update internal/uris/uri.go Co-authored-by: Daenney <daenney@users.noreply.github.com> * add a couple tests for move * fix little mistake exposed by tests (thanks tests) * ensure Move marked as successful * attach shared util funcs to struct * lock whole account when doing move * move moving check to after error check * replace repeated text with error func * linterrrrrr!!!! * catch self follow case --------- Co-authored-by: Daenney <daenney@users.noreply.github.com>
2024-03-04[bugfix] Sanitize incoming PropertyValue fields (#2722)v0.14.0-rc3Libravatar tobi3
2024-02-27[feature] Add experimental `instance-federation-spam-filter` option (#2685)Libravatar tobi1
* [chore] Move `visibility` to `filter/visibility` * [feature] Add experimental instance-federation-spam-filter option
2024-02-23[bugfix] 2643 bug search for account url doesnt always work when redirected ↵Libravatar kim7
(#2673) * update activity library so dereferencer returns full response and checks *final* link to allow for redirects * temporarily add bodged fixed library * remove unused code * update getAccountFeatured() to use dereferenceCollectionPage() * make sure to release map * perform a 2nd decode to ensure reader is empty after primary decode * add comment explaining choice of using Decode() instead of Unmarshal() * update embedded activity library to latest matching https://github.com/superseriousbusiness/activity/pull/21 * add checks to look for changed URI and re-check database if redirected * update max iteration count to 512, add checks during dereferenceAncestors() for indirect URLs * remove doubled-up code * fix use of status instead of current * use URIs for checking equality for security * use the latest known URI for boost_of_uri in case original was an indirect * add dereferenceCollection() function for dereferenceAccountFeatured() * pull in latest github.com/superseriousbusiness/activity version (and remove the bodge!!) * fix typo in code comments * update decodeType() to accept a readcloser and handle body closing * switch to checking using BoostOfID and add note why not using BoostOfURI * ensure InReplyTo gets unset when deleting status parent in case currently stubbed * add tests for Collection and CollectionPage iterators
2024-02-06[feature] serdes for moved/also_known_as (#2600)Libravatar tobi4
* [feature] serdes for moved/also_known_as * document `alsoKnownAs` and `movedTo` properties * only implicitly populate AKA uris from DB for local accounts * don't let remotes store more than 20 AKA uris to avoid shenanigans
2024-01-26[bugfix] Don't return Account or Status if new and dereferencing failed, ↵Libravatar tobi1
other small fixes (#2563) * tidy up account, status, webfingering logic a wee bit * go fmt * invert published check * alter resp initialization * get Published from account in typeutils * don't instantiate error for no darn good reason * shadow err * don't repeat error codes in wrapped errors * don't wrap error unnecessarily
2024-01-22[bugfix] Don't return Internal Server Error when searching for URIs that ↵Libravatar tobi2
don't return AP JSON (#2550) * [bugfix] Don't return Internal Server Error when searching for URIs that don't return AP JSON * don't pass map pointer
2024-01-19[chore] Harden up boolptr logic on Accounts, warn if not set (#2544)Libravatar tobi2
2024-01-18[chore] chore rationalise http return codes for activitypub handlers (#2540)Libravatar kim1
* some small code fixups and changes * add check in ResolveIncomingActivity for transient activity types (i.e. activity ID is nil) * update test to handle new transient behaviour
2023-12-12[bugfix] poll vote count fixes (#2444)Libravatar kim1
* don't drop all vote counts if hideCounts is set, refactors poll option extraction slightly * omit voters_count when not set * make voters_count a ptr to ensure it is omit unless definitely needed * handle case of expires_at, voters_count and option.votes_count being nilable * faster isNil check * remove omitempty tags since mastodon API marks things as nullable but still sets them in outgoing json
2023-12-10[bugfix] Ensure `pre` renders as expected, fix orderedCollectionPage (#2434)Libravatar tobi1
2023-11-30[bugfix] return 400 Bad Request on more cases of malformed AS data (#2399)Libravatar kim4
2023-11-21[feature] Federate status language in and out (#2366)Libravatar tobi6
* [feature] Federate status language in + out * go fmt * tests, little fix * improve comments * unnest a bit * avoid unnecessary nil check * use more descriptive variable for contentMap * prefer instance languages when selecting from contentMap * update docs to reflect lang selection * rename rdfLangString -> rdfLangs * update comments to mention Pollable * iter through slice instead of map
2023-11-20[bugfix] self-referencing collection pages for status replies (#2364)Libravatar kim2
2023-11-11[bugfix] support endless polls, and misskey's' method of inferring expiry in ↵Libravatar kim1
closed polls (#2349)
2023-11-08[feature] add support for polls + receiving federated status edits (#2330)Libravatar kim2
2023-11-04[feature] support canceling scheduled tasks, some federation API performance ↵Libravatar kim3
improvements (#2329)
2023-10-31[bugfix] Relax `Mention` parsing, allowing either href or name (#2320)Libravatar tobi2
2023-10-26[bugfix] Extract description as `summary` first, fall back to `name` (#2303)Libravatar tobi3
2023-10-04[feature] tentatively start adding polls support (#2249)Libravatar kim5
2023-10-03[chore] internal/ap: add pollable AS types, code reformatting, general ↵Libravatar kim7
niceties (#2248)
2023-09-23[bugfix] support both CollectionPage AND OrderedCollectionPage in status ↵Libravatar kim3
replies (#2220)
2023-09-20[feature] add paging to AP following / followers endpoints (#2198)Libravatar kim2
2023-08-11[bugfix] Use custom bluemonday policy to disallow inline img tags (#2100)Libravatar tobi2
2023-07-31[feature] Hashtag federation (in/out), hashtag client API endpoints (#2032)Libravatar tobi3
* 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-06-27[bugfix] Use gtserror package for WrongType errs (#1930)Libravatar tobi10
* [bugfix] Use gtserror package for WrongType errs * test
2023-06-17[chore/bugfix] Refactor `ap/extract.go` functions, return URIs more reliably ↵Libravatar tobi3
(#1897)
2023-06-13[chore] Refactor AP authentication, other small bits of tidying up (#1874)Libravatar tobi2
2023-05-09[feature] Enable federation in/out of profile PropertyValue fields (#1722)Libravatar tobi6
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
2023-04-26[bugfix] Fix remaining mangled URI escaping issues in statuses + accounts ↵Libravatar tobi5
(#1712) * start fiddling with normalize + extract functions * normalize attachment name (image description) * NormalizeAccountableSummary * normalize summary + name
2023-04-06[bugfix] Normalize status content (don't parse status content as IRI) (#1665)Libravatar tobi5
* start fannying about * finish up Normalize * tidy up * pin to tag * move errors about just a little bit
2023-04-06[bugfix] Always serialize orderedItems as array (#1673)Libravatar tobi1
2023-03-12[chore] Improve copyright header handling (#1608)Libravatar Daenney10
* [chore] Remove years from all license headers Years or year ranges aren't required in license headers. Many projects have removed them in recent years and it avoids a bit of yearly toil. In many cases our copyright claim was also a bit dodgy since we added the 2021-2023 header to files created after 2021 but you can't claim copyright into the past that way. * [chore] Add license header check This ensures a license header is always added to any new file. This avoids maintainers/reviewers needing to remember to check for and ask for it in case a contribution doesn't include it. * [chore] Add missing license headers * [chore] Further updates to license header * Use the more common // indentend comment format * Remove the hack we had for the linter now that we use the // format * Add SPDX license identifier
2023-03-01[feature] Federate pinned posts (aka `featuredCollection`) in and out (#1560)Libravatar tobi1
* start fiddling * the ol' fiddle + update * start working on fetching statuses * poopy doopy doo where r u uwu * further adventures in featuring statuses * finishing up * fmt * simply status unpin loop * move empty featured check back to caller function * remove unnecessary log.WithContext calls * remove unnecessary IsIRI() checks * add explanatory comment about status URIs * change log level to error * better test names
2023-02-20[bugfix] Fix failure to look up remote profiles with duplicate emojis in ↵Libravatar Sam Lade1
some cases (#1534) * Tidy up emoji parsing on profile submission Don't bother reparsing for emoji unless one of the fields that can have emoji in it has changed. Deduplicate emoji between the display name and profile note - I'm not sure whether this was hurting anything, but better safe. * Deduplicate emoji when parsing remote accounts Some servers - Misskey at least - don't deduplicate emoji, so it's possible to get an account which has the same emoji used in both the display name and note and therefore includes that emoji twice in its metadata. When we start trying to put those into our database, we run into a uniqueness constraint and fall over. This change just deduplicates at the point of construction of an account.
2023-02-02[bugfix] Read Bookwyrm Articles more thoroughly (#1410)Libravatar tobi3
2023-01-27[feature] Federate reports to remote instance as Flag (if desired) (#1386)Libravatar tobi1
* reports federate out, we did it lxds * fix optional line start (should be optional slash)