Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Parsers for PASETO tokens according to the message format defined in the specification.
Note that the parsers exported from this module do not perform any kind of token validation, cryptographic or otherwise. These parsers simply ensure that the input looks like a well-formed token.
Synopsis
- parseTokenV3Local :: Text -> Either ParseError (Token V3 Local)
- parseTokenV3Public :: Text -> Either ParseError (Token V3 Public)
- parseTokenV4Local :: Text -> Either ParseError (Token V4 Local)
- parseTokenV4Public :: Text -> Either ParseError (Token V4 Public)
- parseSomeToken :: Text -> Either ParseError SomeToken
- pVersion :: Parser Version
- pVersionV3 :: Parser Version
- pVersionV4 :: Parser Version
- pPurpose :: Parser Purpose
- pPurposeLocal :: Parser Purpose
- pPurposePublic :: Parser Purpose
- pPayload :: Parser Payload
- pFooter :: Parser Footer
- pPayloadAndFooter :: Parser (Payload, Maybe Footer)
- pTokenParts :: Parser Version -> Parser Purpose -> Parser (Version, Purpose, Payload, Maybe Footer)
- pTokenV3Local :: Parser (Token V3 Local)
- pTokenV3Public :: Parser (Token V3 Public)
- pTokenV4Local :: Parser (Token V4 Local)
- pTokenV4Public :: Parser (Token V4 Public)
- pSomeToken :: Parser SomeToken
Token parsers
parseTokenV3Local :: Text -> Either ParseError (Token V3 Local) Source #
Parse a version 3 local PASETO token from human-readable text according to the message format defined in the specification.
Note that this function does not perform any kind of token validation, cryptographic or otherwise. It simply parses the token and ensures that it is well-formed.
parseTokenV3Public :: Text -> Either ParseError (Token V3 Public) Source #
Parse a version 3 public PASETO token from human-readable text according to the message format defined in the specification.
Note that this function does not perform any kind of token validation, cryptographic or otherwise. It simply parses the token and ensures that it is well-formed.
parseTokenV4Local :: Text -> Either ParseError (Token V4 Local) Source #
Parse a version 4 local PASETO token from human-readable text according to the message format defined in the specification.
Note that this function does not perform any kind of token validation, cryptographic or otherwise. It simply parses the token and ensures that it is well-formed.
parseTokenV4Public :: Text -> Either ParseError (Token V4 Public) Source #
Parse a version 4 public PASETO token from human-readable text according to the message format defined in the specification.
Note that this function does not perform any kind of token validation, cryptographic or otherwise. It simply parses the token and ensures that it is well-formed.
parseSomeToken :: Text -> Either ParseError SomeToken Source #
Parse some kind of PASETO token from human-readable text according to the message format defined in the specification.
Note that this function does not perform any kind of token validation, cryptographic or otherwise. It simply parses the token and ensures that it is well-formed.
Parsec parsers
:: Parser Version | Parser for the |
-> Parser Purpose | Parser for the |
-> Parser (Version, Purpose, Payload, Maybe Footer) |
Parse the parts of a PASETO token: version, purpose, payload, and an optional footer.
pTokenV3Local :: Parser (Token V3 Local) Source #
Parse a version 3 local PASETO token from its string representation.
Accepted token format:
- Without the optional footer:
v3.local.${payload}
- With the optional footer:
v3.local.${payload}.${footer}
Both the payload
and optional footer
are base64url
-encoded values
(unpadded).
pTokenV3Public :: Parser (Token V3 Public) Source #
Parse a version 3 public PASETO token from its string representation.
Accepted token format:
- Without the optional footer:
v3.public.${payload}
- With the optional footer:
v3.public.${payload}.${footer}
Both the payload
and optional footer
are base64url
-encoded values
(unpadded).
pTokenV4Local :: Parser (Token V4 Local) Source #
Parse a version 4 local PASETO token from its string representation.
Accepted token format:
- Without the optional footer:
v4.local.${payload}
- With the optional footer:
v4.local.${payload}.${footer}
Both the payload
and optional footer
are base64url
-encoded values
(unpadded).
pTokenV4Public :: Parser (Token V4 Public) Source #
Parse a version 4 public PASETO token from its string representation.
Accepted token format:
- Without the optional footer:
v4.public.${payload}
- With the optional footer:
v4.public.${payload}.${footer}
Both the payload
and optional footer
are base64url
-encoded values
(unpadded).
pSomeToken :: Parser SomeToken Source #
Parse some kind of PASETO token from its string representation.
PASETO token format:
- Without the optional footer:
version.purpose.payload
- With the optional footer:
version.purpose.payload.footer
Acceptable values for version
are v3
and v4
. v1
and v2
are
deprecated, so they're not supported.
Acceptable values for purpose
are local
and public
.
Both the payload
and optional footer
are base64url
-encoded values
(unpadded).