credentials

package
v0.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowCredential

type AllowCredential struct {
	Type       string                `json:"type"`
	ID         string                `json:"id"`
	Transports []CredentialTransport `json:"transports"`
}

type AllowCredentials

type AllowCredentials struct {
	Key      []AllowCredential `json:"key"`
	Webauthn []AllowCredential `json:"webauthn"`
}

type CredentialAssertion

type CredentialAssertion struct {
	CredID     string `json:"credId"`
	ClientData string `json:"clientData"`
	Signature  string `json:"signature"`
	Algorithm  string `json:"algorithm"`
}

type CredentialKind

type CredentialKind string
const (
	KeyCredential CredentialKind = "Key"
)

type CredentialTransport

type CredentialTransport string
const (
	USB      CredentialTransport = "usb"
	NFC      CredentialTransport = "nfc"
	BLE      CredentialTransport = "ble"
	Internal CredentialTransport = "internal"
)

type ICredentialSigner

type ICredentialSigner interface {
	Sign(ctx context.Context, userActionChallenge *UserActionChallenge) (*KeyAssertion, error)
}

For not it returns a KeyAssertion. But we can make it more generic afterward

type KeyAssertion

type KeyAssertion struct {
	Kind                CredentialKind      `json:"kind"`
	CredentialAssertion CredentialAssertion `json:"credentialAssertion"`
}

type NotAllowedCredentialsError

type NotAllowedCredentialsError struct {
	CredID       string
	AllowedCreds []AllowCredential
}

NotAllowedCredentialsError indicates that the provided credential ID is not among the allowed credentials.

func (*NotAllowedCredentialsError) Error

Error returns the error message.

type UserActionChallenge

type UserActionChallenge struct {
	Challenge        string
	AllowCredentials *AllowCredentials
}

UserActionChallenge contains the challenge to sign

Jump to

Keyboard shortcuts

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