High level design PR: Add SDS dynamic secret#3748
High level design PR: Add SDS dynamic secret#3748qiwzhang wants to merge 1 commit intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Wayne Zhang <qiwzhang@google.com>
|
@lizan @PiotrSikora Could you help to review it? |
| /** | ||
| * An interface to fetch dynamic secret. | ||
| */ | ||
| class DynamicSecretProvider { |
There was a problem hiding this comment.
I'm curious why we need this and createDynamicSecretProvider, but not make SecretManager to manage callbacks.
There was a problem hiding this comment.
Managing update callbacks by DynamicSecretProvider is more efficient since it only holds the callbacks that using that secret. If done in the secretManager, you need a map of hash + name to the vector of callbacks, you need map lookup. Beside, DynamicSecretProvider is implemented by SdsAPI. It has the onConfigUpate() call, so it is more nature to call its callbacks when onConfigUpdate() is called. It doesn't need to hold secretManager object either.
|
|
||
| class SecretManagerUtil { | ||
| public: | ||
| virtual ~SecretManagerUtil() {} |
| * @return a hash string of normalized config source. | ||
| */ | ||
| virtual DynamicSecretProviderSharedPtr | ||
| createDynamicSecretProvider(const envoy::api::v2::core::ConfigSource& config_source, |
There was a problem hiding this comment.
from impl, this is not a pure create, but find one if there is existing, need a better name.
There was a problem hiding this comment.
how about "findOrCreateDynamicSecretProvider"?
|
|
||
| class ClientContext : public virtual Context {}; | ||
| typedef std::unique_ptr<ClientContext> ClientContextPtr; | ||
| typedef std::shared_ptr<ClientContext> ClientContextSharedPtr; |
There was a problem hiding this comment.
Do we intended to make all *Context to SharedPtr? What is the usecase of unique_ptrs?
There was a problem hiding this comment.
unique_ptr can be removed.
There was a problem hiding this comment.
Actually, I am working on a separate PR of making ssl_socket not to hold context as its member, only use ctx at constructor. If this works, we will continue to use unique_ptr for ctx.
| std::vector<std::string> getDnsSansFromCertificate(X509* cert); | ||
|
|
||
| Network::TransportSocketCallbacks* callbacks_{}; | ||
| ContextSharedPtr ctx_owner_; |
There was a problem hiding this comment.
you should be able to have this as std::shared_ptr<ContextImpl> and cast it with std::dynamic_pointer_cast
There was a problem hiding this comment.
As I mentioned above, I try to remove this member variable ctx_ in a separate PR
|
This includes all changes in #3700 right? While we can review this on high level, but please address review/test on that first. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
#3700 is under review, and we are updating this PR accordingly. Please keep this PR open. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Wayne Zhang qiwzhang@google.com
This PR is not a real PR, it is a high level design proposal to support fetching dynamic secrets.
Main changes:
Code Status:
Passed compiling for files under /source/....