Skip to content

Commit a506176

Browse files
Feature/tlsauth (#301)
1 parent 40abfa1 commit a506176

File tree

7 files changed

+371
-24
lines changed

7 files changed

+371
-24
lines changed

api/v1alpha1/common.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ type PulsarAuthentication struct {
5555
// For detailed information on the OAuth2 fields, refer to the PulsarAuthenticationOAuth2 struct.
5656
// +optional
5757
OAuth2 *PulsarAuthenticationOAuth2 `json:"oauth2,omitempty"`
58+
59+
// +optional
60+
TLS *PulsarAuthenticationTLS `json:"tls,omitempty"`
5861
}
5962

6063
// PulsarResourceLifeCyclePolicy defines the behavior for managing Pulsar resources
@@ -107,6 +110,12 @@ type PulsarAuthenticationOAuth2 struct {
107110
Scope string `json:"scope,omitempty"`
108111
}
109112

113+
// PulsarAuthenticationTLS indicates the parameters which are need by pulsar TLS Authentication
114+
type PulsarAuthenticationTLS struct {
115+
ClientCertificatePath string `json:"clientCertificatePath"`
116+
ClientCertificateKeyPath string `json:"clientCertificateKeyPath"`
117+
}
118+
110119
// IsPulsarResourceReady returns true if resource satisfies with these condition
111120
// 1. The instance is not deleted
112121
// 2. Status ObservedGeneration is equal with meta.ObservedGeneration

api/v1alpha1/pulsarconnection_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ type PulsarConnectionSpec struct {
7474
// When setting up Geo-Replication between Pulsar instances, this should be enabled to identify the cluster.
7575
// +optional
7676
ClusterName string `json:"clusterName,omitempty"`
77+
78+
// TLSEnableHostnameVerification indicates whether to verify the hostname of the broker.
79+
// Only used when using secure urls.
80+
// +optional
81+
TLSEnableHostnameVerification bool `json:"tlsEnableHostnameVerification,omitempty"`
82+
83+
// TLSAllowInsecureConnection indicates whether to allow insecure connection to the broker.
84+
// +optional
85+
TLSAllowInsecureConnection bool `json:"tlsAllowInsecureConnection,omitempty"`
86+
87+
// TLSTrustCertsFilePath Path for the TLS certificate used to validate the broker endpoint when using TLS.
88+
// +optional
89+
TLSTrustCertsFilePath string `json:"tlsTrustCertsFilePath,omitempty"`
7790
}
7891

7992
// PulsarConnectionStatus defines the observed state of PulsarConnection.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/resource.streamnative.io_pulsarconnections.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ spec:
169169
- issuerEndpoint
170170
- key
171171
type: object
172+
tls:
173+
description: PulsarAuthenticationTLS indicates the parameters
174+
which are need by pulsar TLS Authentication
175+
properties:
176+
clientCertificateKeyPath:
177+
type: string
178+
clientCertificatePath:
179+
type: string
180+
required:
181+
- clientCertificateKeyPath
182+
- clientCertificatePath
183+
type: object
172184
token:
173185
description: |-
174186
Token specifies the configuration for token-based authentication.
@@ -212,6 +224,16 @@ spec:
212224
ClusterName specifies the name of the local Pulsar cluster.
213225
When setting up Geo-Replication between Pulsar instances, this should be enabled to identify the cluster.
214226
type: string
227+
tlsEnableHostnameVerification:
228+
description: TLSEnableHostnameVerification indicates whether to verify the hostname of the broker.
229+
Only used when using secure urls.
230+
type: boolean
231+
tlsAllowInsecureConnection:
232+
description: TLSAllowInsecureConnection indicates whether to allow insecure connection to the broker.
233+
type: boolean
234+
tlsTrustCertsFilePath:
235+
description: TLSTrustCertsFilePath Path for the TLS certificate used to validate the broker endpoint when using TLS.
236+
type: string
215237
type: object
216238
status:
217239
description: |-

0 commit comments

Comments
 (0)