Skip to content

Commit 68b3332

Browse files
authored
Merge pull request #33 from biocad/shevchenkod/ABSCAN-1481-ghc9
Check key for aeson 2.
2 parents 2e4758c + 64b3fe9 commit 68b3332

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.1.3.13] - 2023-01-23
10+
### Changed
11+
- Add check for aeson 2, for GHC 9.2.5.
12+
913
## [0.1.3.12] - 2022-07-17
1014
### Changed
1115
- Update imports to support `lens-aeson` >=1.2.

src/Web/Template/Servant/Auth.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE LambdaCase #-}
23
{-# LANGUAGE OverloadedStrings #-}
34
{-# LANGUAGE RecordWildCards #-}
@@ -37,6 +38,11 @@ import Crypto.JWT (ClaimsSet, JWTError, JWTValidat
3738
defaultJWTValidationSettings, issuerPredicate,
3839
string, unregisteredClaims, uri, verifyClaims)
3940
import Data.Aeson (Value)
41+
42+
#if MIN_VERSION_aeson(2, 0, 0)
43+
import Data.Aeson.Key (fromText)
44+
#endif
45+
4046
import Data.Aeson.Lens (_String, key, values)
4147
import Data.ByteString (ByteString, stripPrefix)
4248
import qualified Data.ByteString.Lazy as LB
@@ -347,7 +353,11 @@ instance ( HasServer api context
347353
let haveRoles = claims
348354
^.. unregisteredClaims
349355
. ix "resource_access"
356+
#if MIN_VERSION_aeson(2, 0, 0)
357+
. key (fromText oidcClientId)
358+
#else
350359
. key oidcClientId
360+
#endif
351361
. key "roles"
352362
. values . _String
353363

web-template.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: web-template
2-
version: 0.1.3.12
2+
version: 0.1.3.13
33
synopsis: Web template
44
description:
55
Web template includes:

0 commit comments

Comments
 (0)