auth

package
v1.2.37 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CreateUnsigned

func CreateUnsigned(pubkey, challenge by, 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 GenerateChallenge

func GenerateChallenge() (b by)

GenerateChallenge creates a reasonable, 96 byte base64 challenge string

func Validate

func Validate(evt *event.T, challenge by, relayURL st) (ok bo, err er)

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

This section is empty.

Jump to

Keyboard shortcuts

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