1 defmodule Pleroma.Uploaders.Swift.Keystone do
4 def process_url(url) do
6 [Pleroma.Config.get!([Pleroma.Uploaders.Swift, :auth_url]), url],
11 def process_response_body(body) do
17 settings = Pleroma.Config.get(Pleroma.Uploaders.Swift)
18 username = Keyword.fetch!(settings, :username)
19 password = Keyword.fetch!(settings, :password)
20 tenant_id = Keyword.fetch!(settings, :tenant_id)
24 make_auth_body(username, password, tenant_id),
25 ["Content-Type": "application/json"],
28 {:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
29 body["access"]["token"]["id"]
31 {:ok, %HTTPoison.Response{status_code: _}} ->
36 def make_auth_body(username, password, tenant) do
39 :passwordCredentials => %{
40 :username => username,