Skip to content

Commit

Permalink
validate connector name when creating a connector through the API
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamHaffar committed Oct 17, 2023
1 parent 4be951a commit 03c9b3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/web/api/connector_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ func (c *ConnectorAPIv1) CreateConnector(
req.PipelineId,
fromproto.ConnectorConfig(req.Config),
)

if err != nil {
return nil, status.ConnectorError(cerrors.Errorf("failed to create connector: %w", err))
}
if created.Config.Name == "" {
return nil, status.ConnectorError(cerrors.Errorf("failed to create connector: name must not be empty"))
}

co := toproto.Connector(created)

Expand Down

0 comments on commit 03c9b3b

Please sign in to comment.