Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype ThentosSessionToken = ThentosSessionToken {
- fromThentosSessionToken :: ST
- class GetThentosSessionToken a where
- getThentosSessionToken :: Getter a (Maybe ThentosSessionToken)
- type MonadUseThentosSessionToken s m = (MonadState s m, GetThentosSessionToken s)
- freshRandomName :: MonadRandom m => m ST
- freshSessionToken :: MonadRandom m => m ThentosSessionToken
Documentation
newtype ThentosSessionToken Source
class GetThentosSessionToken a where Source
getThentosSessionToken :: Getter a (Maybe ThentosSessionToken) Source
type MonadUseThentosSessionToken s m = (MonadState s m, GetThentosSessionToken s) Source
freshRandomName :: MonadRandom m => m ST Source
Return a base64 encoded random string of length 24 (18 bytes of entropy).
We use _
instead of /
as last letter of the base64 alphabet since it allows using names
within URLs without percent-encoding. Our Base64 alphabet thus consists of ASCII letters +
digits as well as +
and _
. All of these are reliably recognized in URLs, even if they occur
at the end.
RFC 4648 also has a "URL Safe Alphabet" which additionally replaces +
by -
. But that's
problematic, since -
at the end of URLs is not recognized as part of the URL by some programs
such as Thunderbird.
freshSessionToken :: MonadRandom m => m ThentosSessionToken Source