storage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSubmissionNotFound = errors.New("submission not found")

Functions

This section is empty.

Types

type DefinitionStorage

type DefinitionStorage interface {
	StoreDefinition(ctx context.Context, presentation StoredDefinition) error
	GetDefinition(ctx context.Context, id string) (*StoredDefinition, error)
	DeleteDefinition(ctx context.Context, id string) error
	// TODO: Make this consistent across API boundaries https://github.com/TBD54566975/ssi-service/issues/449
	ListDefinitions(ctx context.Context) ([]StoredDefinition, error)
}

type Storage

type Storage interface {
	DefinitionStorage
	SubmissionStorage
}

type StoredDefinition

type StoredDefinition struct {
	ID                     string                          `json:"id"`
	PresentationDefinition exchange.PresentationDefinition `json:"presentationDefinition"`
	Author                 string                          `json:"issuerID"`
	AuthorKID              string                          `json:"issuerKid"`
}

type StoredSubmission

type StoredSubmission struct {
	Status                 submission.Status                 `json:"status"`
	Reason                 string                            `json:"reason"`
	VerifiablePresentation credential.VerifiablePresentation `json:"vp"`
}

func (StoredSubmission) FilterVariablesMap

func (s StoredSubmission) FilterVariablesMap() map[string]any

type StoredSubmissions

type StoredSubmissions struct {
	Submissions   []StoredSubmission
	NextPageToken string
}

type SubmissionStorage

type SubmissionStorage interface {
	StoreSubmission(ctx context.Context, schema StoredSubmission) error
	GetSubmission(ctx context.Context, id string) (*StoredSubmission, error)
	ListSubmissions(ctx context.Context, filter filtering.Filter, page common.Page) (*StoredSubmissions, error)
	UpdateSubmission(ctx context.Context, id string, approved bool, reason string, submissionID string) (StoredSubmission, opstorage.StoredOperation, error)
}

Jump to

Keyboard shortcuts

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