-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement HTTP target capability and connector handler #14491
implement HTTP target capability and connector handler #14491
Conversation
type WorkflowConfig struct { | ||
TimeoutMs uint32 `json:"timeoutMs,omitempty"` // Timeout in milliseconds | ||
RetryCount uint8 `json:"retryCount,omitempty"` // Number of retries, defaults to 0. | ||
Schedule string `json:"schedule,omitempty"` // schedule, defaults to empty. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description doesn't say what this is.
Also, nit: not sure if schedule is the most accurate name for this. More like a strategy/type/method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about DeliveryMode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that sounds good
} | ||
|
||
func NewCapability(config Config, registry core.CapabilitiesRegistry, connectorHandler *ConnectorHandler, lggr logger.Logger) (*Capability, error) { | ||
return &Capability{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: only fix if doing other fixes, but how about validating some of the fields? Says connectorHandler is nil?
return capabilities.CapabilityResponse{}, err | ||
} | ||
|
||
// TODO: check target response format and fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still a todo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep linked a JIRA ticket
|
||
func (c *Capability) RegisterToWorkflow(ctx context.Context, req capabilities.RegisterToWorkflowRequest) error { | ||
// Workflow engine guarantees registration requests are valid | ||
// TODO: handle retry configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: link to jira that will resolve the todo.
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
SingleNode
mode, which forwards HTTP calls via the first available gateway. This is done through a newSignAndSendToGateway()
method in the gateway connector that selects an available gateway and signs the request before sending it to the gatewaycapability.Execute()
JIRA: https://smartcontract-it.atlassian.net/browse/CM-469
Doc: https://docs.google.com/document/d/19PvTwosdwqNztwP6vcXSdt_s81xZXpjKU-5bpwhsd2M/edit#heading=h.4e7ng0tekbkc