[#2074] OAuth scope checking in Streaming API.
This commit is contained in:
parent
6c052bd5b6
commit
60b025b782
7 changed files with 332 additions and 183 deletions
|
|
@ -27,6 +27,21 @@ defmodule Pleroma.DataCase do
|
|||
import Ecto.Query
|
||||
import Pleroma.DataCase
|
||||
use Pleroma.Tests.Helpers
|
||||
|
||||
# Sets up OAuth access with specified scopes
|
||||
defp oauth_access(scopes, opts \\ []) do
|
||||
user =
|
||||
Keyword.get_lazy(opts, :user, fn ->
|
||||
Pleroma.Factory.insert(:user)
|
||||
end)
|
||||
|
||||
token =
|
||||
Keyword.get_lazy(opts, :oauth_token, fn ->
|
||||
Pleroma.Factory.insert(:oauth_token, user: user, scopes: scopes)
|
||||
end)
|
||||
|
||||
%{user: user, token: token}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue