oidc4vp

package
v0.0.0-...-4106ae8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 32 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAttachments

func WithAttachments(attachments map[string]string) func(opts *options)

Types

type AttestationService

type AttestationService interface {
	GetAttestation(ctx context.Context, req attestation.GetAttestationRequest) (string, error)
}

type Claims

type Claims = map[string]interface{}

type ClientMetadata

type ClientMetadata struct {
	ClientName                  string           `json:"client_name"`
	ClientPurpose               string           `json:"client_purpose"`
	SubjectSyntaxTypesSupported []string         `json:"subject_syntax_types_supported"`
	VPFormats                   *presexch.Format `json:"vp_formats"`
}

type Flow

type Flow struct {
	// contains filtered or unexported fields
}

func NewFlow

func NewFlow(p provider, opts ...Opt) (*Flow, error)

func (*Flow) CreateVPToken

func (f *Flow) CreateVPToken(
	presentations []*verifiable.Presentation,
	requestObject *RequestObject,
) ([]string, error)

func (*Flow) PerfInfo

func (f *Flow) PerfInfo() *PerfInfo

func (*Flow) Run

func (f *Flow) Run(ctx context.Context) error

type IDTokenClaims

type IDTokenClaims struct {
	// ScopeAdditionalClaims stores claims retrieved using custom scope.
	ScopeAdditionalClaims map[string]Claims `json:"_scope,omitempty"` //custom scope -> additional claims
	AttestationVP         string            `json:"_attestation_vp"`
	Nonce                 string            `json:"nonce"`
	Exp                   int64             `json:"exp"`
	Iss                   string            `json:"iss"`
	Aud                   string            `json:"aud"`
	Sub                   string            `json:"sub"`
	Nbf                   int64             `json:"nbf"`
	Iat                   int64             `json:"iat"`
	Jti                   string            `json:"jti"`
	Attachments           map[string]string `json:"_attachments"`
}

type Opt

type Opt func(opts *options)

func WithDomainMatchingDisabled

func WithDomainMatchingDisabled() Opt

func WithLinkedDomainVerification

func WithLinkedDomainVerification() Opt

func WithMultiVPs

func WithMultiVPs() Opt

func WithRequestURI

func WithRequestURI(uri string) Opt

func WithSchemaValidationDisabled

func WithSchemaValidationDisabled() Opt

func WithWalletDIDIndex

func WithWalletDIDIndex(idx int) Opt

type PerfInfo

type PerfInfo struct {
	FetchRequestObject         time.Duration `json:"vp_fetch_request_object"`
	VerifyAuthorizationRequest time.Duration `json:"vp_verify_authorization_request"`
	QueryCredentialFromWallet  time.Duration `json:"vp_query_credential_from_wallet"`
	CreateAuthorizedResponse   time.Duration `json:"vp_create_authorized_response"`
	SendAuthorizedResponse     time.Duration `json:"vp_send_authorized_response"`
	VcsVPFlowDuration          time.Duration `json:"_vcs_vp_flow_duration"`
}

type RequestObject

type RequestObject struct {
	JTI                    string                           `json:"jti"`
	IAT                    int64                            `json:"iat"`
	ResponseType           string                           `json:"response_type"`
	ResponseMode           string                           `json:"response_mode"`
	ResponseURI            string                           `json:"response_uri"`
	Scope                  string                           `json:"scope"`
	Nonce                  string                           `json:"nonce"`
	ClientID               string                           `json:"client_id"`
	State                  string                           `json:"state"`
	Exp                    int64                            `json:"exp"`
	ClientMetadata         *ClientMetadata                  `json:"client_metadata"`
	PresentationDefinition *presexch.PresentationDefinition `json:"presentation_definition"`
}

type TrustRegistry

type TrustRegistry interface {
	ValidateVerifier(
		ctx context.Context,
		verifierDID,
		verifierDomain string,
		credentials []*verifiable.Credential,
	) (bool, error)
}

Jump to

Keyboard shortcuts

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