Require token for Funkwhale scope=me sync

This commit is contained in:
svemagie
2026-03-09 19:51:57 +01:00
parent 55682087a0
commit ae583a8e35

View File

@@ -10,6 +10,20 @@ const patchSpecs = [
scope: "all",
});`,
newSnippet: ` return this.fetch("/api/v2/history/listenings", {
page,
page_size: pageSize,
// prefer user-scoped history to avoid instance-wide sync volume
scope: this.username && this.token ? "me" : "all",
});`,
candidates: [
"node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/funkwhale-client.js",
"node_modules/@indiekit/indiekit/node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/funkwhale-client.js",
],
},
{
name: "funkwhale-client-scope-me-token-guard",
marker: "require token for user-scoped history",
oldSnippet: ` return this.fetch("/api/v2/history/listenings", {
page,
page_size: pageSize,
// prefer user-scoped history to avoid instance-wide sync volume
@@ -19,6 +33,13 @@ const patchSpecs = [
"node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/funkwhale-client.js",
"node_modules/@indiekit/indiekit/node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/funkwhale-client.js",
],
newSnippet: ` return this.fetch("/api/v2/history/listenings", {
page,
page_size: pageSize,
// prefer user-scoped history to avoid instance-wide sync volume
// require token for user-scoped history
scope: this.username && this.token ? "me" : "all",
});`,
},
{
name: "lastfm-invalid-json-guard",