outofbandv2

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: 23 Imported by: 14

Documentation

Index

Constants

View Source
const (
	// Name of this protocol service.
	Name = "out-of-band/2.0"

	// PIURI is the Out-of-Band protocol's protocol instance URI.
	PIURI = "https://didcomm.org/" + Name
	// InvitationMsgType is the '@type' for the invitation message.
	InvitationMsgType = PIURI + "/invitation"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptOption

type AcceptOption func(opts *acceptOpts)

AcceptOption boilerplate adds configured parameter to Service.AcceptInvitation.

func WithRouterConnections

func WithRouterConnections(routerConnections []string) AcceptOption

WithRouterConnections option sets router connections for the connection created with this Invitation acceptance.

type Invitation

type Invitation struct {
	ID       string                    `json:"id"`
	Type     string                    `json:"type"`
	Label    string                    `json:"label,omitempty"`
	From     string                    `json:"from"`
	Body     *InvitationBody           `json:"body"`
	Requests []*decorator.AttachmentV2 `json:"attachments,omitempty"`
}

Invitation is this protocol's `invitation` message.

type InvitationBody

type InvitationBody struct {
	Goal     string   `json:"goal,omitempty"`
	GoalCode string   `json:"goal_code,omitempty"`
	Accept   []string `json:"accept,omitempty"`
}

InvitationBody contains invitation's goal and accept headers.

type Provider

type Provider interface {
	Service(id string) (interface{}, error)
	StorageProvider() storage.Provider
	VDRegistry() vdrapi.Registry
	ProtocolStateStorageProvider() storage.Provider
	InboundDIDCommMessageHandler() func() service.InboundHandler
	Messenger() service.Messenger
	KMS() kms.KeyManager
	KeyType() kms.KeyType
	KeyAgreementType() kms.KeyType
	MediaTypeProfiles() []string
	ServiceMsgTypeTargets() []dispatcher.MessageTypeTarget
	AllServices() []dispatcher.ProtocolService
}

Provider provides this service's dependencies.

type Service

type Service struct {
	service.Action
	service.Message
	// contains filtered or unexported fields
}

Service implements the Out-Of-Band V2 protocol.

func New

func New(p Provider) (*Service, error)

New creates a new instance of the out-of-band service.

func (*Service) Accept

func (s *Service) Accept(msgType string) bool

Accept determines whether this service can handle the given type of message.

func (*Service) AcceptInvitation

func (s *Service) AcceptInvitation(i *Invitation, opts ...AcceptOption) (string, error)

AcceptInvitation from another agent.

func (*Service) HandleInbound

func (s *Service) HandleInbound(msg service.DIDCommMsg, didCommCtx service.DIDCommContext) (string, error)

HandleInbound handles inbound messages.

func (*Service) HandleOutbound

func (s *Service) HandleOutbound(_ service.DIDCommMsg, _, _ string) (string, error)

HandleOutbound handles outbound messages.

func (*Service) Initialize

func (s *Service) Initialize(prov interface{}) error

Initialize initializes the Service. If Initialize succeeds, any further call is a no-op.

func (*Service) Name

func (s *Service) Name() string

Name is this service's name.

func (*Service) SaveInvitation

func (s *Service) SaveInvitation(inv *Invitation) error

SaveInvitation saves OOB v2 Invitation.

Jump to

Keyboard shortcuts

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