From 6d982b3a88e76f88680b450fd70879ed9599d3aa Mon Sep 17 00:00:00 2001 From: Ross Golder Date: Fri, 17 Nov 2023 04:10:11 +0700 Subject: [PATCH] feature: Add 'caCertificate' parameter to Minio EventSource (#2903) Signed-off-by: Ross Golder --- api/jsonschema/schema.json | 3 + api/openapi-spec/swagger.json | 3 + eventsources/sources/minio/start.go | 36 +++- pkg/apis/common/deepcopy_generated.go | 5 + pkg/apis/common/generated.pb.go | 230 ++++++++++++++++---------- pkg/apis/common/generated.proto | 2 + pkg/apis/common/openapi_generated.go | 5 + pkg/apis/common/s3.go | 2 + 8 files changed, 194 insertions(+), 92 deletions(-) diff --git a/api/jsonschema/schema.json b/api/jsonschema/schema.json index b6ed8bfb59..64dd8c7033 100644 --- a/api/jsonschema/schema.json +++ b/api/jsonschema/schema.json @@ -111,6 +111,9 @@ "bucket": { "$ref": "#/definitions/io.argoproj.common.S3Bucket" }, + "caCertificate": { + "$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector" + }, "endpoint": { "type": "string" }, diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 9db92002af..78b74abcda 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -119,6 +119,9 @@ "bucket": { "$ref": "#/definitions/io.argoproj.common.S3Bucket" }, + "caCertificate": { + "$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector" + }, "endpoint": { "type": "string" }, diff --git a/eventsources/sources/minio/start.go b/eventsources/sources/minio/start.go index 78b93d6b63..0ae150a16d 100644 --- a/eventsources/sources/minio/start.go +++ b/eventsources/sources/minio/start.go @@ -18,8 +18,11 @@ package minio import ( "context" + "crypto/tls" + "crypto/x509" "encoding/json" "fmt" + "net/http" "time" "github.com/minio/minio-go/v7" @@ -80,10 +83,35 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt return fmt.Errorf("failed to retrieve the secret key for event source %s, %w", el.GetEventName(), err) } - log.Info("setting up a minio client...") - minioClient, err := minio.New(minioEventSource.Endpoint, &minio.Options{ - Creds: credentials.NewStaticV4(accessKey, secretKey, ""), Secure: !minioEventSource.Insecure}) - if err != nil { + var minioClient *minio.Client + var clientErr error + if minioEventSource.CACertificate != nil { + log.Info("retrieving CA certificate...") + caCertificate, err := common.GetSecretFromVolume(minioEventSource.CACertificate) + if err != nil { + return fmt.Errorf("failed to get the CA certificate for event source %s, %w", el.GetEventName(), err) + } + caCertPool := x509.NewCertPool() + caCertPool.AppendCertsFromPEM([]byte(caCertificate)) + tlsConfig := &tls.Config{ + RootCAs: caCertPool, + } + log.Info("setting up a minio client with custom CA...") + minioClient, clientErr = minio.New(minioEventSource.Endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), + Secure: !minioEventSource.Insecure, + Transport: &http.Transport{ + TLSClientConfig: tlsConfig, + }, + }) + } else { + log.Info("setting up a minio client...") + minioClient, clientErr = minio.New(minioEventSource.Endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(accessKey, secretKey, ""), + Secure: !minioEventSource.Insecure, + }) + } + if clientErr != nil { return fmt.Errorf("failed to create a client for event source %s, %w", el.GetEventName(), err) } diff --git a/pkg/apis/common/deepcopy_generated.go b/pkg/apis/common/deepcopy_generated.go index cb3f4fb649..e243a97cb3 100644 --- a/pkg/apis/common/deepcopy_generated.go +++ b/pkg/apis/common/deepcopy_generated.go @@ -222,6 +222,11 @@ func (in *S3Artifact) DeepCopyInto(out *S3Artifact) { (*out)[key] = val } } + if in.CACertificate != nil { + in, out := &in.CACertificate, &out.CACertificate + *out = new(v1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } return } diff --git a/pkg/apis/common/generated.pb.go b/pkg/apis/common/generated.pb.go index dd48a9435d..fce2283ea2 100644 --- a/pkg/apis/common/generated.pb.go +++ b/pkg/apis/common/generated.pb.go @@ -519,96 +519,97 @@ func init() { } var fileDescriptor_02aae6165a434fa7 = []byte{ - // 1411 bytes of a gzipped FileDescriptorProto + // 1434 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcb, 0x6e, 0xdb, 0x46, - 0x17, 0x80, 0x4d, 0xcb, 0x96, 0xc5, 0xe3, 0xeb, 0x3f, 0xf1, 0x42, 0x30, 0x10, 0xc9, 0xe0, 0x8f, - 0xff, 0x87, 0xd3, 0x26, 0x14, 0x72, 0x41, 0x9b, 0xa4, 0x40, 0x5a, 0xd3, 0x71, 0x50, 0x27, 0x76, - 0x13, 0x0c, 0x63, 0x2f, 0x92, 0x16, 0xc5, 0x98, 0x1a, 0xc9, 0x8c, 0x44, 0x52, 0x18, 0x0e, 0x9d, - 0x68, 0xd7, 0xa2, 0x0f, 0xd0, 0xbe, 0x41, 0x9f, 0xa0, 0x0f, 0xd1, 0x5d, 0x96, 0x41, 0x37, 0xc9, + 0x17, 0x80, 0x4d, 0xcb, 0x96, 0xc5, 0xe3, 0x6b, 0x26, 0x5e, 0x08, 0x02, 0x22, 0x19, 0xfc, 0xf1, + 0x17, 0x4e, 0x9b, 0x50, 0xc8, 0x05, 0x6d, 0x92, 0x02, 0x69, 0x45, 0xc7, 0x41, 0x9d, 0xd8, 0x4d, + 0x30, 0x8c, 0xbd, 0x48, 0x7a, 0xc1, 0x98, 0x1a, 0x49, 0x8c, 0x44, 0x52, 0x20, 0x87, 0x4e, 0xb4, + 0x6b, 0xd1, 0x07, 0x68, 0xdf, 0xa0, 0x4f, 0x50, 0xa0, 0xaf, 0xd0, 0x5d, 0x96, 0x41, 0x37, 0xc9, 0x4a, 0x68, 0xd8, 0x87, 0x68, 0x91, 0x55, 0x31, 0x17, 0x52, 0x94, 0xe2, 0xa2, 0xa5, 0xd1, 0x1d, - 0x79, 0xe6, 0x9c, 0xef, 0xcc, 0x9c, 0xcb, 0x9c, 0x81, 0x4f, 0xbb, 0x3e, 0x3f, 0x49, 0x8e, 0x6d, - 0x2f, 0x0a, 0x5a, 0x84, 0x75, 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0x77, 0x02, 0xbf, 0xed, 0x8a, 0xe4, + 0x5c, 0x81, 0x05, 0x36, 0x1a, 0xca, 0xbd, 0xea, 0xd6, 0x05, 0x75, 0xc2, 0x85, 0x47, 0xa3, 0x21, + 0x7d, 0x3b, 0x6e, 0xac, 0x66, 0x8a, 0x5c, 0x80, 0x85, 0x2a, 0xda, 0x87, 0x72, 0xc4, 0x08, 0x8b, + 0x23, 0xb1, 0x1f, 0xdd, 0xba, 0xae, 0x8c, 0xca, 0xb6, 0x90, 0xbe, 0x1d, 0x37, 0x4e, 0x29, 0x76, + 0x33, 0x23, 0x49, 0x2d, 0xac, 0x18, 0xe8, 0x04, 0xd0, 0x80, 0x44, 0xec, 0x51, 0x48, 0xfc, 0x48, + 0x7a, 0x72, 0x3d, 0xaa, 0x92, 0xf9, 0x7e, 0xee, 0xa4, 0x59, 0x47, 0x4c, 0x12, 0xc8, 0x3b, 0x82, + 0x9f, 0x9d, 0x5b, 0x58, 0x35, 0xb5, 0x0b, 0xb4, 0xff, 0x0e, 0x0d, 0x9f, 0xe2, 0x01, 0xbd, 0x07, + 0xe5, 0x90, 0x92, 0x28, 0xf0, 0x45, 0x72, 0x75, 0x6b, 0x2d, 0x3d, 0x05, 0x16, 0x52, 0xac, 0x56, + 0xd1, 0x45, 0x58, 0xf2, 0x68, 0x14, 0x91, 0x2e, 0xad, 0x2e, 0x0a, 0xc5, 0x75, 0xa5, 0xb8, 0x74, + 0x20, 0xc5, 0x38, 0x5d, 0x37, 0xbe, 0xd7, 0x60, 0x75, 0xaa, 0x25, 0xd0, 0x76, 0x2e, 0xba, 0x25, + 0x6b, 0x73, 0x26, 0xba, 0x0b, 0xb9, 0xa0, 0x5e, 0x82, 0x8a, 0xcb, 0x4d, 0x8f, 0xc8, 0x40, 0x84, + 0xb5, 0x64, 0x6d, 0x28, 0xed, 0xca, 0x9e, 0x92, 0xe3, 0x4c, 0x83, 0x6f, 0x3e, 0x62, 0x21, 0xd7, + 0x2d, 0x4d, 0x6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, 0xd2, 0xa6, 0x61, 0x56, 0x4c, 0xda, 0xdf, + 0x15, 0x13, 0xf2, 0x40, 0x17, 0x65, 0x7a, 0x37, 0x0c, 0x3c, 0x95, 0xaf, 0x4f, 0x0b, 0xef, 0xea, + 0x28, 0x25, 0xd8, 0xe2, 0x0a, 0x91, 0x13, 0x2a, 0x13, 0xe2, 0x89, 0x07, 0xe3, 0x39, 0xa8, 0x87, + 0x17, 0xf2, 0x01, 0x9c, 0xf4, 0x95, 0x95, 0x5e, 0xef, 0xc5, 0xe3, 0x91, 0x3d, 0xd4, 0x2c, 0xa4, + 0x0e, 0x07, 0x99, 0x28, 0xc2, 0x39, 0x0f, 0xc6, 0x77, 0x25, 0xd0, 0x1f, 0xed, 0xdb, 0x2a, 0xa9, + 0x4f, 0x60, 0x45, 0xb6, 0xb7, 0x2a, 0xa7, 0x42, 0xaf, 0xdf, 0x8d, 0x64, 0xdc, 0x58, 0x91, 0xc3, + 0x42, 0x15, 0xd3, 0x14, 0x0c, 0x75, 0x61, 0xc3, 0x19, 0xb8, 0xd4, 0x67, 0x39, 0x07, 0x85, 0x5a, + 0x61, 0x33, 0x19, 0x37, 0x36, 0x76, 0x66, 0x10, 0xf8, 0x1d, 0x28, 0x6a, 0xc3, 0xba, 0x94, 0x09, + 0xe3, 0xe2, 0x7d, 0x71, 0x3e, 0x19, 0x37, 0xd6, 0x77, 0xa6, 0x09, 0x78, 0x16, 0x89, 0xee, 0x01, + 0x4a, 0x6f, 0x42, 0xbb, 0xef, 0x0e, 0x8f, 0x68, 0xe8, 0x76, 0x46, 0xea, 0xd6, 0xcc, 0x1e, 0xb2, + 0x7b, 0xef, 0x68, 0xe0, 0x53, 0xac, 0x8c, 0x57, 0x1a, 0xac, 0xcf, 0x54, 0x0b, 0xcf, 0x45, 0x76, + 0x85, 0x61, 0xda, 0x39, 0x43, 0x2e, 0xec, 0x9c, 0x39, 0x9e, 0x82, 0xa1, 0x2e, 0xac, 0x3b, 0x22, + 0xe5, 0x07, 0x64, 0xa8, 0xf8, 0x32, 0x15, 0xdb, 0xa7, 0xf1, 0x77, 0x72, 0xaa, 0x33, 0x51, 0x9a, + 0x86, 0xe0, 0x59, 0xaa, 0x75, 0xe9, 0xc5, 0x9b, 0xfa, 0xdc, 0xcb, 0x37, 0xf5, 0xb9, 0xd7, 0x6f, + 0xea, 0x73, 0xdf, 0x24, 0x75, 0xed, 0x45, 0x52, 0xd7, 0x5e, 0x26, 0x75, 0xed, 0x75, 0x52, 0xd7, + 0x7e, 0x4b, 0xea, 0xda, 0x0f, 0xbf, 0xd7, 0xe7, 0x1e, 0x97, 0x65, 0xdd, 0xfe, 0x15, 0x00, 0x00, + 0xff, 0xff, 0xce, 0x9f, 0x3a, 0x1a, 0x03, 0x10, 0x00, 0x00, } func (m *Amount) Marshal() (dAtA []byte, err error) { @@ -958,6 +959,18 @@ func (m *S3Artifact) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CACertificate != nil { + { + size, err := m.CACertificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } if len(m.Metadata) > 0 { keysForMetadata := make([]string, 0, len(m.Metadata)) for k := range m.Metadata { @@ -1584,6 +1597,10 @@ func (m *S3Artifact) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if m.CACertificate != nil { + l = m.CACertificate.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -1846,6 +1863,7 @@ func (this *S3Artifact) String() string { `Events:` + fmt.Sprintf("%v", this.Events) + `,`, `Filter:` + strings.Replace(this.Filter.String(), "S3Filter", "S3Filter", 1) + `,`, `Metadata:` + mapStringForMetadata + `,`, + `CACertificate:` + strings.Replace(fmt.Sprintf("%v", this.CACertificate), "SecretKeySelector", "v1.SecretKeySelector", 1) + `,`, `}`, }, "") return s @@ -3472,6 +3490,42 @@ func (m *S3Artifact) Unmarshal(dAtA []byte) error { } m.Metadata[mapkey] = mapvalue iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CACertificate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CACertificate == nil { + m.CACertificate = &v1.SecretKeySelector{} + } + if err := m.CACertificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/pkg/apis/common/generated.proto b/pkg/apis/common/generated.proto index a99e70276f..fc92a60066 100644 --- a/pkg/apis/common/generated.proto +++ b/pkg/apis/common/generated.proto @@ -122,6 +122,8 @@ message S3Artifact { optional S3Filter filter = 8; map metadata = 9; + + optional k8s.io.api.core.v1.SecretKeySelector caCertificate = 10; } // S3Bucket contains information to describe an S3 Bucket diff --git a/pkg/apis/common/openapi_generated.go b/pkg/apis/common/openapi_generated.go index e97aa53689..51e53d9bba 100644 --- a/pkg/apis/common/openapi_generated.go +++ b/pkg/apis/common/openapi_generated.go @@ -322,6 +322,11 @@ func schema_argo_events_pkg_apis_common_S3Artifact(ref common.ReferenceCallback) }, }, }, + "caCertificate": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, }, Required: []string{"endpoint", "bucket", "accessKey", "secretKey"}, }, diff --git a/pkg/apis/common/s3.go b/pkg/apis/common/s3.go index 4199ccdcf2..8af4726a54 100644 --- a/pkg/apis/common/s3.go +++ b/pkg/apis/common/s3.go @@ -32,6 +32,8 @@ type S3Artifact struct { Events []string `json:"events,omitempty" protobuf:"bytes,7,rep,name=events"` Filter *S3Filter `json:"filter,omitempty" protobuf:"bytes,8,opt,name=filter"` Metadata map[string]string `json:"metadata,omitempty" protobuf:"bytes,9,opt,name=metadata"` + + CACertificate *corev1.SecretKeySelector `json:"caCertificate,omitempty" protobuf:"bytes,10,opt,name=caCertificate"` } // S3Bucket contains information to describe an S3 Bucket