auth

package
v1.2.22 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Unlicense Imports: 13 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.

Types

type B

type B = []byte

func GenerateChallenge

func GenerateChallenge() (b B)

GenerateChallenge creates a reasonable, 96 byte base64 challenge string

type Ctx

type Ctx = context.T

type E

type E = error

func Validate

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

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.

type N

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