credentialstatus

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDataNotFound = errors.New("data not found")
)

Functions

This section is empty.

Types

type CSL

type CSL = verifiable.Credential

CSL (Credential Status List) - is a verifiable.Credential that stores the revocation status of credentials issued by Issuer.

This type is created for the documentation purpose.

type CSLIndexStore

type CSLIndexStore interface {
	// Upsert updates CSL Indexes.
	Upsert(ctx context.Context, cslURL string, cslWrapper *CSLIndexWrapper) error
	// Get returns CSLIndexWrapper based on URL to the CSL.
	Get(ctx context.Context, cslURL string) (*CSLIndexWrapper, error)
	// GetLatestListID returns latest ListID, that is topical on a moment given CSL is creating.
	GetLatestListID(ctx context.Context) (ListID, error)
	// UpdateLatestListID updates underlying ListID.
	UpdateLatestListID(ctx context.Context, id ListID) error
}

type CSLIndexWrapper

type CSLIndexWrapper struct {
	CSLURL string `json:"_id" bson:"_id"`

	ListID ListID `json:"listID"`

	// UsedIndexes stores the list of used bit indexes in the CSL encoded list.
	UsedIndexes []int `json:"usedIndexes"`

	ProfileGroupID string `json:"profileGroupID"`

	Status string `json:"status"`

	OwnerID string `json:"ownerID"`
}

CSLIndexWrapper contains CSL Indexes and Version.

type CSLVCStore

type CSLVCStore interface {
	// GetCSLURL returns the public URL to the CSL.
	GetCSLURL(issuerProfileURL, externalIssuerProfileID string, statusListID ListID) (string, error)
	// Upsert updates CSL VC wrapper.
	Upsert(ctx context.Context, cslURL string, wrapper *CSLVCWrapper) error
	// Get returns CSL VC wrapper based on URL to the CSL.
	Get(ctx context.Context, cslURL string) (*CSLVCWrapper, error)
}

type CSLVCWrapper

type CSLVCWrapper struct {
	// VCByte stores the CSL.
	VCByte json.RawMessage `json:"vc,omitempty"`
	// VC represents parsed CSL VC. Not stored.
	VC *verifiable.Credential `json:"-"`
}

CSLVCWrapper contains CSL VC and version.

type CredentialMetadata added in v1.5.0

type CredentialMetadata struct {
	CredentialID   string            `json:"credential"`
	Issuer         string            `json:"issuer,omitempty"`
	CredentialType []string          `json:"credentialType,omitempty"`
	TransactionID  string            `json:"transactionId,omitempty"`
	IssuanceDate   *time.TimeWrapper `json:"issuanceDate,omitempty"`
	ExpirationDate *time.TimeWrapper `json:"expirationDate,omitempty"`
}

CredentialMetadata represents the credential metadata.

type ListID

type ListID string

ListID is used for the pseudo-random shuffling of suffixes of CSL URL during the credential issuance. The value of ListID is common among all issuers. In case any Issuer issued startcmd.cslSize credentials then ListID is updated.

type ServiceInterface

type ServiceInterface interface {
	CreateStatusListEntry(
		ctx context.Context,
		profileID profileapi.ID,
		profileVersion profileapi.Version,
		credentialID string,
	) (*StatusListEntry, error)
	StoreIssuedCredentialMetadata(
		ctx context.Context,
		profileID profileapi.ID,
		profileVersion profileapi.Version,
		metadata *CredentialMetadata,
	) error
	GetStatusListVC(ctx context.Context, profileGroupID profileapi.ID, statusID string) (*CSL, error)
	UpdateVCStatus(ctx context.Context, params UpdateVCStatusParams) error
	Resolve(ctx context.Context, statusListVCURI string) (*CSL, error)
}

type StatusListEntry

type StatusListEntry struct {
	Context string
	TypedID *verifiable.TypedID
}

type UpdateCredentialStatusEventPayload

type UpdateCredentialStatusEventPayload struct {
	CSLURL         string `json:"cslurl"`
	ProfileID      string `json:"profileId"`
	ProfileVersion string `json:"profileVersion"`
	Index          int    `json:"index"`
	Status         bool   `json:"status"`
}

UpdateCredentialStatusEventPayload represents the event payload for credential status update. Corresponding event type is spi.CredentialStatusStatusUpdated.

type UpdateVCStatusParams

type UpdateVCStatusParams struct {
	// Issuer Profile ID.
	ProfileID profileapi.ID
	// Issuer Profile Version.
	ProfileVersion profileapi.Version
	// ID of the verifiable.Credential, that supposed to get updated status to DesiredStatus.
	CredentialID string
	// Desired status of the verifiable.Credential referenced by CredentialID.
	// Values are validated using strconv.ParseBool func.
	DesiredStatus string
	// vc.StatusType of verifiable.Credential referenced by CredentialID.
	StatusType vc.StatusType
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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