erlef / oidcc

OpenId Connect client library in Erlang & Elixir
https://hexdocs.pm/oidcc
Apache License 2.0
184 stars 49 forks source link

fix: `application:get_env/2` returns `{ok, Value}` #288

Closed paulswartz closed 1 year ago

paulswartz commented 1 year ago

Ran into this while trying to use max_clock_skew to investigate something else. This didn't appear to be covered by tests, but happy to add them if you can point me in the right direction.

maennchen commented 1 year ago

@paulswartz Good catch.

A test for this would be awesome. We could probably duplicate the retrieve_rs256_with_rotation_test and remove the rotation parts. Instead we can set the nbf / exp fields to slightly expired valuues and use the clock skew to still make it pass.

https://github.com/erlef/oidcc/blob/71896a05aaf7c695a1e66f2fa75e7f1ad77428e1/test/oidcc_token_test.erl#L124

paulswartz commented 1 year ago

@maennchen thank you for the pointer! I ended up using a simpler test example (less to remove!) but let me know if you don't think that works.