Safe Haskell | None |
---|---|
Language | Haskell2010 |
LnUrl.Auth
Description
See https://github.com/fiatjaf/lnurl-rfc/blob/master/lnurl-auth.md.
Workflow
LN SERVICE
UsemkAuthUrl
to generate.LN WALLET
DecodeLNURL
and parse withparseAuthUrl
.LN WALLET
DisplayAuthUrl
details and get consent from user to authorize.LN WALLET
UsegetSignedCallback
to prepare follow-upGET
requestLN SERVICE
Responds withAckResponse
.
Synopsis
- mkAuthUrl :: URI -> Msg -> Maybe Action -> URI
- parseAuthUrl :: String -> Maybe AuthUrl
- authDomain :: AuthUrl -> String
- getSignedCallback :: XPrvKey -> AuthUrl -> URI
- data AuthUrl = AuthUrl {}
- data Action
- actionText :: Action -> Text
- parseAction :: Text -> Maybe Action
- data AckResponse
- deriveLinkingKey :: XPrvKey -> ByteString -> SecKey
- deriveLinkingPubKey :: XPrvKey -> ByteString -> PubKey
Server
mkAuthUrl :: URI -> Msg -> Maybe Action -> URI Source #
Add the challenge and action parameters to a URI
Client
authDomain :: AuthUrl -> String Source #
Use the linking key to sign a challenge
Types
actionText :: Action -> Text Source #
data AckResponse Source #
Constructors
AckSuccess | |
AckError Text |
Instances
Eq AckResponse Source # | |
Defined in LnUrl | |
Show AckResponse Source # | |
Defined in LnUrl Methods showsPrec :: Int -> AckResponse -> ShowS # show :: AckResponse -> String # showList :: [AckResponse] -> ShowS # | |
ToJSON AckResponse Source # | |
Defined in LnUrl Methods toJSON :: AckResponse -> Value # toEncoding :: AckResponse -> Encoding # toJSONList :: [AckResponse] -> Value # toEncodingList :: [AckResponse] -> Encoding # | |
FromJSON AckResponse Source # | |
Defined in LnUrl |
Utilities
Arguments
:: XPrvKey | |
-> ByteString | domain |
-> SecKey |
Derive the linking key from the domain
Arguments
:: XPrvKey | |
-> ByteString | domain |
-> PubKey |
Derive a public signing key