From fc6cf6169868e60c189e4b243330c3717ff159f3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 26 May 2022 13:58:07 +0200 Subject: ... --- overlays/spm/lib/Crypto/JWT/Instances.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 overlays/spm/lib/Crypto/JWT/Instances.hs (limited to 'overlays/spm/lib/Crypto/JWT') diff --git a/overlays/spm/lib/Crypto/JWT/Instances.hs b/overlays/spm/lib/Crypto/JWT/Instances.hs new file mode 100644 index 00000000..fa3c83b0 --- /dev/null +++ b/overlays/spm/lib/Crypto/JWT/Instances.hs @@ -0,0 +1,22 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} + +module Crypto.JWT.Instances () where + +import Prelude +import Control.Arrow + +import Crypto.JWT +import Servant.API.ContentTypes + + +instance MimeRender PlainText SignedJWT where + mimeRender _ = encodeCompact + +instance MimeRender OctetStream SignedJWT where + mimeRender _ = encodeCompact + +instance MimeUnrender PlainText SignedJWT where + mimeUnrender _ = left (show @Error) . decodeCompact + +instance MimeUnrender OctetStream SignedJWT where + mimeUnrender _ = left (show @Error) . decodeCompact -- cgit v1.2.3