]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Authorization.hs
The attoparsec branch. It doesn't even compile for now.
[Lucu.git] / Network / HTTP / Lucu / Authorization.hs
index 6b0e1c268323150607da4f5ea2be37a92ea9ff58..d085234b5e1b4cf8c7c71cae9a10bb059c167a7c 100644 (file)
@@ -14,9 +14,10 @@ module Network.HTTP.Lucu.Authorization
     , authCredentialP -- private
     )
     where
+import Data.Ascii (Ascii)
+import qualified Data.Ascii as A
 import qualified Data.ByteString.Base64 as B64
 import qualified Data.ByteString.Char8 as C8
-import Network.HTTP.Lucu.Parser
 import Network.HTTP.Lucu.Parser.Http
 import Network.HTTP.Lucu.Utils
 import Prelude.Unicode
@@ -29,7 +30,7 @@ data AuthChallenge
       deriving (Eq)
 
 -- |'Realm' is just a string which must not contain any non-ASCII letters.
-type Realm = String
+type Realm = Ascii
 
 -- |Authorization credential to be sent by client with
 -- \"Authorization\" header. See
@@ -40,12 +41,13 @@ data AuthCredential
 
 -- |'UserID' is just a string which must not contain colon and any
 -- non-ASCII letters.
-type UserID   = String
+type UserID   = Ascii
 
 -- |'Password' is just a string which must not contain any non-ASCII
 -- letters.
-type Password = String
+type Password = Ascii
 
+-- FIXME: Don't use String for network output.
 instance Show AuthChallenge where
     show (BasicAuthChallenge realm)
         = "Basic realm=" ⧺ quoteStr realm