Documentation ¶
Index ¶
- Constants
- type Action
- type Format
- type Handler
- type HandlerFunc
- type Metadata
- type Middleware
- type Opt
- func WithAddProofFn(addProof func(presentation *verifiable.Presentation) error) Opt
- func WithFriendlyNames(names ...string) Opt
- func WithMultiOptions(opts ...Opt) Opt
- func WithPresentation(msg *Presentation) Opt
- func WithPresentationV3(msg *PresentationV3) Opt
- func WithProposePresentation(msg *ProposePresentation) Opt
- func WithProposePresentationV3(msg *ProposePresentationV3) Opt
- func WithRequestPresentation(msg *RequestPresentation) Opt
- func WithRequestPresentationV3(msg *RequestPresentationV3) Opt
- type Presentation
- type PresentationV3
- type PresentationV3Body
- type ProposePresentation
- type ProposePresentationV3
- type ProposePresentationV3Body
- type Provider
- type RequestPresentation
- type RequestPresentationV3
- type RequestPresentationV3Body
- type Service
- func (s *Service) Accept(msgType string) bool
- func (s *Service) ActionContinue(piID string, opt Opt) error
- func (s *Service) ActionStop(piID string, cErr error) error
- func (s *Service) Actions() ([]Action, error)
- func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error)
- func (s *Service) HandleOutbound(_ service.DIDCommMsg, _, _ string) (string, error)
- func (s *Service) Name() string
- func (s *Service) Use(items ...Middleware)
Constants ¶
const ( // Name defines the protocol name. Name = "present-proof" // SpecV2 defines the protocol spec. SpecV2 = "https://didcomm.org/present-proof/2.0/" // ProposePresentationMsgTypeV2 defines the protocol propose-presentation message type. ProposePresentationMsgTypeV2 = SpecV2 + "propose-presentation" // RequestPresentationMsgTypeV2 defines the protocol request-presentation message type. RequestPresentationMsgTypeV2 = SpecV2 + "request-presentation" // PresentationMsgTypeV2 defines the protocol presentation message type. PresentationMsgTypeV2 = SpecV2 + "presentation" // AckMsgTypeV2 defines the protocol ack message type. AckMsgTypeV2 = SpecV2 + "ack" // ProblemReportMsgTypeV2 defines the protocol problem-report message type. ProblemReportMsgTypeV2 = SpecV2 + "problem-report" // PresentationPreviewMsgTypeV2 defines the protocol presentation-preview inner object type. PresentationPreviewMsgTypeV2 = SpecV2 + "presentation-preview" // SpecV3 defines the protocol spec. SpecV3 = "https://didcomm.org/present-proof/3.0/" // ProposePresentationMsgTypeV3 defines the protocol propose-presentation message type. ProposePresentationMsgTypeV3 = SpecV3 + "propose-presentation" // RequestPresentationMsgTypeV3 defines the protocol request-presentation message type. RequestPresentationMsgTypeV3 = SpecV3 + "request-presentation" // PresentationMsgTypeV3 defines the protocol presentation message type. PresentationMsgTypeV3 = SpecV3 + "presentation" // AckMsgTypeV3 defines the protocol ack message type. AckMsgTypeV3 = SpecV3 + "ack" // ProblemReportMsgTypeV3 defines the protocol problem-report message type. ProblemReportMsgTypeV3 = SpecV3 + "problem-report" // PresentationPreviewMsgTypeV3 defines the protocol presentation-preview inner object type. PresentationPreviewMsgTypeV3 = SpecV3 + "presentation-preview" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { // Protocol instance ID PIID string Msg service.DIDCommMsgMap MyDID string TheirDID string }
Action contains helpful information about action.
type Format ¶ added in v0.1.4
type Format struct { AttachID string `json:"attach_id,omitempty"` Format string `json:"format,omitempty"` }
Format contains the the value of the attachment @id and the verifiable credential format of the attachment.
type HandlerFunc ¶ added in v0.1.4
HandlerFunc is a helper type which implements the middleware Handler interface.
func (HandlerFunc) Handle ¶ added in v0.1.4
func (hf HandlerFunc) Handle(metadata Metadata) error
Handle implements function to satisfy the Handler interface.
type Metadata ¶ added in v0.1.4
type Metadata interface { // Message contains the original inbound/outbound message Message() service.DIDCommMsg // Presentation is pointer to the message provided by the user through the Continue function. Presentation() *Presentation // ProposePresentation is pointer to the message provided by the user through the Continue function. ProposePresentation() *ProposePresentation // RequestPresentation is pointer to the message provided by the user through the Continue function. RequestPresentation() *RequestPresentation // PresentationV3 is pointer to the message provided by the user through the Continue function. PresentationV3() *PresentationV3 // ProposePresentationV3 is pointer to the message provided by the user through the Continue function. ProposePresentationV3() *ProposePresentationV3 // RequestPresentationV3 is pointer to the message provided by the user through the Continue function. RequestPresentationV3() *RequestPresentationV3 // PresentationNames is a slice which contains presentation names provided by the user through the Continue function. PresentationNames() []string // StateName provides the state name StateName() string // Properties provides the possibility to set properties Properties() map[string]interface{} // GetAddProofFn provides function to sign the Presentation. GetAddProofFn() func(presentation *verifiable.Presentation) error }
Metadata provides helpful information for the processing.
type Middleware ¶ added in v0.1.4
Middleware function receives next handler and returns handler that needs to be executed.
type Opt ¶
type Opt func(md *metaData)
Opt describes option signature for the Continue function.
func WithAddProofFn ¶ added in v0.1.6
func WithAddProofFn(addProof func(presentation *verifiable.Presentation) error) Opt
WithAddProofFn allows providing function that will sign the Presentation. USAGE: This fn can be provided after receiving a Invitation message.
func WithFriendlyNames ¶ added in v0.1.4
WithFriendlyNames allows providing names for the presentations.
func WithMultiOptions ¶ added in v0.1.6
WithMultiOptions allows combining several options into one.
func WithPresentation ¶
func WithPresentation(msg *Presentation) Opt
WithPresentation allows providing Presentation message USAGE: This message can be provided after receiving a Invitation message.
func WithPresentationV3 ¶ added in v0.1.7
func WithPresentationV3(msg *PresentationV3) Opt
WithPresentationV3 allows providing PresentationV3 message USAGE: This message can be provided after receiving a Invitation message.
func WithProposePresentation ¶
func WithProposePresentation(msg *ProposePresentation) Opt
WithProposePresentation allows providing ProposePresentation message USAGE: This message can be provided after receiving a Invitation message.
func WithProposePresentationV3 ¶ added in v0.1.7
func WithProposePresentationV3(msg *ProposePresentationV3) Opt
WithProposePresentationV3 allows providing ProposePresentationV3 message USAGE: This message can be provided after receiving a Invitation message.
func WithRequestPresentation ¶
func WithRequestPresentation(msg *RequestPresentation) Opt
WithRequestPresentation allows providing RequestPresentation message USAGE: This message can be provided after receiving a propose message.
func WithRequestPresentationV3 ¶ added in v0.1.7
func WithRequestPresentationV3(msg *RequestPresentationV3) Opt
WithRequestPresentationV3 allows providing RequestPresentation message USAGE: This message can be provided after receiving a propose message.
type Presentation ¶
type Presentation struct { Type string `json:"@type,omitempty"` // Comment is a field that provides some human readable information about the proposed presentation. // TODO: Should follow DIDComm conventions for l10n. [Issue #1300]. Comment string `json:"comment,omitempty"` // Formats contains an entry for each presentations~attach array entry, providing the the value of the attachment // @id and the verifiable presentation format and version of the attachment. Formats []Format `json:"formats,omitempty"` // PresentationsAttach an array of attachments containing the presentation in the requested format(s). PresentationsAttach []decorator.Attachment `json:"presentations~attach,omitempty"` }
Presentation is a response to a RequestPresentation message and contains signed presentations. TODO: Add ~please_ack decorator support for the protocol [Issue #2047].
type PresentationV3 ¶ added in v0.1.7
type PresentationV3 struct { Type string `json:"type,omitempty"` Body PresentationV3Body `json:"body,omitempty"` // Attachments is an array of attachments that further define the presentation request being proposed. // This might be used to clarify which formats or format versions are wanted. Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"` }
PresentationV3 is a response to a RequestPresentation message and contains signed presentations.
type PresentationV3Body ¶ added in v0.1.7
type PresentationV3Body struct { GoalCode string `json:"goal_code,omitempty"` // Comment is a field that provides some human readable information about the proposed presentation. // TODO: Should follow DIDComm conventions for l10n. [Issue #1300] Comment string `json:"comment,omitempty"` }
PresentationV3Body represents body for PresentationV3.
type ProposePresentation ¶
type ProposePresentation struct { Type string `json:"@type,omitempty"` // Comment is a field that provides some human readable information about the proposed presentation. // TODO: Should follow DIDComm conventions for l10n. [Issue #1300] Comment string `json:"comment,omitempty"` // Formats contains an entry for each proposal~attach array entry, including an optional value of the // attachment @id (if attachments are present) and the verifiable presentation format and version of the attachment. Formats []Format `json:"formats,omitempty"` // ProposalsAttach is an array of attachments that further define the presentation request being proposed. // This might be used to clarify which formats or format versions are wanted. ProposalsAttach []decorator.Attachment `json:"proposals~attach,omitempty"` }
ProposePresentation is an optional message sent by the prover to the verifier to initiate a proof presentation process, or in response to a request-presentation message when the prover wants to propose using a different presentation format or request.
type ProposePresentationV3 ¶ added in v0.1.7
type ProposePresentationV3 struct { Type string `json:"type,omitempty"` Body ProposePresentationV3Body `json:"body,omitempty"` // Attachments is an array of attachments that further define the presentation request being proposed. // This might be used to clarify which formats or format versions are wanted. Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"` }
ProposePresentationV3 is an optional message sent by the prover to the verifier to initiate a proof presentation process, or in response to a request-presentation message when the prover wants to propose using a different presentation format or request.
type ProposePresentationV3Body ¶ added in v0.1.7
type ProposePresentationV3Body struct { GoalCode string `json:"goal_code,omitempty"` // Comment is a field that provides some human readable information about the proposed presentation. // TODO: Should follow DIDComm conventions for l10n. [Issue #1300] Comment string `json:"comment,omitempty"` }
ProposePresentationV3Body represents body for ProposePresentationV3.
type Provider ¶
Provider contains dependencies for the protocol and is typically created by using aries.Context().
type RequestPresentation ¶
type RequestPresentation struct { Type string `json:"@type,omitempty"` // Comment is a field that provides some human readable information about the proposed presentation. // TODO: Should follow DIDComm conventions for l10n. [Issue #1300] Comment string `json:"comment,omitempty"` // WillConfirm is a field that defaults to "false" to indicate that the verifier will or will not // send a post-presentation confirmation ack message. WillConfirm bool `json:"will_confirm,omitempty"` // Formats contains an entry for each request_presentations~attach array entry, providing the the value of the // attachment @id and the verifiable presentation request format and version of the attachment. Formats []Format `json:"formats,omitempty"` // RequestPresentationsAttach is an array of attachments containing the acceptable verifiable presentation requests. RequestPresentationsAttach []decorator.Attachment `json:"request_presentations~attach,omitempty"` }
RequestPresentation describes values that need to be revealed and predicates that need to be fulfilled.
type RequestPresentationV3 ¶ added in v0.1.7
type RequestPresentationV3 struct { Type string `json:"type,omitempty"` Body RequestPresentationV3Body `json:"body,omitempty"` // Attachments is an array of attachments containing the acceptable verifiable presentation requests. Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"` }
RequestPresentationV3 describes values that need to be revealed and predicates that need to be fulfilled.
type RequestPresentationV3Body ¶ added in v0.1.7
type RequestPresentationV3Body struct { GoalCode string `json:"goal_code,omitempty"` // Comment is a field that provides some human readable information about the proposed presentation. // TODO: Should follow DIDComm conventions for l10n. [Issue #1300] Comment string `json:"comment,omitempty"` // WillConfirm is a field that defaults to "false" to indicate that the verifier will or will not // send a post-presentation confirmation ack message. WillConfirm bool `json:"will_confirm,omitempty"` }
RequestPresentationV3Body represents body for RequestPresentationV3.
type Service ¶
Service for the presentproof protocol.
func (*Service) ActionContinue ¶
ActionContinue allows proceeding with the action by the piID.
func (*Service) ActionStop ¶
ActionStop allows stopping the action by the piID.
func (*Service) HandleInbound ¶
func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error)
HandleInbound handles inbound message (presentproof protocol).
func (*Service) HandleOutbound ¶
HandleOutbound handles outbound message (presentproof protocol).
func (*Service) Use ¶ added in v0.1.4
func (s *Service) Use(items ...Middleware)
Use allows providing middlewares.