Merge branch 'identity-proofs' into 'develop'

Remove stub for /api/v1/accounts/:id/identity_proofs (deprecated by Mastodon 3.5.0)

See merge request pleroma/pleroma!4215
This commit is contained in:
feld 2024-08-12 19:53:32 +00:00
commit aa4f5428d3
6 changed files with 2 additions and 37 deletions

View file

@ -0,0 +1 @@
Remove stub for /api/v1/accounts/:id/identity_proofs (deprecated by Mastodon 3.5.0)

View file

@ -510,12 +510,6 @@ Pleroma is generally compatible with the Mastodon 2.7.2 API, but some newer feat
- `GET /api/v1/trends`: Returns an empty array, `[]` - `GET /api/v1/trends`: Returns an empty array, `[]`
### Identity proofs
*Added in Mastodon 2.8.0*
- `GET /api/v1/identity_proofs`: Returns an empty array, `[]`
### Featured tags ### Featured tags
*Added in Mastodon 3.0.0* *Added in Mastodon 3.0.0*

View file

@ -498,22 +498,6 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
} }
end end
def identity_proofs_operation do
%Operation{
tags: ["Retrieve account information"],
summary: "Identity proofs",
operationId: "AccountController.identity_proofs",
# Validators complains about unused path params otherwise
parameters: [
%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}
],
description: "Not implemented",
responses: %{
200 => empty_array_response()
}
}
end
def familiar_followers_operation do def familiar_followers_operation do
%Operation{ %Operation{
tags: ["Retrieve account information"], tags: ["Retrieve account information"],

View file

@ -22,7 +22,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
alias Pleroma.Web.CommonAPI alias Pleroma.Web.CommonAPI
alias Pleroma.Web.MastodonAPI.ListView alias Pleroma.Web.MastodonAPI.ListView
alias Pleroma.Web.MastodonAPI.MastodonAPI alias Pleroma.Web.MastodonAPI.MastodonAPI
alias Pleroma.Web.MastodonAPI.MastodonAPIController
alias Pleroma.Web.MastodonAPI.StatusView alias Pleroma.Web.MastodonAPI.StatusView
alias Pleroma.Web.OAuth.OAuthController alias Pleroma.Web.OAuth.OAuthController
alias Pleroma.Web.Plugs.OAuthScopesPlug alias Pleroma.Web.Plugs.OAuthScopesPlug
@ -51,7 +50,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
plug( plug(
OAuthScopesPlug, OAuthScopesPlug,
%{scopes: ["read:accounts"]} %{scopes: ["read:accounts"]}
when action in [:verify_credentials, :endorsements, :identity_proofs] when action in [:verify_credentials, :endorsements]
) )
plug( plug(
@ -660,7 +659,4 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
defp get_familiar_followers(user, current_user) do defp get_familiar_followers(user, current_user) do
User.get_familiar_followers(user, current_user) User.get_familiar_followers(user, current_user)
end end
@doc "GET /api/v1/identity_proofs"
def identity_proofs(conn, params), do: MastodonAPIController.empty_array(conn, params)
end end

View file

@ -648,7 +648,6 @@ defmodule Pleroma.Web.Router do
get("/accounts/relationships", AccountController, :relationships) get("/accounts/relationships", AccountController, :relationships)
get("/accounts/familiar_followers", AccountController, :familiar_followers) get("/accounts/familiar_followers", AccountController, :familiar_followers)
get("/accounts/:id/lists", AccountController, :lists) get("/accounts/:id/lists", AccountController, :lists)
get("/accounts/:id/identity_proofs", AccountController, :identity_proofs)
get("/endorsements", AccountController, :endorsements) get("/endorsements", AccountController, :endorsements)
get("/blocks", AccountController, :blocks) get("/blocks", AccountController, :blocks)
get("/mutes", AccountController, :mutes) get("/mutes", AccountController, :mutes)

View file

@ -6,15 +6,6 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
use Pleroma.Web.ConnCase, async: true use Pleroma.Web.ConnCase, async: true
describe "empty_array/2 (stubs)" do describe "empty_array/2 (stubs)" do
test "GET /api/v1/accounts/:id/identity_proofs" do
%{user: user, conn: conn} = oauth_access(["read:accounts"])
assert [] ==
conn
|> get("/api/v1/accounts/#{user.id}/identity_proofs")
|> json_response(200)
end
test "GET /api/v1/endorsements" do test "GET /api/v1/endorsements" do
%{conn: conn} = oauth_access(["read:accounts"]) %{conn: conn} = oauth_access(["read:accounts"])