haskell-oidc-client icon indicating copy to clipboard operation
haskell-oidc-client copied to clipboard

Use ReaderT to carry the OIDC settings

Open ixmatus opened this issue 3 years ago • 3 comments

The primary reason for this change is to pave the way for user-defined HTTP manager / request settings that need to be carried with the OIDC settings (but do not really belong in the data type itself). ReaderT is more natural anyway for carrying the OIDC settings around to all the different functions that need it.

There's some very minor refactoring activity (e.g using local let bindings instead of where bindings), I tried to keep it specific to the addition of the ReaderT type though.

I know this is an API lift, so it likely requires a new minor version bump if this change is accepted.

ixmatus avatar Jun 09 '21 17:06 ixmatus

The latest build errors look like issues with the builder themselves. Is there anyway to retry the builds?

ixmatus avatar Jun 09 '21 21:06 ixmatus

CC: @krdlab.

ixmatus avatar Jun 11 '21 15:06 ixmatus

NB this PR may be moot, I've realized that the important functions which need a modified Manager can actually modify it. However it's probably worth determining whether we still want to use a ReaderT for the commonly shared OIDC value. I personally think it's still nice to use.

We could improve the interface a bit more by using a custom Monad that just wraps ReaderT though so it reads more naturally, e.g runTokenFlow or runOIDC or something.

ixmatus avatar Jun 11 '21 16:06 ixmatus