outofband

package
v0.0.0-...-57c6170 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name of this protocol service.
	Name = "out-of-band"
	// PIURI is the Out-of-Band protocol's protocol instance URI.
	PIURI = "https://didcomm.org/out-of-band/1.0"

	// InvitationMsgType is the '@type' for the invitation message.
	InvitationMsgType = PIURI + "/invitation"
	// OldInvitationMsgType is the `@type` for the old invitation message.
	OldInvitationMsgType = oldPIURI + "/invitation"
	// HandshakeReuseMsgType is the '@type' for the reuse message.
	HandshakeReuseMsgType = PIURI + "/handshake-reuse"
	// HandshakeReuseAcceptedMsgType is the '@type' for the reuse-accepted message.
	HandshakeReuseAcceptedMsgType = PIURI + "/handshake-reuse-accepted"
)
View Source
const (
	// StateNameInitial is the initial state.
	StateNameInitial = "initial"
	// StateNameAwaitResponse is the state where a sender or a receiver are awaiting a response.
	StateNameAwaitResponse = "await-response"
	// StateNamePrepareResponse is the state where a receiver is preparing a response to the sender.
	StateNamePrepareResponse = "prepare-response"
	// StateNameDone is the final state.
	StateNameDone = "done"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Protocol instance ID
	PIID         string
	Msg          service.DIDCommMsgMap
	ProtocolName string
	MyDID        string
	TheirDID     string
}

Action contains helpful information about action.

type HandshakeReuse

type HandshakeReuse struct {
	ID   string `json:"@id"`
	Type string `json:"@type"`
}

HandshakeReuse is this protocol's 'handshake-reuse' message.

type HandshakeReuseAccepted

type HandshakeReuseAccepted struct {
	ID   string `json:"@id"`
	Type string `json:"@type"`
}

HandshakeReuseAccepted is this protocol's 'handshake-reuse-accepted' message.

type Invitation

type Invitation struct {
	ID        string                  `json:"@id"`
	Type      string                  `json:"@type"`
	Label     string                  `json:"label,omitempty"`
	Goal      string                  `json:"goal,omitempty"`
	GoalCode  string                  `json:"goal_code,omitempty"`
	Services  []interface{}           `json:"services"` // Services is an array of either DIDs or 'services' block entries
	Accept    []string                `json:"accept,omitempty"`
	Protocols []string                `json:"handshake_protocols,omitempty"`
	Requests  []*decorator.Attachment `json:"request~attach,omitempty"`
}

Invitation is this protocol's `invitation` message.

type Options

type Options interface {
	// MyLabel is the label to share with the other agent in the subsequent did-exchange.
	MyLabel() string
	RouterConnections() []string
	ReuseAnyConnection() bool
	ReuseConnection() string
}

Options is a container for optional values provided by the user.

type Provider

type Provider interface {
	Service(id string) (interface{}, error)
	StorageProvider() storage.Provider
	ProtocolStateStorageProvider() storage.Provider
	InboundDIDCommMessageHandler() func() service.InboundHandler
	Messenger() service.Messenger
	MediaTypeProfiles() []string
}

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 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, options Options) (string, error)

AcceptInvitation from another agent and return the connection ID.

func (*Service) ActionContinue

func (s *Service) ActionContinue(piID string, opts Options) error

ActionContinue allows proceeding with the action by the piID.

func (*Service) ActionStop

func (s *Service) ActionStop(piID string, _ error) error

ActionStop allows stopping the action by the piID.

func (*Service) Actions

func (s *Service) Actions() ([]Action, error)

Actions returns actions for the async usage.

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(i *Invitation) error

SaveInvitation created by the outofband client.

Jump to

Keyboard shortcuts

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