authenvelope

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: CC0-1.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate added in v1.0.11

func Validate(evt *event.T, challenge string,
	relayURL string) (pubkey string, ok bool)

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 Challenge

type Challenge struct {
	Challenge string
}

func NewChallenge

func NewChallenge(c string) (a *Challenge)

func (*Challenge) Bytes

func (a *Challenge) Bytes() []byte

func (*Challenge) Label

func (a *Challenge) Label() string

func (*Challenge) MarshalJSON

func (a *Challenge) MarshalJSON() ([]byte, error)

func (*Challenge) String

func (a *Challenge) String() string

func (*Challenge) ToArray

func (a *Challenge) ToArray() array.T

func (*Challenge) Unmarshal

func (a *Challenge) Unmarshal(buf *text.Buffer) (err error)

func (*Challenge) UnmarshalJSON added in v1.0.11

func (a *Challenge) UnmarshalJSON(bytes []byte) error

type Response

type Response struct {
	Event *event.T
}

func NewResponse

func NewResponse(ac *Challenge, rl string) (ae *Response)

NewResponse creates an Response response from an Challenge.

The caller must sign the embedded event before sending it back to authenticate.

func (*Response) Bytes

func (a *Response) Bytes() []byte

func (*Response) Label

func (a *Response) Label() string

func (*Response) MarshalJSON

func (a *Response) MarshalJSON() ([]byte, error)

func (*Response) String

func (a *Response) String() string

func (*Response) ToArray

func (a *Response) ToArray() array.T

func (*Response) Unmarshal

func (a *Response) Unmarshal(buf *text.Buffer) (err error)

func (*Response) UnmarshalJSON added in v1.0.11

func (a *Response) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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