diff options
| author | adambrangenberg <adabran06@gmail.com> | 2025-12-24 03:40:10 +0100 |
|---|---|---|
| committer | adambrangenberg <adabran06@gmail.com> | 2025-12-24 03:40:10 +0100 |
| commit | a0886694f73fc382d78da79ab8bfb27475757bab (patch) | |
| tree | 652ba9b603a1acaf4dfca188f7bb2c29c6bccfd0 /src/Data/WellKnownClientData.hs | |
| parent | 2b48a574e8b9fed03a5c1969af4bb1e338f1be26 (diff) | |
Implemented basic auth, refactor
Diffstat (limited to 'src/Data/WellKnownClientData.hs')
| -rw-r--r-- | src/Data/WellKnownClientData.hs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/Data/WellKnownClientData.hs b/src/Data/WellKnownClientData.hs deleted file mode 100644 index 310002d..0000000 --- a/src/Data/WellKnownClientData.hs +++ /dev/null @@ -1,34 +0,0 @@ -{-# LANGUAGE DeriveGeneric #-} - -module Data.WellKnownClientData (WellKnownClient, makeWellKnownClient) where - -import Data.Aeson -import Data.Aeson.TH -import GHC.Generics (Generic) - -data BaseUrlHolder = BaseUrlHolder - { base_url :: String - } deriving (Eq, Show, Generic) - -instance FromJSON BaseUrlHolder where -instance ToJSON BaseUrlHolder where - -data WellKnownClient = WellKnownClient - { homeserver :: BaseUrlHolder - , identity_server :: BaseUrlHolder - } deriving (Eq, Show, Generic) - -fieldMapping :: String -> String -fieldMapping "homeserver" = "m.homeserver" -fieldMapping "identity_server" = "m.identity_server" -fieldMapping name = name - -instance FromJSON WellKnownClient where - parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = fieldMapping } - -instance ToJSON WellKnownClient where - toJSON = genericToJSON defaultOptions { fieldLabelModifier = fieldMapping } - -makeWellKnownClient :: String -> String -> WellKnownClient -makeWellKnownClient homeserver identity_server = - WellKnownClient (BaseUrlHolder homeserver) (BaseUrlHolder identity_server) |