Skip to content

Commit

Permalink
Support GHC 9.6.6 +API response fixes + Fix fetching keys
Browse files Browse the repository at this point in the history
  • Loading branch information
nitinprakash96 committed Jul 7, 2024
1 parent 4a6f0e5 commit 7c95055
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions azure-auth/Azure/Types.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Azure.Types
( ExpiresOn
, AccessToken (..)
( AccessToken (..)
, ExpiresOn
, Token
, newEmptyToken
, updateToken
Expand Down Expand Up @@ -29,17 +29,15 @@ data AccessToken = AccessToken
-- ^ The requested access token. When you call a secured REST API, the
-- token is embedded in the Authorization request header field as a @bearer@
-- token, allowing the API to authenticate the caller.
, atRefreshToken :: !Text
-- ^ Not used by managed identities for Azure resources.
, atExpiresIn :: !Integer
, atExpiresIn :: !Text
-- ^ The number of seconds the access token continues to be valid, before
-- expiring, from time of issuance. Time of issuance can be found in
-- the token's @iat@ claim.
-- the token's @iat@ claim. This is represented as a string type.
, atExpiresOn :: !ExpiresOn
-- ^ The timespan when the access token expires. The date is
-- represented as the number of seconds from @1970-01-01T0:0:0Z UTC@
-- (corresponds to the token's @exp@ claim).
-- NOTE: expires_on is a String version of unix epoch time, not an integer.
-- NOTE: @expires_on@ is a string version of unix epoch time, not an integer.
, atResource :: !Text
-- ^ The resource the access token was requested for, which
-- matches the resource query string parameter of the request.
Expand All @@ -52,7 +50,6 @@ data AccessToken = AccessToken
instance FromJSON AccessToken where
parseJSON = withObject "AccessToken" $ \o -> do
atAccessToken <- o .: "access_token"
atRefreshToken <- o .: "refresh_token"
atExpiresIn <- o .: "expires_in"
atExpiresOn <- o .: "expires_on"
atResource <- o .: "resource"
Expand Down
2 changes: 1 addition & 1 deletion azure-key-vault/Azure/Secret.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ callKeyVaultClient ::
m KeyVaultResponse
callKeyVaultClient action secretName vaultHost tokenStore = do
manager <- liftIO newTlsManager
authHeader <- defaultAzureCredential Nothing "https://vault.azure.net" tokenStore
authHeader <- defaultAzureCredential Nothing vaultHost tokenStore
res <-
liftIO $
runClientM
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-22.26 # based on ghc-9.6.5
resolver: lts-22.28 # based on ghc-9.6.6

packages:
- ./azure-auth
Expand Down

0 comments on commit 7c95055

Please sign in to comment.