diff options
Diffstat (limited to 'hosts/surtr/email/spm/lib/Spm/Api.hs')
-rw-r--r-- | hosts/surtr/email/spm/lib/Spm/Api.hs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/hosts/surtr/email/spm/lib/Spm/Api.hs b/hosts/surtr/email/spm/lib/Spm/Api.hs deleted file mode 100644 index d9644222..00000000 --- a/hosts/surtr/email/spm/lib/Spm/Api.hs +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | {-# LANGUAGE TemplateHaskell #-} | ||
2 | |||
3 | module Spm.Api | ||
4 | ( SpmMailbox | ||
5 | , SpmApi, spmApi | ||
6 | ) where | ||
7 | |||
8 | import Prelude | ||
9 | |||
10 | import Servant.API | ||
11 | |||
12 | import Data.Proxy (Proxy(..)) | ||
13 | |||
14 | import Data.Text (Text) | ||
15 | |||
16 | import GHC.Generics (Generic) | ||
17 | import Type.Reflection (Typeable) | ||
18 | |||
19 | import Control.Lens.TH | ||
20 | |||
21 | import Data.CaseInsensitive (CI) | ||
22 | import Data.CaseInsensitive.Instances () | ||
23 | |||
24 | import Crypto.JOSE.JWK (JWKSet) | ||
25 | |||
26 | import Data.UUID (UUID) | ||
27 | import Data.UUID.Instances () | ||
28 | |||
29 | |||
30 | newtype SpmMailbox = SpmMailbox { unSpmMailbox :: CI Text } | ||
31 | deriving stock (Eq, Ord, Read, Show, Generic, Typeable) | ||
32 | deriving newtype (MimeRender JSON, MimeRender PlainText) | ||
33 | makeWrapped ''SpmMailbox | ||
34 | |||
35 | type SpmApi = "whoami" :> Get '[PlainText, JSON] SpmMailbox | ||
36 | :<|> ".well-known" :> "jwks.json" :> Get '[JSON] JWKSet | ||
37 | :<|> "instance-id" :> Get '[PlainText, JSON, OctetStream] UUID | ||
38 | |||
39 | spmApi :: Proxy SpmApi | ||
40 | spmApi = Proxy | ||