lnurlauth

package module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 6 Imported by: 0

README

Coverage Status Renovate enabled Build status Build status Go Report Card

LN Url

A golang lnurl example implementation by entropy. As per the lnurl-rfc this library also provides:

  1. auth: A canonical way to authenticate users with lnurl

This library is based on passport-ln-url-auth and utilizes go-lnurl.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(r *http.Request) (key, k1 string, err error)

authenticate a request, return key if successful otherwise an error

func GenerateLnUrl

func GenerateLnUrl(callbackUrl string) (encoded string, rawurl string, err error)

generate an ln url string

func GenerateQrCode

func GenerateQrCode(lnurl string) ([]byte, error)

generate a qr code from an lnurl

Types

type RequestStore

type RequestStore interface {
	// store request data
	Set(name, value string)
	// get data
	Get(name string) string
	// remove from request store, return removed value
	Remove(name string) string
}

store for reading/storing data into the client

type SessionData

type SessionData struct {
	LnUrl  string `json:"ln_url"`
	RawUrl string `json:"raw_url"`
	Key    string `json:"key"`
}

type SessionStore

type SessionStore interface {
	// store session data
	Set(k1 string, value SessionData)
	// get data
	Get(k1 string) *SessionData
	// remove from session storage
	Remove(name string) *SessionData
}

persistent store for authenticating users cross-request

Directories

Path Synopsis
integration provides a server example for integration tests actual tests are carried out in `example_test` in the `examples/` folder
integration provides a server example for integration tests actual tests are carried out in `example_test` in the `examples/` folder

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL