issuecredential

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// InvalidRequestErrorCode is typically a code for validation errors
	// for invalid issue credential controller requests.
	InvalidRequestErrorCode = command.Code(iota + command.IssueCredential)
	// AcceptProposalErrorCode is for failures in accept proposal command.
	AcceptProposalErrorCode
	// AcceptOfferErrorCode is for failures in accept offer command.
	AcceptOfferErrorCode
	// AcceptRequestErrorCode is for failures in accept request command.
	AcceptRequestErrorCode
	// AcceptCredentialErrorCode is for failures in accept credential command.
	AcceptCredentialErrorCode
	// AcceptProblemReportErrorCode is for failures in accept problem report command.
	AcceptProblemReportErrorCode
	// NegotiateProposalErrorCode is for failures in negotiate proposal command.
	NegotiateProposalErrorCode
	// DeclineProposalErrorCode is for failures in decline proposal command.
	DeclineProposalErrorCode
	// DeclineOfferErrorCode is for failures in decline offer command.
	DeclineOfferErrorCode
	// DeclineRequestErrorCode is for failures in decline request command.
	DeclineRequestErrorCode
	// DeclineCredentialErrorCode is for failures in decline credential command.
	DeclineCredentialErrorCode
	// SendProposalErrorCode failures in send proposal command.
	SendProposalErrorCode
	// SendOfferErrorCode failures in send offer command.
	SendOfferErrorCode
	// SendRequestErrorCode failures in send request command.
	SendRequestErrorCode
	// ActionsErrorCode failures in actions command.
	ActionsErrorCode
)
View Source
const (
	// command name.
	CommandName = "issuecredential"

	Actions             = "Actions"
	SendOffer           = "SendOffer"
	SendOfferV3         = "SendOfferV3"
	SendProposal        = "SendProposal"
	SendProposalV3      = "SendProposalV3"
	SendRequest         = "SendRequest"
	SendRequestV3       = "SendRequestV3"
	AcceptProposal      = "AcceptProposal"
	AcceptProposalV3    = "AcceptProposalV3"
	DeclineProposal     = "DeclineProposal"
	AcceptOffer         = "AcceptOffer"
	DeclineOffer        = "DeclineOffer"
	NegotiateProposal   = "NegotiateProposal"
	NegotiateProposalV3 = "NegotiateProposalV3"
	AcceptRequest       = "AcceptRequest"
	AcceptRequestV3     = "AcceptRequestV3"
	DeclineRequest      = "DeclineRequest"
	AcceptCredential    = "AcceptCredential"
	DeclineCredential   = "DeclineCredential"
	AcceptProblemReport = "AcceptProblemReport"
)

constants for issue credential commands.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptCredentialArgs

type AcceptCredentialArgs struct {
	// PIID Protocol instance ID.
	PIID string `json:"piid"`
	// Names represent the names of how credentials will be stored.
	Names []string `json:"names"`
	// SkipStore if true then credential will not be saved in agent's verifiable store,
	// but protocol state will be updated.
	SkipStore bool `json:"skipStore"`
}

AcceptCredentialArgs model

This is used for accepting a credential.

type AcceptCredentialResponse

type AcceptCredentialResponse struct{}

AcceptCredentialResponse model

Represents a AcceptCredential response message.

type AcceptOfferArgs

type AcceptOfferArgs struct {
	// PIID Protocol instance I
	PIID string `json:"piid"`
	// RequestCredential is an optional message sent by the potential Holder to the Issuer to request the issuance of a
	// credential.
	RequestCredential issuecredential.RequestCredential `json:"request_credential,omitempty"`
}

AcceptOfferArgs model

This is used for accepting an offer.

type AcceptOfferArgsV2 added in v0.1.8

type AcceptOfferArgsV2 struct {
	// PIID Protocol instance I
	PIID string `json:"piid"`
	// RequestCredential is an optional message sent by the potential Holder to the Issuer to request the issuance of a
	// credential.
	RequestCredential issuecredential.RequestCredentialV2 `json:"request_credential,omitempty"`
}

AcceptOfferArgsV2 model

This is used for accepting an offer.

type AcceptOfferArgsV3 added in v0.1.8

type AcceptOfferArgsV3 struct {
	// PIID Protocol instance I
	PIID string `json:"piid"`
	// RequestCredential is an optional message sent by the potential Holder to the Issuer to request the issuance of a
	// credential.
	RequestCredential issuecredential.RequestCredentialV3 `json:"request_credential,omitempty"`
}

AcceptOfferArgsV3 model

This is used for accepting an offer.

type AcceptOfferResponse

type AcceptOfferResponse struct{}

AcceptOfferResponse model

Represents a AcceptOffer response message.

type AcceptProblemReportArgs added in v0.1.4

type AcceptProblemReportArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
}

AcceptProblemReportArgs model

This is used for accepting a problem report.

type AcceptProblemReportResponse added in v0.1.4

type AcceptProblemReportResponse struct{}

AcceptProblemReportResponse model

Represents a AcceptProblemReport response message.

type AcceptProposalArgs

type AcceptProposalArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// OfferCredential is a message describing the credential intend to offer and
	// possibly the price they expect to be paid.
	OfferCredential *issuecredential.OfferCredential `json:"offer_credential"`
}

AcceptProposalArgs model

This is used for accepting proposal.

type AcceptProposalArgsV2 added in v0.1.8

type AcceptProposalArgsV2 struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// OfferCredential is a message describing the credential intend to offer and
	// possibly the price they expect to be paid.
	OfferCredential *issuecredential.OfferCredentialV2 `json:"offer_credential"`
}

AcceptProposalArgsV2 model

This is used for accepting proposal.

type AcceptProposalArgsV3 added in v0.1.8

type AcceptProposalArgsV3 struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// OfferCredential is a message describing the credential intend to offer and
	// possibly the price they expect to be paid.
	OfferCredential *issuecredential.OfferCredentialV3 `json:"offer_credential"`
}

AcceptProposalArgsV3 model

This is used for accepting proposal.

type AcceptProposalResponse

type AcceptProposalResponse struct{}

AcceptProposalResponse model

Represents a AcceptProposal response message.

type AcceptRequestArgs

type AcceptRequestArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// IssueCredential contains as attached payload the credentials being issued
	IssueCredential *issuecredential.IssueCredential `json:"issue_credential"`
}

AcceptRequestArgs model

This is used for accepting a request.

type AcceptRequestArgsV2 added in v0.1.8

type AcceptRequestArgsV2 struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// IssueCredential contains as attached payload the credentials being issued
	IssueCredential *issuecredential.IssueCredentialV2 `json:"issue_credential"`
}

AcceptRequestArgsV2 model

This is used for accepting a request.

type AcceptRequestArgsV3 added in v0.1.8

type AcceptRequestArgsV3 struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// IssueCredential contains as attached payload the credentials being issued
	IssueCredential *issuecredential.IssueCredentialV3 `json:"issue_credential"`
}

AcceptRequestArgsV3 model

This is used for accepting a request.

type AcceptRequestResponse

type AcceptRequestResponse struct{}

AcceptRequestResponse model

Represents a AcceptRequest response message.

type ActionsResponse

type ActionsResponse struct {
	Actions []issuecredential.Action `json:"actions"`
}

ActionsResponse model

Represents Actions response message.

type Command

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

Command is controller command for issue credential.

func New

func New(ctx Provider, notifier command.Notifier, options ...Option) (*Command, error)

New returns new issue credential controller command instance.

func (*Command) AcceptCredential

func (c *Command) AcceptCredential(rw io.Writer, req io.Reader) command.Error

AcceptCredential is used when the Holder is willing to accept the IssueCredential.

func (*Command) AcceptOffer

func (c *Command) AcceptOffer(rw io.Writer, req io.Reader) command.Error

AcceptOffer is used when the Holder is willing to accept the offer.

func (*Command) AcceptProblemReport added in v0.1.4

func (c *Command) AcceptProblemReport(rw io.Writer, req io.Reader) command.Error

AcceptProblemReport is used for accepting problem report.

func (*Command) AcceptProposal

func (c *Command) AcceptProposal(rw io.Writer, req io.Reader) command.Error

AcceptProposal is used when the Issuer is willing to accept the proposal.

func (*Command) AcceptRequest

func (c *Command) AcceptRequest(rw io.Writer, req io.Reader) command.Error

AcceptRequest is used when the Issuer is willing to accept the request.

func (*Command) Actions

func (c *Command) Actions(rw io.Writer, _ io.Reader) command.Error

Actions returns pending actions that have not yet to be executed or canceled.

func (*Command) DeclineCredential

func (c *Command) DeclineCredential(rw io.Writer, req io.Reader) command.Error

DeclineCredential is used when the Holder does not want to accept the IssueCredential.

func (*Command) DeclineOffer

func (c *Command) DeclineOffer(rw io.Writer, req io.Reader) command.Error

DeclineOffer is used when the Holder does not want to accept the offer.

func (*Command) DeclineProposal

func (c *Command) DeclineProposal(rw io.Writer, req io.Reader) command.Error

DeclineProposal is used when the Issuer does not want to accept the proposal.

func (*Command) DeclineRequest

func (c *Command) DeclineRequest(rw io.Writer, req io.Reader) command.Error

DeclineRequest is used when the Issuer does not want to accept the request.

func (*Command) GetHandlers

func (c *Command) GetHandlers() []command.Handler

GetHandlers returns list of all commands supported by this controller command.

func (*Command) NegotiateProposal

func (c *Command) NegotiateProposal(rw io.Writer, req io.Reader) command.Error

NegotiateProposal is used when the Holder wants to negotiate about an offer he received.

func (*Command) SendOffer

func (c *Command) SendOffer(rw io.Writer, req io.Reader) command.Error

SendOffer is used by the Issuer to send an offer.

func (*Command) SendProposal

func (c *Command) SendProposal(rw io.Writer, req io.Reader) command.Error

SendProposal is used by the Holder to send a proposal.

func (*Command) SendRequest

func (c *Command) SendRequest(rw io.Writer, req io.Reader) command.Error

SendRequest is used by the Holder to send a request.

type DeclineCredentialArgs

type DeclineCredentialArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Reason why credential is declined
	Reason string `json:"reason"`
}

DeclineCredentialArgs model

This is used when credential needs to be rejected.

type DeclineCredentialResponse

type DeclineCredentialResponse struct{}

DeclineCredentialResponse model

Represents a DeclineCredential response message.

type DeclineOfferArgs

type DeclineOfferArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Reason why offer is declined
	Reason string `json:"reason"`
}

DeclineOfferArgs model

This is used when offer needs to be rejected.

type DeclineOfferResponse

type DeclineOfferResponse struct{}

DeclineOfferResponse model

Represents a DeclineOffer response message.

type DeclineProposalArgs

type DeclineProposalArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Reason why proposal is declined
	Reason string `json:"reason"`
	// RedirectURL is optional web redirect URL that can be sent to holder.
	// Useful in cases where issuer would like holder to redirect after its proposal gets declined.
	RedirectURL string `json:"redirectURL"`
}

DeclineProposalArgs model

This is used when proposal needs to be rejected.

type DeclineProposalResponse

type DeclineProposalResponse struct{}

DeclineProposalResponse model

Represents a DeclineProposal response message.

type DeclineRequestArgs

type DeclineRequestArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Reason why request is declined
	Reason string `json:"reason"`
	// RedirectURL is optional web redirect URL that can be sent to holder.
	// Useful in cases where issuer would like holder to redirect after its credential request gets declined.
	RedirectURL string `json:"redirectURL"`
}

DeclineRequestArgs model

This is used when request needs to be rejected.

type DeclineRequestResponse

type DeclineRequestResponse struct{}

DeclineRequestResponse model

Represents a DeclineRequest response message.

type NegotiateProposalArgs

type NegotiateProposalArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// ProposeCredential is a message sent in response to a offer-credential message when the Holder
	// wants some adjustments made to the credential data offered by Issuer.
	ProposeCredential *issuecredential.ProposeCredential `json:"propose_credential"`
}

NegotiateProposalArgs model

This is used when the Holder wants to negotiate about an offer he received.

type NegotiateProposalArgsV2 added in v0.1.8

type NegotiateProposalArgsV2 struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// ProposeCredential is a message sent in response to a offer-credential message when the Holder
	// wants some adjustments made to the credential data offered by Issuer.
	ProposeCredential *issuecredential.ProposeCredentialV2 `json:"propose_credential"`
}

NegotiateProposalArgsV2 model

This is used when the Holder wants to negotiate about an offer he received.

type NegotiateProposalArgsV3 added in v0.1.8

type NegotiateProposalArgsV3 struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// ProposeCredential is a message sent in response to a offer-credential message when the Holder
	// wants some adjustments made to the credential data offered by Issuer.
	ProposeCredential *issuecredential.ProposeCredentialV3 `json:"propose_credential"`
}

NegotiateProposalArgsV3 model

This is used when the Holder wants to negotiate about an offer he received.

type NegotiateProposalResponse

type NegotiateProposalResponse struct{}

NegotiateProposalResponse model

Represents a NegotiateProposal response message.

type Option added in v0.1.7

type Option func(*Options)

Option modifies Options.

func WithAutoExecuteRFC0593 added in v0.1.7

func WithAutoExecuteRFC0593(p rfc0593.Provider) Option

WithAutoExecuteRFC0593 enables RFC0593.

type Options added in v0.1.7

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

Options contains configuration options.

type Provider added in v0.1.8

type Provider interface {
	Service(id string) (interface{}, error)
	ConnectionLookup() *connection.Lookup
}

Provider contains dependencies for the issuecredential protocol and is typically created by using aries.Context().

type SendOfferArgs

type SendOfferArgs struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// OfferCredential is a message describing the credential intend to offer and
	// possibly the price they expect to be paid.
	OfferCredential *issuecredential.OfferCredential `json:"offer_credential"`
}

SendOfferArgs model

This is used for sending an offer.

type SendOfferArgsV2 added in v0.1.8

type SendOfferArgsV2 struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// OfferCredential is a message describing the credential intend to offer and
	// possibly the price they expect to be paid.
	OfferCredential *issuecredential.OfferCredentialV2 `json:"offer_credential"`
}

SendOfferArgsV2 model

This is used for sending an offer.

type SendOfferArgsV3 added in v0.1.8

type SendOfferArgsV3 struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// OfferCredential is a message describing the credential intend to offer and
	// possibly the price they expect to be paid.
	OfferCredential *issuecredential.OfferCredentialV3 `json:"offer_credential"`
}

SendOfferArgsV3 model

This is used for sending an offer.

type SendOfferResponse

type SendOfferResponse struct {
	// PIID Protocol instance ID. It can be used as a correlation ID
	PIID string `json:"piid"`
}

SendOfferResponse model

Represents a SendOffer response message.

type SendProposalArgs

type SendProposalArgs struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// ProposeCredential is a message sent by the potential Holder to the Issuer to initiate the protocol
	ProposeCredential *issuecredential.ProposeCredential `json:"propose_credential"`
}

SendProposalArgs model

This is used for sending a proposal to initiate the protocol.

type SendProposalArgsV2 added in v0.1.8

type SendProposalArgsV2 struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// ProposeCredential is a message sent by the potential Holder to the Issuer to initiate the protocol
	ProposeCredential *issuecredential.ProposeCredentialV2 `json:"propose_credential"`
}

SendProposalArgsV2 model

This is used for sending a proposal to initiate the protocol.

type SendProposalArgsV3 added in v0.1.8

type SendProposalArgsV3 struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// ProposeCredential is a message sent by the potential Holder to the Issuer to initiate the protocol
	ProposeCredential *issuecredential.ProposeCredentialV3 `json:"propose_credential"`
}

SendProposalArgsV3 model

This is used for sending a proposal to initiate the protocol.

type SendProposalResponse

type SendProposalResponse struct {
	// PIID Protocol instance ID. It can be used as a correlation ID
	PIID string `json:"piid"`
}

SendProposalResponse model

Represents a SendProposal response message.

type SendRequestArgs

type SendRequestArgs struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// RequestCredential is a message sent by the potential Holder to the Issuer,
	// to request the issuance of a credential.
	RequestCredential *issuecredential.RequestCredential `json:"request_credential"`
}

SendRequestArgs model

This is used for sending a request.

type SendRequestArgsV2 added in v0.1.8

type SendRequestArgsV2 struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// RequestCredential is a message sent by the potential Holder to the Issuer,
	// to request the issuance of a credential.
	RequestCredential *issuecredential.RequestCredentialV2 `json:"request_credential"`
}

SendRequestArgsV2 model

This is used for sending a request.

type SendRequestArgsV3 added in v0.1.8

type SendRequestArgsV3 struct {
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
	// RequestCredential is a message sent by the potential Holder to the Issuer,
	// to request the issuance of a credential.
	RequestCredential *issuecredential.RequestCredentialV3 `json:"request_credential"`
}

SendRequestArgsV3 model

This is used for sending a request.

type SendRequestResponse

type SendRequestResponse struct {
	// PIID Protocol instance ID. It can be used as a correlation ID
	PIID string `json:"piid"`
}

SendRequestResponse model

Represents a SendRequest response message.

Jump to

Keyboard shortcuts

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