joken-elixir / joken_jwks

A Joken 2 hook for fetching the signer from a public JWKS url
Apache License 2.0
29 stars 24 forks source link

⬆️ Upgrade hackney dependency #58

Closed cgrothaus closed 3 months ago

cgrothaus commented 4 months ago

Goal

Upgrade hackney dependency.

Fixes #56. Fixes #57.

Changes

cgrothaus commented 3 weeks ago

@victorolinasc This PR is merged, but not released yet. Is there a chance on putting it into a patch release in the near future?

victorolinasc commented 3 weeks ago

I am waiting for someone to report that current master is ok with the process structure changes. Can you try that and see if things are working properly? If so, I'll gladly release a new version.

cgrothaus commented 2 weeks ago

I guess with process structure changes you are referring to PR #48 ?

I have not initially written the joken_jwks based JWKS integration for our application, I just came into the project at the beginning of this year and inherited the code for maintenance. Thus, I don't understand the changes yet.

Do you have any migration instructions?

I see that we are using Joken 2 with Joken.Config and a hook, just as you explain in the README:

add_hook(JokenJwks,
  strategy: MyAppWeb.UserTokenVerification.Google.JwksStrategy
)

and that strategy looks like this, pretty straightforward:

defmodule MyAppWeb.UserTokenVerification.Google.JwksStrategy do
  use JokenJwks.DefaultStrategyTemplate

  def init_opts(opts) do
    url = Application.fetch_env!(:my_app, :google_token_jwks_url)
    Keyword.merge(opts, jwks_url: url)
  end

  def expire_cache do
    __MODULE__.EtsCache.set_status(:refresh)
  end
end

I already understand that EtsCache is not included in the DefaultStrategyTemplate use macro anymore. How must I rewrite the cache expiry?