Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Zocca committed Oct 31, 2023
1 parent 750655a commit ef3afa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
17 changes: 5 additions & 12 deletions ms-auth/src/Network/OAuth2/Provider/AzureAD.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,21 @@ instance Show AzureADException where
--
--
-- Throws 'AzureADException' if @AZURE_CLIENT_ID@ and/or @AZURE_CLIENT_SECRET@ credentials are not found in the environment
--
-- for scopes refer to https://learn.microsoft.com/EN-US/azure/active-directory/develop/scopes-oidc#openid-connect-scopes
azureADApp :: MonadIO m =>
TL.Text -- ^ application name
-> [Scope] -- ^ scopes
-> m (IdpApplication 'ClientCredentials AzureAD)
azureADApp appname scopes = do
clid <- envClientId
sec <- envClientSecret
pure $ defaultAzureADApp{
idpAppName = appname
, idpAppClientId = clid
pure $ ClientCredentialsIDPAppConfig
{ idpAppClientId = clid
, idpAppClientSecret = sec
, idpAppScope = Set.fromList (scopes <> ["offline_access"])
}

defaultAzureADApp :: IdpApplication 'ClientCredentials AzureAD
defaultAzureADApp =
ClientCredentialsIDPAppConfig
{ idpAppClientId = ""
, idpAppClientSecret = ""
, idpAppScope = Set.fromList ["offline_access"] -- https://learn.microsoft.com/EN-US/azure/active-directory/develop/scopes-oidc#openid-connect-scopes
, idpAppTokenRequestExtraParams = Map.empty
, idpAppName = "default-azure-app" --
, idpAppName = appname
, idp = defaultAzureADIdp
}

Expand Down
2 changes: 1 addition & 1 deletion ms-azure-api/src/MSAzureAPI/StorageServices/FileService.hs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ listDirectoriesP = do
pure (DirItems es nm)

enumResultsIgnore :: XB.Parser ()
enumResultsIgnore = ignoreList ["Marker", "Prefix", "MaxResults", "DirectoryId"]
enumResultsIgnore = ignoreList ["Marker", "Prefix", "MaxResults", "DirectoryId"]

-- marker :: XB.Parser (Maybe Text)
-- marker = optional (TL.toStrict <$> tag "Marker" anystring)
Expand Down

0 comments on commit ef3afa9

Please sign in to comment.