issuecredential

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

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"
	SendProposal        = "SendProposal"
	SendRequest         = "SendRequest"
	AcceptProposal      = "AcceptProposal"
	DeclineProposal     = "DeclineProposal"
	AcceptOffer         = "AcceptOffer"
	DeclineOffer        = "DeclineOffer"
	NegotiateProposal   = "NegotiateProposal"
	AcceptRequest       = "AcceptRequest"
	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"`
}

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 ID
	PIID string `json:"piid"`
}

AcceptOfferArgs model

This is used for accepting an offer

type AcceptOfferResponse

type AcceptOfferResponse struct{}

AcceptOfferResponse model

Represents a AcceptOffer response message

type AcceptProblemReportArgs

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

AcceptProblemReportArgs model

This is used for accepting a problem report

type AcceptProblemReportResponse

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 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 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 issuecredential.Provider, notifier command.Notifier) (*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. nolint: dupl

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. nolint: dupl

func (*Command) AcceptProblemReport

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

AcceptProblemReport is used for accepting problem report. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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. nolint: dupl

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"`
}

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"`
}

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 NegotiateProposalResponse

type NegotiateProposalResponse struct{}

NegotiateProposalResponse model

Represents a NegotiateProposal response message

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 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 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 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