-
Notifications
You must be signed in to change notification settings - Fork 420
add auth config base dependency #2295
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
Adds a pluggable credential provider and security-token support for SLS HTTP requests.
- Introduces
CredentialsProvider
interface andStaticCredentialsProvider
, wired intoSLSClientManager
- Extends
GetAccessKey
signature and propagatessecToken
through all prepare/post methods, adding theX_ACS_SECURITY_TOKEN
header - Updates constants, client manager init logic, and unit tests to cover the new flows
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
core/plugin/flusher/sls/CredentialsProvider.h | New credential interface and static implementation |
core/plugin/flusher/sls/SLSConstant.{h,cpp} | Declare and define X_ACS_SECURITY_TOKEN constant |
core/plugin/flusher/sls/SLSClientManager.{h,cpp} | Wire in the provider, update GetAccessKey , initialize default provider |
core/plugin/flusher/sls/FlusherSLS.{h,cpp} | Propagate secToken through CreatePost*Request methods |
core/plugin/flusher/sls/DiskBufferWriter.cpp | Add secToken argument to GetAccessKey call and Post* methods |
core/unittest/flusher/SLSClientManagerUnittest.cpp | Update test to call the new GetAccessKey signature |
core/unittest/flusher/FlusherSLSUnittest.cpp | Switch to StaticCredentialsProvider and updated SetCredentialsProvider |
Comments suppressed due to low confidence (1)
core/unittest/flusher/FlusherSLSUnittest.cpp:858
- Consider adding an assertion after building the request to verify that
X_ACS_SECURITY_TOKEN
is correctly set in the request headers whensecToken
is non-empty.
EnterpriseSLSClientManager::GetInstance()->SetCredentialsProvider("1234567890", std::move(provider));
header[X_LOG_KEYPROVIDER] = MD5_SHA1_SALT_KEYPROVIDER; | ||
} | ||
if (!secToken.empty()) { |
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.
enum class AuthType { ANONYMOUS, AK, STS };
非空就赋值并不是太合理,跟authtype的取值要有一致性。
191-196要总体考虑下这三种取值的关系。
if (BOOST_LIKELY(mCredentialsProvider != nullptr)) { | ||
return mCredentialsProvider->GetCredentials(type, accessKeyId, accessKeySecret, secToken); | ||
} else { | ||
accessKeyId = STRING_FLAG(default_access_key_id); |
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.
xx
No description provided.