, 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
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
-- |'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