connection

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CommandName = "connection"

	RotateDIDCommandMethod = "RotateDID"
	CreateV2CommandMethod  = "CreateConnectionV2"
	SetToV2CommandMethod   = "SetConnectionToDIDCommV2"
)

constants for connection management endpoints.

View Source
const (
	// InvalidRequestErrorCode is typically a code for validation errors
	// for invalid connection controller requests.
	InvalidRequestErrorCode = command.Code(iota + command.Connection)

	// CreateConnectionErrorCode is for failures in create connection command.
	CreateConnectionErrorCode
	// SetToDIDCommV2ErrorCode is for failures in create peer DID command.
	SetToDIDCommV2ErrorCode
	// RotateDIDErrorCode is for failures in rotate DID command.
	RotateDIDErrorCode
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command provides controller API for connection commands.

func New

func New(prov provider) (*Command, error)

New creates connection Command.

func (*Command) CreateConnectionV2

func (c *Command) CreateConnectionV2(rw io.Writer, req io.Reader) command.Error

CreateConnectionV2 creates a DIDComm v2 connection.

func (*Command) GetHandlers

func (c *Command) GetHandlers() []command.Handler

GetHandlers returns list of all commands supported by this controller command.

func (*Command) RotateDID

func (c *Command) RotateDID(rw io.Writer, req io.Reader) command.Error

RotateDID handles a didcomm v2 DID rotation request.

func (*Command) RotateDIDGivenConnIDCmd

func (c *Command) RotateDIDGivenConnIDCmd(connID string) command.Exec

RotateDIDGivenConnIDCmd takes a connection ID and returns a command.Exec that rotates the given connection's DID.

func (*Command) SetConnectionToDIDCommV2

func (c *Command) SetConnectionToDIDCommV2(_ io.Writer, req io.Reader) command.Error

SetConnectionToDIDCommV2 sets that a connection is using didcomm v2, and associated versions of protocols.

type CreateConnectionRequest

type CreateConnectionRequest struct {
	MyDID    string `json:"my_did"`
	TheirDID string `json:"their_did"`
}

CreateConnectionRequest request to create a didcomm v2 connection.

type IDMessage

type IDMessage struct {
	ConnectionID string `json:"id"`
}

IDMessage is either a request or response message, holding connection ID. Used for: - response from creating a didcomm v2 connection. - request to set a connection to didcomm v2.

type RotateDIDRequest

type RotateDIDRequest struct {
	ID            string `json:"id"`
	KID           string `json:"kid"`
	NewDID        string `json:"new_did"`
	CreatePeerDID bool   `json:"create_peer_did"`
}

RotateDIDRequest request to rotate MyDID in the connection with the given ID.

type RotateDIDResponse

type RotateDIDResponse struct {
	NewDID string `json:"new_did"`
}

RotateDIDResponse response from a DID rotation call, with the new DID that the connection was rotated to.

Jump to

Keyboard shortcuts

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