Add very basic oauth and mastodon api support.
This commit is contained in:
parent
4e785df984
commit
2a298d70f9
16 changed files with 286 additions and 0 deletions
16
priv/repo/migrations/20170906120646_add_mastodon_apps.exs
Normal file
16
priv/repo/migrations/20170906120646_add_mastodon_apps.exs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddMastodonApps do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:apps) do
|
||||
add :client_name, :string
|
||||
add :redirect_uris, :string
|
||||
add :scopes, :string
|
||||
add :website, :string
|
||||
add :client_id, :string
|
||||
add :client_secret, :string
|
||||
|
||||
timestamps()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
defmodule Pleroma.Repo.Migrations.CreateOAuthAuthorizations do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:oauth_authorizations) do
|
||||
add :app_id, references(:apps)
|
||||
add :user_id, references(:users)
|
||||
add :token, :string
|
||||
add :valid_until, :naive_datetime
|
||||
add :used, :boolean, default: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
end
|
||||
end
|
||||
15
priv/repo/migrations/20170906152508_create_o_auth_token.exs
Normal file
15
priv/repo/migrations/20170906152508_create_o_auth_token.exs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
defmodule Pleroma.Repo.Migrations.CreateOAuthToken do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:oauth_tokens) do
|
||||
add :app_id, references(:apps)
|
||||
add :user_id, references(:users)
|
||||
add :token, :string
|
||||
add :refresh_token, :string
|
||||
add :valid_until, :naive_datetime
|
||||
|
||||
timestamps()
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue