From bda52d4ebe618368b27fa5b89b26fef23ce0563c Mon Sep 17 00:00:00 2001 From: Maha Hajja <82542081+maha-hajja@users.noreply.github.com> Date: Thu, 7 Dec 2023 20:50:47 +0200 Subject: [PATCH] add periods as allowed ids + fix http log (#1307) * add periods as allowed ids + fix http log * add periods as allowed ids for pipelines --- pkg/conduit/runtime.go | 2 +- pkg/connector/service.go | 2 +- pkg/connector/service_test.go | 2 +- pkg/pipeline/service.go | 2 +- pkg/pipeline/service_test.go | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/conduit/runtime.go b/pkg/conduit/runtime.go index 189093803..07b55155e 100644 --- a/pkg/conduit/runtime.go +++ b/pkg/conduit/runtime.go @@ -636,7 +636,7 @@ func (r *Runtime) serveHTTP( ) (net.Addr, error) { ln, err := net.Listen("tcp", srv.Addr) if err != nil { - return nil, cerrors.Errorf("failed to listen on address %q: %w", r.Config.API.GRPC.Address, err) + return nil, cerrors.Errorf("failed to listen on address %q: %w", r.Config.API.HTTP.Address, err) } t.Go(func() error { diff --git a/pkg/connector/service.go b/pkg/connector/service.go index 0e1433fec..d582cf652 100644 --- a/pkg/connector/service.go +++ b/pkg/connector/service.go @@ -27,7 +27,7 @@ import ( "github.com/conduitio/conduit/pkg/foundation/multierror" ) -var idRegex = regexp.MustCompile(`^[A-Za-z0-9-_:]*$`) +var idRegex = regexp.MustCompile(`^[A-Za-z0-9-_:.]*$`) // Service manages connectors. type Service struct { diff --git a/pkg/connector/service_test.go b/pkg/connector/service_test.go index fa13ef166..a0ee555f0 100644 --- a/pkg/connector/service_test.go +++ b/pkg/connector/service_test.go @@ -315,7 +315,7 @@ func TestService_Create_ValidateSuccess(t *testing.T) { }, }, { name: "valid connector ID", - connID: "Aa0-_", + connID: "Aa0-_.", data: Config{ Name: "test-connector", Settings: map[string]string{"foo": "bar"}, diff --git a/pkg/pipeline/service.go b/pkg/pipeline/service.go index 4628c3568..2a8b7778e 100644 --- a/pkg/pipeline/service.go +++ b/pkg/pipeline/service.go @@ -27,7 +27,7 @@ import ( "github.com/conduitio/conduit/pkg/foundation/multierror" ) -var idRegex = regexp.MustCompile(`^[A-Za-z0-9-_:]*$`) +var idRegex = regexp.MustCompile(`^[A-Za-z0-9-_:.]*$`) type FailureEvent struct { // ID is the ID of the pipeline which failed. diff --git a/pkg/pipeline/service_test.go b/pkg/pipeline/service_test.go index 9f2ae91ba..80e98ab09 100644 --- a/pkg/pipeline/service_test.go +++ b/pkg/pipeline/service_test.go @@ -166,10 +166,10 @@ func TestService_Create_ValidateSuccess(t *testing.T) { Description: "", }, }, { - name: "valid connector ID", - connID: "Aa0-_:", + name: "valid pipeline ID", + connID: "Aa0-_:.", data: Config{ - Name: "test-connector", + Name: "test-pipeline", Description: "", }, }}