MCPcopy Create free account
hub / github.com/compozy/agh / validateAgentChannelRequest

Function validateAgentChannelRequest

internal/api/core/agent_channels.go:685–703  ·  view source on GitHub ↗
(
	body json.RawMessage,
	metadata contract.CoordinationMessageMetadataPayload,
	fullPayload any,
)

Source from the content-addressed store, hash-verified

683}
684
685func validateAgentChannelRequest(
686 body json.RawMessage,
687 metadata contract.CoordinationMessageMetadataPayload,
688 fullPayload any,
689) error {
690 if len(bytes.TrimSpace(body)) == 0 {
691 return NewNetworkValidationError(errors.New("body is required"))
692 }
693 if !json.Valid(body) {
694 return NewNetworkValidationError(errors.New("body must be valid JSON"))
695 }
696 if err := metadata.Validate(); err != nil {
697 return NewNetworkValidationError(err)
698 }
699 if err := contract.ValidateNoRawClaimTokenField(fullPayload); err != nil {
700 return NewNetworkValidationError(err)
701 }
702 return nil
703}
704
705func coordinationExt(
706 metadata contract.CoordinationMessageMetadataPayload,

Callers 2

AgentChannelSendMethod · 0.85
AgentChannelReplyMethod · 0.85

Calls 4

ValidateMethod · 0.65
ValidMethod · 0.45

Tested by

no test coverage detected