Current section

19 Versions

Jump to

Compare versions

4 files changed
+20 additions
-28 deletions
  @@ -5,26 +5,26 @@
5 5 {<<"elixir">>,<<"~> 1.13">>}.
6 6 {<<"files">>,
7 7 [<<"lib">>,<<"lib/charon_oauth2">>,<<"lib/charon_oauth2/types">>,
8 - <<"lib/charon_oauth2/types/hmac.ex">>,
9 8 <<"lib/charon_oauth2/types/encrypted.ex">>,
9 + <<"lib/charon_oauth2/types/hmac.ex">>,
10 10 <<"lib/charon_oauth2/types/separated_string_ordset.ex">>,
11 - <<"lib/charon_oauth2/migration.ex">>,<<"lib/charon_oauth2/internal">>,
11 + <<"lib/charon_oauth2/migration.ex">>,<<"lib/charon_oauth2/internal.ex">>,
12 + <<"lib/charon_oauth2/config.ex">>,<<"lib/charon_oauth2/internal">>,
12 13 <<"lib/charon_oauth2/internal/plug.ex">>,
13 14 <<"lib/charon_oauth2/internal/gen_mod">>,
14 - <<"lib/charon_oauth2/internal/gen_mod/authorization.ex">>,
15 - <<"lib/charon_oauth2/internal/gen_mod/client.ex">>,
16 - <<"lib/charon_oauth2/internal/gen_mod/grants.ex">>,
17 15 <<"lib/charon_oauth2/internal/gen_mod/authorizations.ex">>,
18 - <<"lib/charon_oauth2/internal/gen_mod/clients.ex">>,
19 16 <<"lib/charon_oauth2/internal/gen_mod/plugs">>,
20 17 <<"lib/charon_oauth2/internal/gen_mod/plugs/token_endpoint.ex">>,
21 18 <<"lib/charon_oauth2/internal/gen_mod/plugs/authorization_endpoint.ex">>,
22 - <<"lib/charon_oauth2/internal/gen_mod/grant.ex">>,
23 19 <<"lib/charon_oauth2/internal/gen_mod/test_seeds.ex">>,
20 + <<"lib/charon_oauth2/internal/gen_mod/grants.ex">>,
21 + <<"lib/charon_oauth2/internal/gen_mod/clients.ex">>,
22 + <<"lib/charon_oauth2/internal/gen_mod/authorization.ex">>,
23 + <<"lib/charon_oauth2/internal/gen_mod/grant.ex">>,
24 + <<"lib/charon_oauth2/internal/gen_mod/client.ex">>,
24 25 <<"lib/charon_oauth2/internal/req_validators">>,
25 - <<"lib/charon_oauth2/internal/req_validators/authorization_validator.ex">>,
26 26 <<"lib/charon_oauth2/internal/req_validators/token_validator.ex">>,
27 - <<"lib/charon_oauth2/config.ex">>,<<"lib/charon_oauth2/internal.ex">>,
27 + <<"lib/charon_oauth2/internal/req_validators/authorization_validator.ex">>,
28 28 <<"lib/charon_oauth2.ex">>,<<".formatter.exs">>,<<"mix.exs">>,
29 29 <<"README.md">>]}.
30 30 {<<"licenses">>,[<<"Apache-2.0">>]}.
  @@ -52,4 +52,4 @@
52 52 {<<"optional">>,false},
53 53 {<<"repository">>,<<"hexpm">>},
54 54 {<<"requirement">>,<<"~> 3.1">>}]]}.
55 - {<<"version">>,<<"0.5.0">>}.
55 + {<<"version">>,<<"0.5.1">>}.
  @@ -73,7 +73,9 @@ defmodule CharonOauth2.Internal.GenMod.Grant do
73 73 :authorization_id,
74 74 :resource_owner_id
75 75 ])
76 - |> validate_inclusion(:type, @types, message: "must be one of: #{Enum.join(@types, ", ")}")
76 + |> validate_inclusion(:type, @types,
77 + message: "must be one of: #{Enum.join(@types, ", ")}"
78 + )
77 79 |> prepare_changes(fn cs = %{data: data} ->
78 80 type = get_field(cs, :type)
79 81 auth_id = get_field(cs, :authorization_id)
  @@ -134,7 +136,9 @@ defmodule CharonOauth2.Internal.GenMod.Grant do
134 136 :authorization_client ->
135 137 query
136 138 |> resolve_binding(:authorization)
137 - |> join(:left, [authorization: a], c in assoc(a, :client), as: :authorization_client)
139 + |> join(:left, [authorization: a], c in assoc(a, :client),
140 + as: :authorization_client
141 + )
138 142
139 143 :authorization_resource_owner ->
140 144 query
  @@ -72,19 +72,7 @@ defmodule CharonOauth2.Internal.GenMod.Plugs.TokenEndpoint do
72 72 @impl true
73 73 def init(opts) do
74 74 config = Keyword.fetch!(opts, :config)
75 - config = %{config | session_ttl: :infinite}
76 -
77 - # Charon 3.1 compatibility
78 - config =
79 - config
80 - |> case do
81 - config = %{enforce_browser_cookies: true} ->
82 - %{config | enforce_browser_cookies: false}
83 -
84 - _ ->
85 - config
86 - end
87 -
75 + config = %{config | session_ttl: :infinite, enforce_browser_cookies: false}
88 76 mod_conf = CharonOauth2.Internal.get_module_config(config)
89 77 %{config: config, mod_conf: mod_conf}
90 78 end
  @@ -4,7 +4,7 @@ defmodule CharonOauth2.MixProject do
4 4 def project do
5 5 [
6 6 app: :charon_oauth2,
7 - version: "0.5.0",
7 + version: "0.5.1",
8 8 elixir: "~> 1.13",
9 9 start_permanent: Mix.env() == :prod,
10 10 deps: deps(),
  @@ -21,7 +21,7 @@ defmodule CharonOauth2.MixProject do
21 21 source_url: "https://github.com/weareyipyip/charon_oauth2",
22 22 name: "CharonOauth2",
23 23 docs: [
24 - source_ref: "v0.5.0",
24 + source_ref: "v0.5.1",
25 25 extras: ["./README.md", "./example-auth-page.md"],
26 26 main: "readme"
27 27 ]
  @@ -46,7 +46,7 @@ defmodule CharonOauth2.MixProject do
46 46 {:postgrex, ">= 0.0.0", only: [:dev, :test]},
47 47 {:jason, "~> 1.4", only: [:dev, :test]},
48 48 {:mix_test_watch, "~> 1.0", only: [:dev], runtime: false},
49 - {:dialyxir, "~> 1.3.0", only: [:dev], runtime: false}
49 + {:dialyxir, "~> 1.3", only: [:dev], runtime: false}
50 50 ]
51 51 end