storage

package
v0.0.0-...-ef7a112 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

func NewManifestStorage

func NewManifestStorage(db storage.ServiceStorage) (*Storage, error)

func (*Storage) DeleteApplication

func (ms *Storage) DeleteApplication(ctx context.Context, id string) error

func (*Storage) DeleteManifest

func (ms *Storage) DeleteManifest(ctx context.Context, id string) error

func (*Storage) DeleteResponse

func (ms *Storage) DeleteResponse(ctx context.Context, id string) error

func (*Storage) GetApplication

func (ms *Storage) GetApplication(ctx context.Context, id string) (*StoredApplication, error)

func (*Storage) GetManifest

func (ms *Storage) GetManifest(ctx context.Context, id string) (*StoredManifest, error)

func (*Storage) GetResponse

func (ms *Storage) GetResponse(ctx context.Context, id string) (*StoredResponse, error)

func (*Storage) ListApplications

func (ms *Storage) ListApplications(ctx context.Context) ([]StoredApplication, error)

ListApplications attempts to get all stored applications. It will return those it can even if it has trouble with some.

func (*Storage) ListManifests

func (ms *Storage) ListManifests(ctx context.Context) ([]StoredManifest, error)

ListManifests attempts to get all stored manifests. It will return those it can even if it has trouble with some.

func (*Storage) ListResponses

func (ms *Storage) ListResponses(ctx context.Context) ([]StoredResponse, error)

ListResponses attempts to get all stored responses. It will return those it can even if it has trouble with some.

func (*Storage) StoreApplication

func (ms *Storage) StoreApplication(ctx context.Context, application StoredApplication) error

func (*Storage) StoreManifest

func (ms *Storage) StoreManifest(ctx context.Context, manifest StoredManifest) error

func (*Storage) StoreResponse

func (ms *Storage) StoreResponse(ctx context.Context, response StoredResponse) error

func (*Storage) StoreReviewApplication

func (ms *Storage) StoreReviewApplication(ctx context.Context, applicationID string, approved bool, reason string, opID string, response StoredResponse) (*StoredResponse, *opstorage.StoredOperation, error)

StoreReviewApplication does the following:

  1. Updates the application status according to the approved parameter.
  2. Creates a Credential Response corresponding to the approved parameter and with the given reason.
  3. Marks the operation with id == opID as done, and sets operation.Response to the StoredResponse from the object creates in step 2.

The operation and it's response (from 3) are returned.

type StoredApplication

type StoredApplication struct {
	ID             string                         `json:"id"`
	Status         credential.Status              `json:"status"`
	Reason         string                         `json:"reason"`
	ManifestID     string                         `json:"manifestId"`
	ApplicantDID   string                         `json:"applicantDid"`
	Application    manifest.CredentialApplication `json:"application"`
	Credentials    []cred.Container               `json:"credentials"`
	ApplicationJWT keyaccess.JWT                  `json:"applicationJwt"`
}

type StoredManifest

type StoredManifest struct {
	ID                                 string                      `json:"id"`
	IssuerDID                          string                      `json:"issuerDid"`
	FullyQualifiedVerificationMethodID string                      `json:"fullyQualifiedVerificationMethodId"`
	Manifest                           manifest.CredentialManifest `json:"manifest"`
}

type StoredResponse

type StoredResponse struct {
	ID           string                      `json:"id"`
	ManifestID   string                      `json:"manifestId"`
	ApplicantDID string                      `json:"applicantDid"`
	Response     manifest.CredentialResponse `json:"response"`
	Credentials  []cred.Container            `json:"credentials"`
	ResponseJWT  keyaccess.JWT               `json:"responseJwt"`
}

Jump to

Keyboard shortcuts

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