This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/src/Settings/OAuth2.hs

33 lines
726 B
Haskell

-- SPDX-FileCopyrightText: 2024 Sarah Vaupel <sarah.vaupel@uniworx.de>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later
module Settings.OAuth2
( AzureConf(..)
, _azureClientId, _azureClientSecret, _azureTenantId, _azureScopes
) where
import ClassyPrelude
import Data.Aeson
import Data.Aeson.TH
import Data.UUID
import Utils.Lens.TH
import Utils.PathPiece (camelToPathPiece')
-- TODO: use better types
data AzureConf = AzureConf
{ azureClientId :: UUID
, azureClientSecret :: Text
, azureTenantId :: UUID
, azureScopes :: Set Text -- TODO: use better type
} deriving (Show)
makeLenses_ ''AzureConf
deriveFromJSON defaultOptions
{ fieldLabelModifier = camelToPathPiece' 1
} ''AzureConf