webauthn

package
v0.3.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKey

func DeriveKey() []byte

func HashUCANToken

func HashUCANToken(t *ucan.Token) ([]byte, error)

func ParseAssertionData

func ParseAssertionData(bz string) (*protocol.ParsedCredentialAssertionData, error)

ParseAssertionData takes a JSON string, converts it to a struct, and then converts that struct to a different struct

func ParseCreationData

func ParseCreationData(bz string) (*protocol.ParsedCredentialCreationData, error)

It takes a JSON string, converts it to a struct, and then converts that struct to a different struct

Types

type Option

type Option func(*webauthn.Config)

Option is a function that configures a session

func WithAttestionPreference

func WithAttestionPreference(pref protocol.ConveyancePreference) Option

WithAttestionPreference sets the AttestionPreference

func WithAuthenticatorSelect

func WithAuthenticatorSelect(selectAuth protocol.AuthenticatorSelection) Option

WithAuthenticatorSelect sets the AuthenticatorSelect

func WithRPIcon

func WithRPIcon(icon string) Option

WithRPIcon sets the RPIcon

func WithRPOrigins

func WithRPOrigins(origins []string) Option

WithRPOrigins sets the RPOrigins

func WithTimeout

func WithTimeout(timeout int) Option

WithTimeout sets the Timeout

type Session

type Session struct {
	AKA string
	// contains filtered or unexported fields
}

`Session` is a struct that contains a `string` (`ID`), a `string` (`RPID`), a `common.WebauthnCredential` (`WebauthnCredential`), a `types.DidDocument` (`DidDoc`), a `webauthn.SessionData` (`Data`), and a `string` (`AlsoKnownAs`). @property {string} ID - The session ID. @property {string} RPID - The Relying Party ID. This is the domain of the relying party. @property WebauthnCredential - This is the credential that was created by the user. @property DidDoc - The DID Document of the user. @property Data - This is the data that is returned from the webauthn.Create() function. @property {string} AlsoKnownAs - The user's username.

func NewSession

func NewSession(rpId string, aka string) (*Session, error)

NewSession creates a new session with challenge to be used to register a new account

func (*Session) Apply

func (s *Session) Apply(opts ...Option) error

Apply applies the options to the session

Jump to

Keyboard shortcuts

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