issuecredential

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ClaimDataTypeClaims = ClaimDataType(0)
	ClaimDataTypeVC     = ClaimDataType(1)
)
View Source
const (
	TransactionStateUnknown                         = TransactionState(0)
	TransactionStateIssuanceInitiated               = TransactionState(1)
	TransactionStatePreAuthCodeValidated            = TransactionState(2) // pre-auth only
	TransactionStateAwaitingIssuerOIDCAuthorization = TransactionState(3) // auth only
	TransactionStateIssuerOIDCAuthorizationDone     = TransactionState(4)
	TransactionStateCredentialsIssued               = TransactionState(5)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationDetails added in v1.11.0

type AuthorizationDetails struct {
	Type                      string
	Format                    vcsverifiable.OIDCFormat
	Locations                 []string
	CredentialConfigurationID string
	CredentialDefinition      *CredentialDefinition
	CredentialIdentifiers     []string
}

AuthorizationDetails represents the domain model for Authorization Details request. This object is used to convey the details about the Credentials the Wallet wants to obtain.

Spec: https://openid.github.io/OpenID4VCI/openid-4-verifiable-credential-issuance-wg-draft.html#section-5.1.1

func (*AuthorizationDetails) ToDTO added in v1.11.0

type ClaimData added in v1.11.0

type ClaimData struct {
	EncryptedData *dataprotect.EncryptedData `json:"encrypted_data"`
}

ClaimData represents user claims in pre-auth code flow.

type ClaimDataType added in v1.11.0

type ClaimDataType int16

type Config

type Config struct {
	VCStatusManager vcStatusManager
	Crypto          vcCrypto
	KMSRegistry     kmsRegistry
}

type CredentialComposeConfiguration added in v1.11.0

type CredentialComposeConfiguration struct {
	IDTemplate         string `json:"id_template"`
	OverrideIssuer     bool   `json:"override_issuer"`
	OverrideSubjectDID bool   `json:"override_subject_did"`
}

type CredentialComposer added in v1.11.0

type CredentialComposer struct {
}

func NewCredentialComposer added in v1.11.0

func NewCredentialComposer() *CredentialComposer

func (*CredentialComposer) Compose added in v1.11.0

type CredentialDefinition added in v1.11.0

type CredentialDefinition struct {
	// For ldp_vc only. Array as defined in https://www.w3.org/TR/vc-data-model/#contexts.
	Context           []string
	CredentialSubject map[string]interface{}
	Type              []string
}

CredentialDefinition contains the detailed description of the credential type.

type Opts added in v1.5.0

type Opts func(opts *issueCredentialOpts)

Opts is signing credential option.

func WithCryptoOpts added in v1.5.0

func WithCryptoOpts(cryptoOpts []crypto.SigningOpts) Opts

WithCryptoOpts is an option to pass crypto.SigningOpts.

func WithSkipIDPrefix added in v1.8.0

func WithSkipIDPrefix() Opts

WithSkipIDPrefix is an option to skip ID prefix.

func WithTransactionID added in v1.5.0

func WithTransactionID(transactionID string) Opts

WithTransactionID is an option to pass transactionID.

type PrepareCredentialService added in v1.11.0

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

func NewPrepareCredentialService added in v1.11.0

func NewPrepareCredentialService(
	cfg *PrepareCredentialServiceConfig,
) *PrepareCredentialService

func (*PrepareCredentialService) CreateRefreshService added in v1.11.0

func (*PrepareCredentialService) PrepareCredential added in v1.11.0

type PrepareCredentialServiceConfig added in v1.11.0

type PrepareCredentialServiceConfig struct {
	VcsAPIURL string
	Composer  composer
}

type PrepareCredentialsRequest added in v1.11.0

type PrepareCredentialsRequest struct {
	TxID                    string
	ClaimData               map[string]interface{}
	IssuerDID               string
	SubjectDID              string
	CredentialConfiguration *TxCredentialConfiguration

	IssuerID              string
	IssuerVersion         string
	RefreshServiceEnabled bool
}

type Service

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

func New

func New(config *Config) *Service

func (*Service) IssueCredential

func (s *Service) IssueCredential(
	ctx context.Context,
	credential *verifiable.Credential,
	profile *profileapi.Issuer,
	opts ...Opts,
) (*verifiable.Credential, error)

type ServiceInterface

type ServiceInterface interface {
	IssueCredential(
		ctx context.Context,
		credential *verifiable.Credential,
		profile *profileapi.Issuer,
		opts ...Opts,
	) (*verifiable.Credential, error)
}

type Transaction added in v1.11.0

type Transaction struct {
	ID TxID
	TransactionData
}

Transaction is the credential issuance transaction. Issuer creates a transaction to convey the intention of issuing a credential with the given parameters. The transaction is stored in the transaction store and its status is updated as the credential issuance progresses.

type TransactionData added in v1.11.0

type TransactionData struct {
	ProfileID                          profileapi.ID
	ProfileVersion                     profileapi.Version
	IsPreAuthFlow                      bool
	PreAuthCode                        string
	OrgID                              string
	AuthorizationEndpoint              string
	PushedAuthorizationRequestEndpoint string
	TokenEndpoint                      string
	OpState                            string
	RedirectURI                        string
	GrantType                          string
	ResponseType                       string
	Scope                              []string
	IssuerAuthCode                     string
	IssuerToken                        string
	State                              TransactionState
	WebHookURL                         string
	UserPin                            string
	DID                                string
	WalletInitiatedIssuance            bool
	CredentialConfiguration            []*TxCredentialConfiguration
	RefreshServiceEnabled              bool
}

TransactionData is the transaction data stored in the underlying storage.

type TransactionState added in v1.11.0

type TransactionState int16

type TxCredentialConfiguration added in v1.11.0

type TxCredentialConfiguration struct {
	ID                        string
	CredentialTemplate        *profileapi.CredentialTemplate
	OIDCCredentialFormat      vcsverifiable.OIDCFormat
	ClaimEndpoint             string
	ClaimDataID               string
	ClaimDataType             ClaimDataType
	CredentialName            string
	CredentialDescription     string
	CredentialExpiresAt       *time.Time
	PreAuthCodeExpiresAt      *time.Time
	CredentialConfigurationID string
	// AuthorizationDetails may be defined on Authorization Request via using "authorization_details" parameter.
	// If "scope" param is used, this field will stay empty.
	AuthorizationDetails           *AuthorizationDetails
	CredentialComposeConfiguration *CredentialComposeConfiguration
}

type TxID added in v1.11.0

type TxID string

TxID defines type for transaction ID.

Jump to

Keyboard shortcuts

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