Commit Graph

66 Commits

Author SHA1 Message Date
Mark Felder 2f5eb79473 Mastodon API: Remove deprecated GET /api/v1/statuses/:id/card endpoint
Removed back in 2019

https://github.com/mastodon/mastodon/pull/11213
2024-06-09 17:38:06 +01:00
Mark Felder f4daa90bd8 Remove test validating missing descriptions are returned as an empty string 2024-06-09 17:37:59 +01:00
Mark Felder 2e5aa71176 Rich Media Cards are fetched asynchonously and not guaranteed to be available on first post render 2024-06-09 17:37:22 +01:00
Mark Felder 7ca655a999 Rich Media Cards are cached by URL not per status 2024-06-09 17:36:57 +01:00
Oneric 0c2b33458d Restrict media usage to owners
In Mastodon media can only be used by owners and only be associated with
a single post. We currently allow media to be associated with several
posts and until now did not limit their usage in posts to media owners.
However, media update and GET lookup was already limited to owners.
(In accordance with allowing media reuse, we also still allow GET
lookups of media already used in a post unlike Mastodon)

Allowing reuse isn’t problematic per se, but allowing use by non-owners
can be problematic if media ids of private-scoped posts can be guessed
since creating a new post with this media id will reveal the uploaded
file content and alt text.
Given media ids are currently just part of a sequentieal series shared
with some other objects, guessing media ids is with some persistence
indeed feasible.

E.g. sampline some public media ids from a real-world
instance with 112 total and 61 monthly-active users:

  17.465.096  at  t0
  17.472.673  at  t1 = t0 + 4h
  17.473.248  at  t2 = t1 + 20min

This gives about 30 new ids per minute of which most won't be
local media but remote and local posts, poll answers etc.
Assuming the default ratelimit of 15 post actions per 10s, scraping all
media for the 4h interval takes about 84 minutes and scraping the 20min
range mere 6.3 minutes. (Until the preceding commit, post updates were
not rate limited at all, allowing even faster scraping.)
If an attacker can infer (e.g. via reply to a follower-only post not
accessbile to the attacker) some sensitive information was uploaded
during a specific time interval and has some pointers regarding the
nature of the information, identifying the specific upload out of all
scraped media for this timerange is not impossible.

Thus restrict media usage to owners.

Checking ownership just in ActivitDraft would already be sufficient,
since when a scheduled status actually gets posted it goes through
ActivityDraft again, but would erroneously return a success status
when scheduling an illegal post.

Independently discovered and fixed by mint in Pleroma
1afde067b1
2024-05-22 20:30:18 +02:00
Oneric 20c22eb159 Fix flaky expires_at tests
The API parameter is not a timestamp but an offset.
If a sufficient amount of time passes between the tests
expires_at calculation and the internal calculation during processing
of the request the strict equality assertion fails. (Either a direct
assertion or indirect via job lookup).

To avoid this lower comparison granularity.
2024-04-21 21:08:53 +00:00
FloatingGhost 650c0c0f62 Allow max_id to be at the end of the querystring 2023-08-06 16:44:25 +01:00
FloatingGhost 98cb255d12 Support elixir1.15
OTP builds to 1.15

Changelog entry

Ensure policies are fully loaded

Fix :warn

use main branch for linkify

Fix warn in tests

Migrations for phoenix 1.17

Revert "Migrations for phoenix 1.17"

This reverts commit 6a3b2f15b74ea5e33150529385215b7a531f3999.

Oban upgrade

Add default empty whitelist

mix format

limit test to amd64

OTP 26 tests for 1.15

use OTP_VERSION tag

baka

just 1.15

Massive deps update

Update locale, deps

Mix format

shell????

multiline???

?

max cases 1

use assert_recieve

don't put_env in async tests

don't async conn/fs tests

mix format

FIx some uploader issues

Fix tests
2023-08-03 17:44:09 +01:00
floatingghost 6db8ab7c94 Merge pull request 'Varied selection of Pleroma cherry-picks' (#567) from XxXCertifiedForkliftDriverXxX/akkoma:cherry-picks into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/567
2023-07-27 12:53:56 +00:00
FloatingGhost 8fe29bf5d2 Exclude deactivated users from emoji reaction lists 2023-07-17 17:53:03 +01:00
tusooa fee6e2aac4 Fix deleting banned users' statuses 2023-06-14 22:45:19 +00:00
tusooa 1def80c2e7 Fix existing tests 2023-06-14 22:45:19 +00:00
tusooa 3095251e6c Dedupe poll options 2023-06-14 22:45:19 +00:00
FloatingGhost cc63a89b5d Fix tests 2023-01-10 10:29:17 +00:00
FloatingGhost f86bf16430 Add language support on /api/v1/statuses 2023-01-10 10:29:17 +00:00
ilja 745e15468e Use same context for quote posts as the post that's being quoted (#379)
See https://akkoma.dev/AkkomaGang/akkoma/pulls/350#issuecomment-6109

When making quotes through Mast-API, they will now have the same context as the quoted post. This also results in them being showed when fetching the thread. I checked Misskey to see how it's there, and they show the quotes there as well, see e.g. <https://mk.toast.cafe/notes/98u1g0tulg>.

An example from Akkoma:

Co-authored-by: ilja <git@ilja.space>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/379
Reviewed-by: floatingghost <hannah@coffee-and-dreams.uk>
Co-authored-by: ilja <akkoma.dev@ilja.space>
Co-committed-by: ilja <akkoma.dev@ilja.space>
2022-12-31 18:09:27 +00:00
FloatingGhost bf7ff6a337 Put rich media processing in a Task 2022-12-30 20:11:53 +00:00
floatingghost 07a48b9293 giant massive dep upgrade and dialyxir-found error emporium (#371)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/371
2022-12-14 12:38:48 +00:00
floatingghost 0cfd5b4e89 Add ability to set a default post expiry (#321)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/321
2022-11-28 13:34:54 +00:00
floatingghost 2641dcdd15 Post editing (#202)
Rebased from #103

Co-authored-by: Tusooa Zhu <tusooa@kazv.moe>
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/202
2022-09-06 19:24:02 +00:00
floatingghost decbca0c91 add seperate source and dest entries in language listing (#193)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/193
2022-08-30 16:59:33 +00:00
floatingghost df39cab9c1 Automatic status translation (#187)
Fixes #115

Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/187
2022-08-29 19:42:22 +00:00
Hélène b3e4d81362 StatusView: implement pleroma.context field
This field replaces the now deprecated conversation_id field, and now
exposes the ActivityPub object `context` directly via the MastoAPI
instead of relying on StatusNet-era data concepts.
2022-08-07 20:48:08 +01:00
floatingghost c9600dbbbf local-only-fixed (#138)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/138
2022-08-02 14:46:46 +00:00
floatingghost 1419eee5df Quote posting (#113)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/113
2022-07-25 16:30:06 +00:00
floatingghost dc9f66749c remove all endpoints marked as deprecated (#91)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/91
2022-07-20 12:00:58 +00:00
floatingghost 5b4d77eaa7 maintenance: dependency upgrade (#81)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/81
2022-07-18 00:56:35 +00:00
floatingghost 2342fface1 Add visibility check in context path (#26)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/26
2022-06-29 09:33:57 +00:00
Alex Gleason 62bf6d67e3
Merge remote-tracking branch 'pleroma/develop' into poll-notification-fixes 2021-07-18 11:49:22 -05:00
Alex Gleason 0114754db2
MastodonAPI: Support poll notification 2021-07-17 22:19:38 -05:00
Haelwenn 0c56f9de0d Merge branch 'tests/openapi-everywhere' into 'develop'
Put OpenAPI ~everywhere in tests

See merge request pleroma/pleroma!3324
2021-06-04 18:53:09 +00:00
Alex Gleason c435de426d
Merge remote-tracking branch 'pleroma/develop' into cycles-constants 2021-06-01 11:33:11 -05:00
Alex Gleason 10dfe81479
Pleroma.Constants.as_local_public/0 --> Pleroma.Web.ActivityPub.Utils.as_local_public/0
Move as_local_public/0 to stop making modules depend on Web at compile-time
2021-05-31 13:39:15 -05:00
Alexander Strizhakov ff612750b1
validator renaming & add validation for target 2021-03-25 13:03:40 +03:00
Alexander Strizhakov 3ec1dbd922
Let pins federate
- save object ids on pin, instead of activity ids
- pins federation
- removed pinned_activities field from the users table
- activityPub endpoint for user pins
- pulling remote users pins
2021-03-25 13:03:40 +03:00
Haelwenn (lanodan) Monnier ef5de5eb39
OpenAPI: MastodonAPI Status Controller 2021-03-15 06:47:07 +01:00
Mark Felder 913d53b7d7 Remove useless header on the get request 2021-03-02 14:04:50 -06:00
Mark Felder ccbf162088 Actually test viewing status after ingestion 2021-03-02 12:33:32 -06:00
Mark Felder f0208980e4 Test both ingestion of post in the status controller and the correct response during the view 2021-03-02 12:29:16 -06:00
lain 024c11c18d StatusController: Deactivate application support for now.
Some more things to discuss about, so we'll remove it from 2.3.0
2021-03-02 14:40:47 +01:00
Alexander Strizhakov f85ed1c521
warning fix 2021-02-28 19:41:25 +03:00
lain e6a14e1cd1 Merge branch 'feat/client_app_details' into 'develop'
Support application field

See merge request pleroma/pleroma!3311
2021-02-28 16:17:34 +00:00
Mark Felder 63739c5a58 Tests to validate client disclosure obeys user setting 2021-02-18 17:23:17 -06:00
Alexander Strizhakov 1e6c27181e
expires_in in scheduled status params 2021-02-18 14:59:22 +03:00
Mark Felder bd3d0e8b57 Use a custom oauth token so we can predict and validate the client_name and website 2021-02-11 15:53:10 -06:00
Mark Felder 333ff527fd Validate client application metadata is retained in the object 2021-02-11 15:07:21 -06:00
feld c3dd860a02 Merge branch 'fix/2449-scheduled-poll-bug' into 'develop'
Fix for scheduled post with poll

Closes #2449

See merge request pleroma/pleroma!3294
2021-02-03 14:22:23 +00:00
Alexander Strizhakov 0dc68c157f
fix for scheduled post with poll 2021-02-01 18:22:26 +03:00
Egor Kislitsyn 793fc77b16
Add active user count 2021-01-27 18:20:06 +04:00
Mark Felder e854c35e65 Convert tests to all use clear_config instead of Pleroma.Config.put 2021-01-26 11:58:43 -06:00