Skip to content

Commit

Permalink
Version: 0.1.3.10: create OIDCConfig with custom manager (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
oddsome authored Aug 3, 2021
1 parent c84776f commit 51c8203
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.3.9] - 2021-07-015
## [0.1.3.10] - 2021-08-03
### Added
- Create OIDC config with provided tls manager.

## [0.1.3.9] - 2021-07-15
### Changed
- Pass access token to handlers.

Expand Down
7 changes: 5 additions & 2 deletions src/Web/Template/Servant/Auth.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module Web.Template.Servant.Auth
, UserId (..)
, OIDCConfig (..)
, defaultOIDCCfg
, oidcCfgWithManager
, OIDCUser (..)
, Permit
) where
Expand Down Expand Up @@ -152,10 +153,12 @@ data OIDCConfig
}

defaultOIDCCfg :: MonadIO m => m OIDCConfig
defaultOIDCCfg = do
defaultOIDCCfg = newTlsManager >>= oidcCfgWithManager

oidcCfgWithManager :: MonadIO m => Manager -> m OIDCConfig
oidcCfgWithManager mgr = do
discoCache <- liftIO $ Cache.newCache $ Just 0
keyCache <- liftIO $ Cache.newCache $ Just 0
mgr <- newTlsManager
return $ OIDCConfig
{ oidcManager = mgr
, oidcDiscoCache = discoCache
Expand Down
2 changes: 1 addition & 1 deletion web-template.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: web-template
version: 0.1.3.9
version: 0.1.3.10
synopsis: Web template
description:
Web template includes:
Expand Down

0 comments on commit 51c8203

Please sign in to comment.