Documentation ¶
Index ¶
- func NewRemoteSignedSecureRequest(ctx context.Context, request protocol.Request, security inter.SecurityProvider) (secure protocol.SecureRequest, err error)
- func NewReply(request protocol.Request, certname string) (rep protocol.Reply, err error)
- func NewReplyFromSecureReply(sr protocol.SecureReply) (rep protocol.Reply, err error)
- func NewRequest(agent string, senderid string, callerid string, ttl int, requestid string, ...) (req protocol.Request, err error)
- func NewRequestFromSecureRequest(sr protocol.SecureRequest) (protocol.Request, error)
- func NewSecureReply(reply protocol.Reply, security inter.SecurityProvider) (secure protocol.SecureReply, err error)
- func NewSecureReplyFromTransport(message protocol.TransportMessage, security inter.SecurityProvider, ...) (secure protocol.SecureReply, err error)
- func NewSecureRequest(request protocol.Request, security inter.SecurityProvider) (secure protocol.SecureRequest, err error)
- func NewSecureRequestFromTransport(message protocol.TransportMessage, security inter.SecurityProvider, ...) (secure protocol.SecureRequest, err error)
- func NewTransportFromJSON(data []byte) (message protocol.TransportMessage, err error)
- func NewTransportMessage(certname string) (message protocol.TransportMessage, err error)
- type FederationTransportHeader
- type Reply
- func (r *Reply) Agent() string
- func (r *Reply) FederationReplyTo() (replyto string, federated bool)
- func (r *Reply) FederationRequestID() (id string, federated bool)
- func (r *Reply) FederationTargets() (targets []string, federated bool)
- func (r *Reply) IsFederated() bool
- func (r *Reply) IsValidJSON(data []byte) (err error)
- func (r *Reply) JSON() ([]byte, error)
- func (r *Reply) Message() (msg []byte)
- func (r *Reply) NetworkHops() [][3]string
- func (r *Reply) RecordNetworkHop(in string, processor string, out string)
- func (r *Reply) RequestID() string
- func (r *Reply) SenderID() string
- func (r *Reply) SetFederationReplyTo(reply string)
- func (r *Reply) SetFederationRequestID(id string)
- func (r *Reply) SetFederationTargets(targets []string)
- func (r *Reply) SetMessage(message []byte)
- func (r *Reply) SetUnfederated()
- func (r *Reply) Time() time.Time
- func (r *Reply) Version() protocol.ProtocolVersion
- type ReplyEnvelope
- type Request
- func (r *Request) Agent() string
- func (r *Request) CallerID() string
- func (r *Request) CallerPublicData() string
- func (r *Request) Collective() string
- func (r *Request) FederationReplyTo() (replyto string, federated bool)
- func (r *Request) FederationRequestID() (id string, federated bool)
- func (r *Request) FederationTargets() (targets []string, federated bool)
- func (r *Request) Filter() (filter *protocol.Filter, filtered bool)
- func (r *Request) IsFederated() bool
- func (r *Request) IsValidJSON(data []byte) error
- func (r *Request) JSON() ([]byte, error)
- func (r *Request) Message() []byte
- func (r *Request) NetworkHops() [][3]string
- func (r *Request) NewFilter() *protocol.Filter
- func (r *Request) RecordNetworkHop(in string, processor string, out string)
- func (r *Request) RequestID() string
- func (r *Request) SenderID() string
- func (r *Request) SetAgent(agent string)
- func (r *Request) SetCallerID(id string)
- func (r *Request) SetCollective(collective string)
- func (r *Request) SetFederationReplyTo(reply string)
- func (r *Request) SetFederationRequestID(id string)
- func (r *Request) SetFederationTargets(targets []string)
- func (r *Request) SetFilter(filter *protocol.Filter)
- func (r *Request) SetMessage(message []byte)
- func (r *Request) SetRequestID(id string)
- func (r *Request) SetTTL(ttl int)
- func (r *Request) SetUnfederated()
- func (r *Request) SignerPublicData() string
- func (r *Request) TTL() int
- func (r *Request) Time() time.Time
- func (r *Request) Version() protocol.ProtocolVersion
- type RequestEnvelope
- type SecureReply
- func (r *SecureReply) IsValidJSON(data []byte) (err error)
- func (r *SecureReply) JSON() ([]byte, error)
- func (r *SecureReply) Message() []byte
- func (r *SecureReply) SetMessage(reply protocol.Reply) (err error)
- func (r *SecureReply) Valid() bool
- func (r *SecureReply) Version() protocol.ProtocolVersion
- type SecureRequest
- func (r *SecureRequest) CallerPublicData() string
- func (r *SecureRequest) IsValidJSON(data []byte) (err error)
- func (r *SecureRequest) JSON() ([]byte, error)
- func (r *SecureRequest) Message() []byte
- func (r *SecureRequest) SetMessage(request protocol.Request) (err error)
- func (r *SecureRequest) SetSigner(_ []byte) error
- func (r *SecureRequest) Valid() bool
- func (r *SecureRequest) Version() protocol.ProtocolVersion
- type TransportHeaders
- type TransportMessage
- func (m *TransportMessage) FederationReplyTo() (replyto string, federated bool)
- func (m *TransportMessage) FederationRequestID() (id string, federated bool)
- func (m *TransportMessage) FederationTargets() (targets []string, federated bool)
- func (m *TransportMessage) IsFederated() bool
- func (m *TransportMessage) IsValidJSON(data []byte) error
- func (m *TransportMessage) JSON() ([]byte, error)
- func (m *TransportMessage) Message() (data []byte, err error)
- func (m *TransportMessage) NetworkHops() [][3]string
- func (m *TransportMessage) RecordNetworkHop(in string, processor string, out string)
- func (m *TransportMessage) ReplyTo() string
- func (m *TransportMessage) SeenBy() [][3]string
- func (m *TransportMessage) SenderID() string
- func (m *TransportMessage) SetFederationReplyTo(reply string)
- func (m *TransportMessage) SetFederationRequestID(id string)
- func (m *TransportMessage) SetFederationTargets(targets []string)
- func (m *TransportMessage) SetReplyData(reply protocol.SecureReply) error
- func (m *TransportMessage) SetReplyTo(reply string)
- func (m *TransportMessage) SetRequestData(request protocol.SecureRequest) error
- func (m *TransportMessage) SetSender(sender string)
- func (m *TransportMessage) SetUnfederated()
- func (m *TransportMessage) Version() protocol.ProtocolVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRemoteSignedSecureRequest ¶
func NewRemoteSignedSecureRequest(ctx context.Context, request protocol.Request, security inter.SecurityProvider) (secure protocol.SecureRequest, err error)
NewRemoteSignedSecureRequest is a NewSecureRequest that delegates the signing to a remote signer like aaasvc
func NewReplyFromSecureReply ¶
func NewReplyFromSecureReply(sr protocol.SecureReply) (rep protocol.Reply, err error)
NewReplyFromSecureReply create a choria:reply:1 based on the data contained in a SecureReply
func NewRequest ¶
func NewRequest(agent string, senderid string, callerid string, ttl int, requestid string, collective string) (req protocol.Request, err error)
NewRequest creates a choria:request:1
func NewRequestFromSecureRequest ¶
func NewRequestFromSecureRequest(sr protocol.SecureRequest) (protocol.Request, error)
NewRequestFromSecureRequest creates a choria::request:1 based on the data contained in a SecureRequest
func NewSecureReply ¶
func NewSecureReply(reply protocol.Reply, security inter.SecurityProvider) (secure protocol.SecureReply, err error)
NewSecureReply creates a choria:secure:reply:1
func NewSecureReplyFromTransport ¶
func NewSecureReplyFromTransport(message protocol.TransportMessage, security inter.SecurityProvider, skipvalidate bool) (secure protocol.SecureReply, err error)
NewSecureReplyFromTransport creates a new choria:secure:reply:1 from the data contained in a Transport message
func NewSecureRequest ¶
func NewSecureRequest(request protocol.Request, security inter.SecurityProvider) (secure protocol.SecureRequest, err error)
NewSecureRequest creates a choria:secure:request:1
func NewSecureRequestFromTransport ¶
func NewSecureRequestFromTransport(message protocol.TransportMessage, security inter.SecurityProvider, skipvalidate bool) (secure protocol.SecureRequest, err error)
NewSecureRequestFromTransport creates a new choria:secure:request:1 from the data contained in a Transport message
func NewTransportFromJSON ¶
func NewTransportFromJSON(data []byte) (message protocol.TransportMessage, err error)
NewTransportFromJSON creates a new TransportMessage from JSON
func NewTransportMessage ¶
func NewTransportMessage(certname string) (message protocol.TransportMessage, err error)
NewTransportMessage creates a choria:transport:1
Types ¶
type FederationTransportHeader ¶ added in v0.26.2
type Reply ¶ added in v0.26.2
type Reply struct { Protocol protocol.ProtocolVersion `json:"protocol"` MessageBody string `json:"message"` Envelope *ReplyEnvelope `json:"envelope"` // contains filtered or unexported fields }
func (*Reply) FederationReplyTo ¶ added in v0.26.2
FederationReplyTo retrieves the reply to string set by the federation broker
func (*Reply) FederationRequestID ¶ added in v0.26.2
FederationRequestID retrieves the federation specific requestid
func (*Reply) FederationTargets ¶ added in v0.26.2
FederationTargets retrieves the list of targets this message is destined for
func (*Reply) IsFederated ¶ added in v0.26.2
IsFederated determines if this message is federated
func (*Reply) IsValidJSON ¶ added in v0.26.2
IsValidJSON validates the given JSON data against the schema
func (*Reply) Message ¶ added in v0.26.2
Message retrieves the JSON encoded message set using SetMessage
func (*Reply) NetworkHops ¶ added in v0.26.2
NetworkHops returns a list of tuples this messaged traveled through
func (*Reply) RecordNetworkHop ¶ added in v0.26.2
RecordNetworkHop appends a hop onto the list of those who processed this message
func (*Reply) SetFederationReplyTo ¶ added in v0.26.2
SetFederationReplyTo stores the original reply-to destination in the federation headers
func (*Reply) SetFederationRequestID ¶ added in v0.26.2
SetFederationRequestID sets the request ID for federation purposes
func (*Reply) SetFederationTargets ¶ added in v0.26.2
SetFederationTargets sets the list of hosts this message should go to.
Federation brokers will duplicate the message and send one for each target
func (*Reply) SetMessage ¶ added in v0.26.2
SetMessage sets the data to be stored in the Reply. It should be JSON encoded already.
func (*Reply) SetUnfederated ¶ added in v0.26.2
func (r *Reply) SetUnfederated()
SetUnfederated removes any federation information from the message
func (*Reply) Version ¶ added in v0.26.2
func (r *Reply) Version() protocol.ProtocolVersion
Version retrieves the protocol version for this message
type ReplyEnvelope ¶ added in v0.26.2
type Request ¶ added in v0.26.2
type Request struct { Protocol protocol.ProtocolVersion `json:"protocol"` MessageBody string `json:"message"` Envelope *RequestEnvelope `json:"envelope"` // contains filtered or unexported fields }
func (*Request) CallerPublicData ¶ added in v0.27.0
CallerPublicData is not supported for version 1 messages and is always an empty string
func (*Request) Collective ¶ added in v0.26.2
Collective retrieves the name of the sub collective this message is aimed at
func (*Request) FederationReplyTo ¶ added in v0.26.2
FederationReplyTo retrieves the reply to string set by the federation broker
func (*Request) FederationRequestID ¶ added in v0.26.2
FederationRequestID retrieves the federation specific requestid
func (*Request) FederationTargets ¶ added in v0.26.2
FederationTargets retrieves the list of targets this message is destined for
func (*Request) Filter ¶ added in v0.26.2
Filter retrieves the filter for the message. The boolean is true when the filter is not empty
func (*Request) IsFederated ¶ added in v0.26.2
IsFederated determines if this message is federated
func (*Request) IsValidJSON ¶ added in v0.26.2
IsValidJSON validates the given JSON data against the schema
func (*Request) NetworkHops ¶ added in v0.26.2
NetworkHops returns a list of tuples this messaged traveled through
func (*Request) RecordNetworkHop ¶ added in v0.26.2
RecordNetworkHop appends a hop onto the list of those who processed this message
func (*Request) SetCallerID ¶ added in v0.26.2
SetCallerID sets the caller id for this request
func (*Request) SetCollective ¶ added in v0.26.2
SetCollective sets the collective this request is directed at
func (*Request) SetFederationReplyTo ¶ added in v0.26.2
SetFederationReplyTo stores the original reply-to destination in the federation headers
func (*Request) SetFederationRequestID ¶ added in v0.26.2
SetFederationRequestID sets the request ID for federation purposes
func (*Request) SetFederationTargets ¶ added in v0.26.2
SetFederationTargets sets the list of hosts this message should go to.
Federation brokers will duplicate the message and send one for each target
func (*Request) SetFilter ¶ added in v0.26.2
SetFilter sets and overwrites the filter for a message with a new one
func (*Request) SetMessage ¶ added in v0.26.2
SetMessage set the message body thats contained in this request. It should be JSON encoded text
func (*Request) SetRequestID ¶ added in v0.26.2
SetRequestID sets the request ID for this message
func (*Request) SetUnfederated ¶ added in v0.26.2
func (r *Request) SetUnfederated()
SetUnfederated removes any federation information from the message
func (*Request) SignerPublicData ¶ added in v0.27.0
SignerPublicData is not supported for version 1 messages and is always an empty string
func (*Request) Version ¶ added in v0.26.2
func (r *Request) Version() protocol.ProtocolVersion
Version retrieves the protocol version for this message
type RequestEnvelope ¶ added in v0.26.2
type RequestEnvelope struct { RequestID string `json:"requestid"` SenderID string `json:"senderid"` CallerID string `json:"callerid"` Collective string `json:"collective"` Agent string `json:"agent"` TTL int `json:"ttl"` Time int64 `json:"time"` Filter *protocol.Filter `json:"filter"` // contains filtered or unexported fields }
type SecureReply ¶ added in v0.26.2
type SecureReply struct { Protocol protocol.ProtocolVersion `json:"protocol"` MessageBody string `json:"message"` Hash string `json:"hash"` // contains filtered or unexported fields }
SecureReply contains 1 serialized Reply hashed
func (*SecureReply) IsValidJSON ¶ added in v0.26.2
func (r *SecureReply) IsValidJSON(data []byte) (err error)
IsValidJSON validates the given JSON data against the schema
func (*SecureReply) JSON ¶ added in v0.26.2
func (r *SecureReply) JSON() ([]byte, error)
JSON creates a JSON encoded reply
func (*SecureReply) Message ¶ added in v0.26.2
func (r *SecureReply) Message() []byte
Message retrieves the stored message content
func (*SecureReply) SetMessage ¶ added in v0.26.2
func (r *SecureReply) SetMessage(reply protocol.Reply) (err error)
SetMessage sets the message contained in the Reply and updates the hash
func (*SecureReply) Valid ¶ added in v0.26.2
func (r *SecureReply) Valid() bool
Valid validates the body of the message by comparing the recorded hash with the hash of the body
func (*SecureReply) Version ¶ added in v0.26.2
func (r *SecureReply) Version() protocol.ProtocolVersion
Version retrieves the protocol version for this message
type SecureRequest ¶ added in v0.26.2
type SecureRequest struct { Protocol protocol.ProtocolVersion `json:"protocol"` MessageBody string `json:"message"` Signature string `json:"signature"` PublicCertificate string `json:"pubcert"` // contains filtered or unexported fields }
SecureRequest contains 1 serialized Request signed and with the public cert attached
func (*SecureRequest) CallerPublicData ¶ added in v0.27.0
func (r *SecureRequest) CallerPublicData() string
func (*SecureRequest) IsValidJSON ¶ added in v0.26.2
func (r *SecureRequest) IsValidJSON(data []byte) (err error)
IsValidJSON validates the given JSON data against the schema
func (*SecureRequest) JSON ¶ added in v0.26.2
func (r *SecureRequest) JSON() ([]byte, error)
JSON creates a JSON encoded request
func (*SecureRequest) Message ¶ added in v0.26.2
func (r *SecureRequest) Message() []byte
Message retrieves the stored message. It will be a JSON encoded version of the request set via SetMessage
func (*SecureRequest) SetMessage ¶ added in v0.26.2
func (r *SecureRequest) SetMessage(request protocol.Request) (err error)
SetMessage sets the message contained in the Request and updates the signature
func (*SecureRequest) SetSigner ¶ added in v0.27.0
func (r *SecureRequest) SetSigner(_ []byte) error
func (*SecureRequest) Valid ¶ added in v0.26.2
func (r *SecureRequest) Valid() bool
Valid determines if the request is valid
func (*SecureRequest) Version ¶ added in v0.26.2
func (r *SecureRequest) Version() protocol.ProtocolVersion
Version retrieves the protocol version for this message
type TransportHeaders ¶ added in v0.26.2
type TransportHeaders struct { ReplyTo string `json:"reply-to,omitempty"` MCollectiveSender string `json:"mc_sender,omitempty"` SeenBy [][3]string `json:"seen-by,omitempty"` Federation *FederationTransportHeader `json:"federation,omitempty"` }
type TransportMessage ¶ added in v0.26.2
type TransportMessage struct { Protocol protocol.ProtocolVersion `json:"protocol"` Data []byte `json:"data"` Headers *TransportHeaders `json:"headers"` // contains filtered or unexported fields }
func (*TransportMessage) FederationReplyTo ¶ added in v0.26.2
func (m *TransportMessage) FederationReplyTo() (replyto string, federated bool)
FederationReplyTo retrieves the reply to string set by the federation broker
func (*TransportMessage) FederationRequestID ¶ added in v0.26.2
func (m *TransportMessage) FederationRequestID() (id string, federated bool)
FederationRequestID retrieves the federation specific requestid
func (*TransportMessage) FederationTargets ¶ added in v0.26.2
func (m *TransportMessage) FederationTargets() (targets []string, federated bool)
FederationTargets retrieves the list of targets this message is destined for
func (*TransportMessage) IsFederated ¶ added in v0.26.2
func (m *TransportMessage) IsFederated() bool
IsFederated determines if this message is federated
func (*TransportMessage) IsValidJSON ¶ added in v0.26.2
func (m *TransportMessage) IsValidJSON(data []byte) error
IsValidJSON validates the given JSON data against the Transport schema
func (*TransportMessage) JSON ¶ added in v0.26.2
func (m *TransportMessage) JSON() ([]byte, error)
JSON creates a JSON encoded message
func (*TransportMessage) Message ¶ added in v0.26.2
func (m *TransportMessage) Message() (data []byte, err error)
Message retrieves the stored data
func (*TransportMessage) NetworkHops ¶ added in v0.26.2
func (m *TransportMessage) NetworkHops() [][3]string
NetworkHops returns a list of tuples this messaged traveled through
func (*TransportMessage) RecordNetworkHop ¶ added in v0.26.2
func (m *TransportMessage) RecordNetworkHop(in string, processor string, out string)
RecordNetworkHop appends a hop onto the list of those who processed this message
func (*TransportMessage) ReplyTo ¶ added in v0.26.2
func (m *TransportMessage) ReplyTo() string
ReplyTo retrieves the destination description where replies should go to
func (*TransportMessage) SeenBy ¶ added in v0.26.2
func (m *TransportMessage) SeenBy() [][3]string
SeenBy retrieves the list of end points that this messages passed thruogh
func (*TransportMessage) SenderID ¶ added in v0.26.2
func (m *TransportMessage) SenderID() string
SenderID retrieves the identity of the sending host
func (*TransportMessage) SetFederationReplyTo ¶ added in v0.26.2
func (m *TransportMessage) SetFederationReplyTo(reply string)
SetFederationReplyTo stores the original reply-to destination in the federation headers
func (*TransportMessage) SetFederationRequestID ¶ added in v0.26.2
func (m *TransportMessage) SetFederationRequestID(id string)
SetFederationRequestID sets the request ID for federation purposes
func (*TransportMessage) SetFederationTargets ¶ added in v0.26.2
func (m *TransportMessage) SetFederationTargets(targets []string)
SetFederationTargets sets the list of hosts this message should go to.
Federation brokers will duplicate the message and send one for each target
func (*TransportMessage) SetReplyData ¶ added in v0.26.2
func (m *TransportMessage) SetReplyData(reply protocol.SecureReply) error
SetReplyData extracts the JSON body from a SecureReply and stores it
func (*TransportMessage) SetReplyTo ¶ added in v0.26.2
func (m *TransportMessage) SetReplyTo(reply string)
SetReplyTo sets the reply-to targget
func (*TransportMessage) SetRequestData ¶ added in v0.26.2
func (m *TransportMessage) SetRequestData(request protocol.SecureRequest) error
SetRequestData extracts the JSON body from a SecureRequest and stores it
func (*TransportMessage) SetSender ¶ added in v0.26.2
func (m *TransportMessage) SetSender(sender string)
SetSender sets the "mc_sender" - typically the identity of the sending host
func (*TransportMessage) SetUnfederated ¶ added in v0.26.2
func (m *TransportMessage) SetUnfederated()
SetUnfederated removes any federation information from the message
func (*TransportMessage) Version ¶ added in v0.26.2
func (m *TransportMessage) Version() protocol.ProtocolVersion
Version retrieves the protocol version for this message