issuance

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 ClaimTemplates

type ClaimTemplates map[string]any

type CreateIssuanceTemplateRequest

type CreateIssuanceTemplateRequest struct {
	// The template to create.
	IssuanceTemplate Template `json:"issuanceTemplate"`
}

func (CreateIssuanceTemplateRequest) IsValid

func (r CreateIssuanceTemplateRequest) IsValid() bool

type CredentialTemplate

type CredentialTemplate struct {
	// ID corresponding to an OutputDescriptor.ID from the manifest.
	ID string `json:"id"`

	// ID of the CredentialSchema to be used for the issued credential.
	Schema string `json:"schema"`

	// Optional.
	// When present, it's the ID of the input descriptor in the application. Corresponds to one of the
	// PresentationDefinition.InputDescriptors[].ID in the credential manifest. When creating a credential, the base
	// data will be populated from the provided submission that matches this ID.
	// When absent, there will be no base data for the credentials created. Additionally, no JSON path strings in
	// ClaimTemplates.Data will be resolved.
	CredentialInputDescriptor string `json:"credentialInputDescriptor"`

	// Data that will be used to determine credential claims.
	// Values may be json path like strings, or any other JSON primitive. Each entry will be used to come up with a
	// claim about the credentialSubject in the credential that will be issued.
	Data ClaimTemplates `json:"data,omitempty"`

	// Parameter to determine the expiry of the credential.
	Expiry TimeLike `json:"expiry,omitempty"`

	// Whether the credentials created should be revocable.
	Revocable bool `json:"revocable"`
}

type DeleteIssuanceTemplateRequest

type DeleteIssuanceTemplateRequest struct {
	// ID of the template that will be deleted.
	// Required.
	ID string `json:"id" validate:"required"`
}

type GetIssuanceTemplateRequest

type GetIssuanceTemplateRequest struct {
	ID string `json:"id" validate:"required"`
}

type GetIssuanceTemplateResponse

type GetIssuanceTemplateResponse struct {
	// The template that was requested.
	IssuanceTemplate *Template `json:"issuanceTemplate"`
}

type ListIssuanceTemplatesRequest

type ListIssuanceTemplatesRequest struct {
	// A parsed filter expression conforming to https://google.aip.dev/160.
	Filter filtering.Filter
}

func (ListIssuanceTemplatesRequest) Validate

func (r ListIssuanceTemplatesRequest) Validate() error

type ListIssuanceTemplatesResponse

type ListIssuanceTemplatesResponse struct {
	// The issuance templates that satisfy the query conditions.
	IssuanceTemplates []Template `json:"issuanceTemplates"`
}

type Service

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

func NewIssuanceService

func NewIssuanceService(s storage.ServiceStorage) (*Service, error)

func (*Service) CreateIssuanceTemplate

func (s *Service) CreateIssuanceTemplate(ctx context.Context, request *CreateIssuanceTemplateRequest) (*Template, error)

func (*Service) DeleteIssuanceTemplate

func (s *Service) DeleteIssuanceTemplate(ctx context.Context, request *DeleteIssuanceTemplateRequest) error

func (*Service) GetIssuanceTemplate

func (s *Service) GetIssuanceTemplate(ctx context.Context, request *GetIssuanceTemplateRequest) (*GetIssuanceTemplateResponse, error)

func (*Service) ListIssuanceTemplates

func (s *Service) ListIssuanceTemplates(ctx context.Context, request *ListIssuanceTemplatesRequest) (*ListIssuanceTemplatesResponse, error)

func (*Service) Status

func (s *Service) Status() framework.Status

func (*Service) Type

func (s *Service) Type() framework.Type

type Storage

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

func NewIssuanceStorage

func NewIssuanceStorage(s storage.ServiceStorage) (*Storage, error)

func (Storage) DeleteIssuanceTemplate

func (s Storage) DeleteIssuanceTemplate(ctx context.Context, id string) error

func (Storage) GetIssuanceTemplate

func (s Storage) GetIssuanceTemplate(ctx context.Context, id string) (*StoredIssuanceTemplate, error)

func (Storage) GetIssuanceTemplatesByManifestID

func (s Storage) GetIssuanceTemplatesByManifestID(ctx context.Context, manifestID string) ([]StoredIssuanceTemplate, error)

func (Storage) ListIssuanceTemplates

func (s Storage) ListIssuanceTemplates(ctx context.Context) ([]Template, error)

func (Storage) StoreIssuanceTemplate

func (s Storage) StoreIssuanceTemplate(ctx context.Context, template StoredIssuanceTemplate) error

type StoredIssuanceTemplate

type StoredIssuanceTemplate struct {
	IssuanceTemplate Template `json:"issuanceTemplate"`
}

type Template

type Template struct {
	// ID of this template.
	ID string `json:"id"`

	// ID of the credential manifest that this template corresponds to.
	CredentialManifest string `json:"credentialManifest" validate:"required"`

	// ID of the issuer that will be issuing the credentials.
	Issuer string `json:"issuer" validate:"required"`

	// The id of the verificationMethod (see https://www.w3.org/TR/did-core/#verification-methods) who's privateKey is
	// stored in oac-service. The verificationMethod must be part of the did document associated with `issuer`.
	// The private key associated with the verificationMethod's publicKey will be used to sign the credentials.
	VerificationMethodID string `` /* 163-byte string literal not displayed */

	// Info required to create a credential from a credential application.
	Credentials []CredentialTemplate `json:"credentials"`
}

Template is a template for issuing credentials.

func (*Template) IsEmpty

func (it *Template) IsEmpty() bool

func (*Template) IsValid

func (it *Template) IsValid() error

type TimeLike

type TimeLike struct {
	// For fixed time in the future.
	Time *time.Time `json:"time,omitempty"`

	// For a fixed offset from when it was issued.
	Duration *time.Duration `json:"duration,omitempty"`
}

Jump to

Keyboard shortcuts

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