Skip to content

Commit

Permalink
moved shape_from_params to Electric.Phoenix top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetised committed Nov 20, 2024
1 parent 1d1a37e commit 61fd07f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/gatekeeper-auth/api/lib/api/token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule Api.Token do
end

defp matches(%ShapeDefinition{} = request_shape, %{} = shape_claim) do
with {:ok, token_shape} <- Electric.Phoenix.Plug.shape_from_params(shape_claim) do
with {:ok, token_shape} <- Electric.Phoenix.shape_from_params(shape_claim) do
ShapeDefinition.matches?(request_shape, token_shape)
else
_alt -> false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule ApiWeb.Plugs.AssignShape do
"""
use ApiWeb, :plug

import Electric.Phoenix.Plug, only: [shape_from_params: 1]
import Electric.Phoenix, only: [shape_from_params: 1]

def init(opts), do: opts

Expand Down
2 changes: 1 addition & 1 deletion examples/gatekeeper-auth/api/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule Api.MixProject do
defp deps do
[
{:bandit, "~> 1.5"},
{:electric_phoenix, ">= 0.2.0-rc-3"},
{:electric_phoenix, ">= 0.2.0-rc-4"},
{:ecto_sql, "~> 3.10"},
{:jason, "~> 1.4"},
{:joken, "~> 2.6"},
Expand Down
2 changes: 1 addition & 1 deletion examples/gatekeeper-auth/api/mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ecto": {:hex, :ecto, "3.12.4", "267c94d9f2969e6acc4dd5e3e3af5b05cdae89a4d549925f3008b2b7eb0b93c3", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ef04e4101688a67d061e1b10d7bc1fbf00d1d13c17eef08b71d070ff9188f747"},
"ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"},
"electric_client": {:hex, :electric_client, "0.2.1-rc-3", "4d1fbcd99c5d39e1e55757d80020dec2d9bb094582671e69f6cb792f9bc7f8dd", [:mix], [{:ecto_sql, "~> 3.12", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:gen_stage, "~> 1.2", [hex: :gen_stage, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 1.1", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:req, "~> 0.5", [hex: :req, repo: "hexpm", optional: false]}], "hexpm", "3f45d9aad707688293ab75ef3abf37955ef663f851e99ad0a96fc06f0de54a93"},
"electric_phoenix": {:hex, :electric_phoenix, "0.2.0-rc-3", "35db91a05040486b691b950fe431ed30a45716755d81b62e5f4ef84b844129be", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:electric_client, ">= 0.2.1-rc-1", [hex: :electric_client, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 1.1", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.20", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "542983fc349857f45b9eed4a060308414eb8305dbf0fc0a7ba5abb0c620ea802"},
"electric_phoenix": {:hex, :electric_phoenix, "0.2.0-rc-4", "60198df22d32266dcad29c38ae06f1ac52a46c173c045cc733b708c6c0da3ff3", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:electric_client, ">= 0.2.1-rc-1", [hex: :electric_client, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 1.1", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.20", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "1fd4db962bf57f6387b86a77005841c93c341524a5d9434057e3d5a6c5e75325"},
"finch": {:hex, :finch, "0.19.0", "c644641491ea854fc5c1bbaef36bfc764e3f08e7185e1f084e35e0672241b76d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.6.2 or ~> 1.7", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 1.1", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fc5324ce209125d1e2fa0fcd2634601c52a787aff1cd33ee833664a5af4ea2b6"},
"hpax": {:hex, :hpax, "1.0.0", "28dcf54509fe2152a3d040e4e3df5b265dcb6cb532029ecbacf4ce52caea3fd2", [:mix], [], "hexpm", "7f1314731d711e2ca5fdc7fd361296593fc2542570b3105595bb0bc6d0fad601"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule ApiWeb.AuthenticatorTest do

alias ApiWeb.Authenticator

import Electric.Phoenix.Plug, only: [shape_from_params: 1]
import Electric.Phoenix, only: [shape_from_params: 1]

describe "authenticator" do
test "generate token" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule ApiWeb.GatekeeperTest do

alias ApiWeb.Authenticator

import Electric.Phoenix.Plug, only: [shape_from_params: 1]
import Electric.Phoenix, only: [shape_from_params: 1]

setup %{conn: conn} do
{:ok, conn: put_req_header(conn, "accept", "application/json")}
Expand Down

0 comments on commit 61fd07f

Please sign in to comment.