issuing

package
v0.0.0-...-89805ac Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 11 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 struct {
	// 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 map[string]any
}

type CreateIssuanceTemplateRequest

type CreateIssuanceTemplateRequest struct {
	// The template to create.
	IssuanceTemplate IssuanceTemplate `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"`

	// Date that will be used to determine credential claims.
	Data CredentialTemplateData `json:"data"`

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

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

type CredentialTemplateData

type CredentialTemplateData struct {
	// 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.
	CredentialInputDescriptor string `json:"credentialInputDescriptor"`

	// The set of information that will be used to create claims.
	Claims ClaimTemplates
}

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 *IssuanceTemplate `json:"issuanceTemplate"`
}

type IssuanceTemplate

type IssuanceTemplate 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"`

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

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 []IssuanceTemplate `json:"issuanceTemplates"`
}

type Service

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

func NewIssuingService

func NewIssuingService(config config.IssuingServiceConfig, s storage.ServiceStorage) (*Service, error)

func (*Service) CreateIssuanceTemplate

func (s *Service) CreateIssuanceTemplate(request *CreateIssuanceTemplateRequest) (*IssuanceTemplate, error)

func (*Service) DeleteIssuanceTemplate

func (s *Service) DeleteIssuanceTemplate(request *DeleteIssuanceTemplateRequest) error

func (*Service) GetIssuanceTemplate

func (s *Service) GetIssuanceTemplate(request *GetIssuanceTemplateRequest) (*GetIssuanceTemplateResponse, error)

func (*Service) ListIssuanceTemplates

func (s *Service) ListIssuanceTemplates(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 NewIssuingStorage

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

func (Storage) DeleteIssuanceTemplate

func (s Storage) DeleteIssuanceTemplate(id string) error

func (Storage) GetIssuanceTemplate

func (s Storage) GetIssuanceTemplate(id string) (*StoredIssuanceTemplate, error)

func (Storage) ListIssuanceTemplates

func (s Storage) ListIssuanceTemplates() ([]IssuanceTemplate, error)

func (Storage) StoreIssuanceTemplate

func (s Storage) StoreIssuanceTemplate(template StoredIssuanceTemplate) error

type StoredIssuanceTemplate

type StoredIssuanceTemplate struct {
	IssuanceTemplate IssuanceTemplate
}

type TimeLike

type TimeLike struct {
	// For fixed time in the future.
	Time *time.Time

	// For a fixed offset from when it was issued.
	Duration *time.Duration
}

Jump to

Keyboard shortcuts

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