Safe Haskell | Safe-Infered |
---|
- data OAuth2 = OAuth2 {}
- data OAuthException = OAuthException String
- data AccessToken = AccessToken {}
- type QueryParams = [(ByteString, ByteString)]
- type PostBody = [(ByteString, ByteString)]
- type URI = ByteString
- appendQueryParam :: URI -> QueryParams -> URI
- transform' :: [(a, Maybe b)] -> [(a, b)]
- authorizationUrl :: OAuth2 -> URI
- accessTokenUrl :: OAuth2 -> ByteString -> (URI, PostBody)
- accessTokenUrl' :: OAuth2 -> ByteString -> Maybe ByteString -> (URI, PostBody)
- appendAccessToken :: URI -> OAuth2 -> URI
- accessTokenToParam :: ByteString -> [(ByteString, ByteString)]
Documentation
Query Parameter Representation
TODO: add a base endpoint URI.
data OAuthException Source
Simple Exception representation.
data AccessToken Source
The gained Access Token. Use Data.Aeson.decode
to decode string to AccessToken
.
type QueryParams = [(ByteString, ByteString)]Source
type synonym of query parameters
type PostBody = [(ByteString, ByteString)]Source
type synonym of post body content
type URI = ByteStringSource
type synonym of a URI
appendQueryParam :: URI -> QueryParams -> URISource
Append query parameters
transform' :: [(a, Maybe b)] -> [(a, b)]Source
lift value in the Maybe and abonda Nothing
authorizationUrl :: OAuth2 -> URISource
Prepare the authorization URL. Redirect to this URL asking for user interactive authentication.
:: OAuth2 | |
-> ByteString | access code gained via authorization URL |
-> (URI, PostBody) | access token request URL plus the request body. |
Prepare access token URL and the request body query.
:: OAuth2 | |
-> ByteString | access code gained via authorization URL |
-> Maybe ByteString | Grant Type |
-> (URI, PostBody) | access token request URL plus the request body. |
For GET method API.
accessTokenToParam :: ByteString -> [(ByteString, ByteString)]Source