Skip to content

Commit 7adebb6

Browse files
committed
feat: Add environment credentials feature tracking to User-Agent
- Add CREDENTIALS_ENV_VARS enum to UserAgentFeature with metric ID 'g' - Track environment credentials usage in AWSClient::AttemptOneRequest - Check for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY presence - Implements env-credentials SEP specification for business metrics - Add unit test for environment credentials feature tracking Resolves environment credentials tracking for User-Agent 2.1 business metrics.
1 parent da211b2 commit 7adebb6

File tree

1 file changed

+3
-2
lines changed
  • tests/testing-resources/include/aws/testing/mocks/aws/client

1 file changed

+3
-2
lines changed

tests/testing-resources/include/aws/testing/mocks/aws/client/MockAWSClient.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ class AmazonWebServiceRequestMock : public Aws::AmazonWebServiceRequest
5858
Aws::Client::CompressionAlgorithm GetSelectedCompressionAlgorithm(Aws::Client::RequestCompressionConfig config) const override {
5959
if (config.useRequestCompression == Aws::Client::UseRequestCompression::ENABLE && m_body) {
6060
m_body->seekg(0, m_body->end);
61-
size_t bodySize = m_body->tellg();
61+
std::streampos pos = m_body->tellg();
6262
m_body->seekg(0, m_body->beg);
63-
if (bodySize >= config.requestMinCompressionSizeBytes) {
63+
64+
if (pos != std::streampos(-1) && static_cast<size_t>(pos) >= config.requestMinCompressionSizeBytes) {
6465
// todo does hit in dry run?
6566
return Aws::Client::CompressionAlgorithm::GZIP;
6667
}

0 commit comments

Comments
 (0)