presentation

package
v0.0.0-...-0fc66b4 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPresentationStorage

func NewPresentationStorage(db storage.ServiceStorage) (prestorage.Storage, error)

Types

type Service

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

func NewPresentationService

func NewPresentationService(s storage.ServiceStorage,
	resolver resolution.Resolver, schema *schema.Service, keystore *keystore.Service) (*Service, error)

func (Service) CreatePresentationDefinition

CreatePresentationDefinition houses the main service logic for presentation definition creation. It validates the input, and produces a presentation definition value that conforms with the PresentationDefinition specification.

func (Service) CreateRequest

func (s Service) CreateRequest(ctx context.Context, req model.CreateRequestRequest) (*model.Request, error)

func (Service) CreateSubmission

func (s Service) CreateSubmission(ctx context.Context, request model.CreateSubmissionRequest) (*operation.Operation, error)

CreateSubmission houses the main service logic for presentation submission creation. It validates the input, and produces a presentation submission value that conforms with the Submission specification.

func (Service) DeletePresentationDefinition

func (s Service) DeletePresentationDefinition(ctx context.Context, request model.DeletePresentationDefinitionRequest) error

func (Service) DeleteRequest

func (s Service) DeleteRequest(ctx context.Context, request model.DeleteRequestRequest) error

func (Service) GetRequest

func (s Service) GetRequest(ctx context.Context, request *model.GetRequestRequest) (*model.Request, error)

func (Service) GetSubmission

func (Service) ListDefinitions

func (s Service) ListDefinitions(ctx context.Context) (*model.ListDefinitionsResponse, error)

func (Service) ListRequests

func (s Service) ListRequests(ctx context.Context) (*model.ListRequestsResponse, error)

func (Service) ListSubmissions

func (Service) ReviewSubmission

func (s Service) ReviewSubmission(ctx context.Context, request model.ReviewSubmissionRequest) (*model.Submission, error)

func (Service) Status

func (s Service) Status() framework.Status

func (Service) Type

func (s Service) Type() framework.Type

func (Service) VerifyPresentation

func (s Service) VerifyPresentation(ctx context.Context, request VerifyPresentationRequest) (*VerifyPresentationResponse, error)

VerifyPresentation does a series of verification on a presentation:

  1. Makes sure the presentation has a valid signature
  2. Makes sure the presentation is not expired
  3. Makes sure the presentation complies with the VC Data Model v1.1
  4. For each verification in the presentation, makes sure: a. Makes sure the verification has a valid signature b. Makes sure the verification is not expired c. Makes sure the verification complies with the VC Data Model

type Storage

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

func (*Storage) DeleteDefinition

func (ps *Storage) DeleteDefinition(ctx context.Context, id string) error

func (*Storage) GetDefinition

func (ps *Storage) GetDefinition(ctx context.Context, id string) (*prestorage.StoredDefinition, error)

func (*Storage) GetSubmission

func (ps *Storage) GetSubmission(ctx context.Context, id string) (*prestorage.StoredSubmission, error)

func (*Storage) ListDefinitions

func (ps *Storage) ListDefinitions(ctx context.Context) ([]prestorage.StoredDefinition, error)

func (*Storage) ListSubmissions

func (ps *Storage) ListSubmissions(ctx context.Context, filter filtering.Filter, page common.Page) (*prestorage.StoredSubmissions, error)

func (*Storage) StoreDefinition

func (ps *Storage) StoreDefinition(ctx context.Context, presentation prestorage.StoredDefinition) error

func (*Storage) StoreSubmission

func (ps *Storage) StoreSubmission(ctx context.Context, s prestorage.StoredSubmission) error

func (*Storage) UpdateSubmission

func (ps *Storage) UpdateSubmission(ctx context.Context, id string, approved bool, reason string, opID string) (prestorage.StoredSubmission, opstorage.StoredOperation, error)

type VerifyPresentationRequest

type VerifyPresentationRequest struct {
	PresentationJWT *keyaccess.JWT `json:"presentationJwt,omitempty" validate:"required"`
}

type VerifyPresentationResponse

type VerifyPresentationResponse struct {
	Verified bool   `json:"verified"`
	Reason   string `json:"reason,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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