-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[pulsar-client] Add support to load tls certs/key dynamically from inputstream #6760
Conversation
7c929c6
to
13c1e2d
Compare
return privateKey; | ||
} | ||
|
||
//TODO: check if bufferReader should be closed or not |
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.
This could be removed?
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.
Yes, fixed it. actually user provided stream can be read multiple times by multiple connections so, pulsar-client needs a stream that can be marked and reset. So, I changed interface with ByteArrayInputStream
to support reading same provided stream multiple times.
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
…putstream (#6760) ### Motivation Right now, Pulsar-client provides tls authentication support and default TLS provider `AuthenticationTls` expects file path of cert and key files. However, there are usescases where it will be difficult for user-applications to store certs/key file locally for tls authentication. eg: 1. Applications running on docker or K8s containers will not have certs at defined location and app uses KMS or various key-vault system whose API return streams of certs. 2. Operationally hard to manage key rotation in containers 3. Need to avoid storing key/trust store files on file system for stronger security Therefore, it's good to have mechanism in default `AuthenticationTls` provider to read certs from memory/stream without storing certs on file-system. ### Modification Add Stream support in `AuthenticationTls` to provide X509Certs and PrivateKey which also performs auto-refresh when stream changes in a given provider. ``` AuthenticationTls auth = new AuthenticationTls(certStreamProvider, keyStreamProvider); ``` It will be also address: #5241 (cherry picked from commit 3b48df1)
…putstream (apache#6760) ### Motivation Right now, Pulsar-client provides tls authentication support and default TLS provider `AuthenticationTls` expects file path of cert and key files. However, there are usescases where it will be difficult for user-applications to store certs/key file locally for tls authentication. eg: 1. Applications running on docker or K8s containers will not have certs at defined location and app uses KMS or various key-vault system whose API return streams of certs. 2. Operationally hard to manage key rotation in containers 3. Need to avoid storing key/trust store files on file system for stronger security Therefore, it's good to have mechanism in default `AuthenticationTls` provider to read certs from memory/stream without storing certs on file-system. ### Modification Add Stream support in `AuthenticationTls` to provide X509Certs and PrivateKey which also performs auto-refresh when stream changes in a given provider. ``` AuthenticationTls auth = new AuthenticationTls(certStreamProvider, keyStreamProvider); ``` It will be also address: apache#5241
Motivation
Right now, Pulsar-client provides tls authentication support and default TLS provider
AuthenticationTls
expects file path of cert and key files. However, there are usescases where it will be difficult for user-applications to store certs/key file locally for tls authentication.eg:
Therefore, it's good to have mechanism in default
AuthenticationTls
provider to read certs from memory/stream without storing certs on file-system.Modification
Add Stream support in
AuthenticationTls
to provide X509Certs and PrivateKey which also performs auto-refresh when stream changes in a given provider.It will be also address: #5241