Documentation
¶
Index ¶
- Constants
- type Action
- type Format
- type Handler
- type HandlerFunc
- type Metadata
- type Middleware
- type Opt
- type Presentation
- type ProposePresentation
- type Provider
- type RequestPresentation
- 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, myDID, theirDID string) (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" // Spec defines the protocol spec. Spec = "https://didcomm.org/present-proof/2.0/" // ProposePresentationMsgType defines the protocol propose-presentation message type. ProposePresentationMsgType = Spec + "propose-presentation" // RequestPresentationMsgType defines the protocol request-presentation message type. RequestPresentationMsgType = Spec + "request-presentation" // PresentationMsgType defines the protocol presentation message type. PresentationMsgType = Spec + "presentation" // AckMsgType defines the protocol ack message type. AckMsgType = Spec + "ack" // ProblemReportMsgType defines the protocol problem-report message type. ProblemReportMsgType = Spec + "problem-report" // PresentationPreviewMsgType defines the protocol presentation-preview inner object type. PresentationPreviewMsgType = Spec + "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
// 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{}
}
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 WithFriendlyNames ¶ added in v0.1.4
WithFriendlyNames allows providing names for the presentations.
func WithPresentation ¶
func WithPresentation(msg *Presentation) Opt
WithPresentation allows providing Presentation message USAGE: This message can be provided after receiving a Request message.
func WithProposePresentation ¶
func WithProposePresentation(msg *ProposePresentation) Opt
WithProposePresentation allows providing ProposePresentation message USAGE: This message can be provided after receiving a Request message.
func WithRequestPresentation ¶
func WithRequestPresentation(msg *RequestPresentation) Opt
WithRequestPresentation 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 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"`
// FilterAttach 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.
ProposalAttach []decorator.Attachment `json:"proposal~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 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 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 ¶
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.