webauthn

package
v0.0.0-...-dcec590 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticatorOptionsREST

func AuthenticatorOptionsREST() usecase.IOInteractor

func AuthenticatorRegisterREST

func AuthenticatorRegisterREST() usecase.IOInteractor

func GetAttestationOptions

func GetAttestationOptions(ctx context.Context, authenticatorType webauthn.AuthenticatorAttachment) (ccOptions *webauthn.PublicKeyCredentialCreationOptions, fullChallenge []byte, err error)

func Init

func Init(ctx context.Context, cfg *Config) error

Types

type Authenticator

type Authenticator struct {
	RegistrationID            string    `gorm:"primary_key"` // base64url encoded ID returned from client
	ChallengeHash             string    // Foreign key to the Challenge
	Attestation               []byte    // PublicKeyCredentialAttestation returned from the client
	VerifiedRPID              string    // RPID used during the verification
	VerifiedOrigin            string    // Origin used during the verification
	VerificationTime          time.Time // Time of the verification
	TrustCertThumbprintSHA256 string    // Hex encoded SHA256 hash of the trust path first certificate
	AuthenticatorGUID         []byte    // Foreign key to the AuthenticatorType
}

func RegisterAuthenticator

func RegisterAuthenticator(ctx context.Context, attestationBytes []byte, fullChallenge []byte) (*Authenticator, error)

func (*Authenticator) Id

func (r *Authenticator) Id() string

func (*Authenticator) IdFieldName

func (r *Authenticator) IdFieldName() string

func (*Authenticator) SetId

func (r *Authenticator) SetId(id string)

type Config

type Config struct {
	RpName                  string
	RpId                    string
	CreateCredentialTimeout time.Duration
}

Jump to

Keyboard shortcuts

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