Skip to content

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

wangkaibo34
Copy link

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jul 7, 2025

CLA assistant check
All committers have signed the CLA.

@yyuuttaaoo yyuuttaaoo requested a review from Copilot July 10, 2025 06:36
Copy link
Contributor

@Copilot Copilot AI left a 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 and StaticCredentialsProvider, wired into SLSClientManager
  • Extends GetAccessKey signature and propagates secToken through all prepare/post methods, adding the X_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 when secToken is non-empty.
    EnterpriseSLSClientManager::GetInstance()->SetCredentialsProvider("1234567890", std::move(provider));

@wangkaibo34 wangkaibo34 requested a review from yyuuttaaoo July 14, 2025 05:57
header[X_LOG_KEYPROVIDER] = MD5_SHA1_SALT_KEYPROVIDER;
}
if (!secToken.empty()) {
Copy link
Collaborator

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants