Documentation ¶
Index ¶
- Constants
- type Connection
- type ConnectionSignature
- type Invitation
- type PleaseAck
- type Request
- type Response
- type Service
- func (s *Service) Accept(msgType string) bool
- func (s *Service) AcceptConnectionRequest(connectionID, publicDID, label string, routerConnections []string) error
- func (s *Service) AcceptInvitation(connectionID, publicDID, label string, routerConnections []string) error
- func (s *Service) CreateConnection(record *connection.Record, theirDID *did.Doc) error
- func (s *Service) CreateImplicitInvitation(inviterLabel, inviterDID, inviteeLabel, inviteeDID string, ...) (string, 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) Initialize(p interface{}) error
- func (s *Service) Name() string
Constants ¶
const ( // LegacyConnection connection protocol. LegacyConnection = "legacyconnection" // PIURI is the connection protocol identifier URI. PIURI = "https://didcomm.org/connections/1.0" // InvitationMsgType defines the legacy-connection invite message type. InvitationMsgType = PIURI + "/invitation" // RequestMsgType defines the legacy-connection request message type. RequestMsgType = PIURI + "/request" // ResponseMsgType defines the legacy-connection response message type. ResponseMsgType = PIURI + "/response" // AckMsgType defines the legacy-connection ack message type. AckMsgType = "https://didcomm.org/notification/1.0/ack" )
const ( // StateIDInvited marks the invited phase of the connection protocol. StateIDInvited = "invited" // StateIDRequested marks the requested phase of the connection protocol. StateIDRequested = "requested" // StateIDResponded marks the responded phase of the connection protocol. StateIDResponded = "responded" // StateIDCompleted marks the completed phase of the connection protocol. StateIDCompleted = "completed" // PlsAckOnReceipt ack type that says, "Please send me an ack as soon as you receive this message.". PlsAckOnReceipt = "RECEIPT" )
const (
// InvitationRecipientKey is map key constant.
InvitationRecipientKey = "invRecipientKey"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { DID string `json:"DID,omitempty"` DIDDoc *did.Doc `json:"DIDDoc,omitempty"` }
Connection defines connection body of connection request.
type ConnectionSignature ¶
type ConnectionSignature struct { Type string `json:"@type,omitempty"` Signature string `json:"signature,omitempty"` SignedData string `json:"sig_data,omitempty"` SignVerKey string `json:"signer,omitempty"` }
ConnectionSignature connection signature.
type Invitation ¶
type Invitation struct { // the Type of the connection invitation Type string `json:"@type,omitempty"` // the ID of the connection invitation ID string `json:"@id,omitempty"` // the Label of the connection invitation Label string `json:"label,omitempty"` // the RecipientKeys for the connection invitation RecipientKeys []string `json:"recipientKeys,omitempty"` // the Service endpoint of the connection invitation ServiceEndpoint string `json:"serviceEndpoint,omitempty"` // the RoutingKeys of the connection invitation RoutingKeys []string `json:"routingKeys,omitempty"` // the DID of the connection invitation DID string `json:"did,omitempty"` }
Invitation model
Invitation defines Connection protocol invitation message https://github.com/hyperledger/aries-rfcs/tree/main/features/0160-connection-protocol#0-invitation-to-connect
type PleaseAck ¶
type PleaseAck struct {
On []string `json:"on,omitempty"`
}
PleaseAck connection response accepted acknowledgement.
type Request ¶
type Request struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` Label string `json:"label"` Thread *decorator.Thread `json:"~thread,omitempty"` Connection *Connection `json:"connection,omitempty"` }
Request defines a2a Connection request https://github.com/hyperledger/aries-rfcs/tree/main/features/0160-connection-protocol#1-connection-request
type Response ¶
type Response struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` ConnectionSignature *ConnectionSignature `json:"connection~sig,omitempty"` Thread *decorator.Thread `json:"~thread,omitempty"` PleaseAck *PleaseAck `json:"~please_ack,omitempty"` }
Response defines a2a Connection response https://github.com/hyperledger/aries-rfcs/tree/main/features/0160-connection-protocol#2-connection-response
type Service ¶
Service for Connection protocol.
func (*Service) AcceptConnectionRequest ¶
func (s *Service) AcceptConnectionRequest(connectionID, publicDID, label string, routerConnections []string) error
AcceptConnectionRequest accepts/approves connection request.
func (*Service) AcceptInvitation ¶
func (s *Service) AcceptInvitation(connectionID, publicDID, label string, routerConnections []string) error
AcceptInvitation accepts/approves connection invitation.
func (*Service) CreateConnection ¶
CreateConnection saves the record to the connection store and maps TheirDID to their recipient keys in the did connection store.
func (*Service) CreateImplicitInvitation ¶
func (s *Service) CreateImplicitInvitation(inviterLabel, inviterDID, inviteeLabel, inviteeDID string, routerConnections []string) (string, error)
CreateImplicitInvitation creates implicit invitation. Inviter DID is required, invitee DID is optional. If invitee DID is not provided new peer DID will be created for implicit invitation connection request.
func (*Service) HandleInbound ¶
func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error)
HandleInbound handles inbound connection messages.
func (*Service) HandleOutbound ¶
HandleOutbound handles outbound connection messages.
func (*Service) Initialize ¶
Initialize initializes the Service. If Initialize succeeds, any further call is a no-op.