auth

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: CC0-1.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChallengeTag = B("challenge")
View Source
var RelayTag = B("relay")

Functions

func CreateUnsigned

func CreateUnsigned(pubkey, challenge B, relayURL string) (ev *event.T)

CreateUnsigned creates an event which should be sent via an "AUTH" command. If the authentication succeeds, the user will be authenticated as pubkey.

func Validate

func Validate(evt *event.T, challenge B, relayURL S) (ok bool, err error)

Validate checks whether event is a valid NIP-42 event for given challenge and relayURL. The result of the validation is encoded in the ok bool.

Types

type B

type B = []byte

func GenerateChallenge

func GenerateChallenge() (b B)

GenerateChallenge creates a reasonable, 96 byte base64 challenge string

type E

type E = error

type N added in v0.0.14

type N = int

type S

type S = string

Jump to

Keyboard shortcuts

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