Merge pull request #61362 from ClickHouse/revert-61359-revert-61234-Avogar-patch-2

Revert "Revert "Fix usage of session_token in S3 engine""
This commit is contained in:
Kruglov Pavel 2024-03-15 16:00:05 +01:00 committed by GitHub
commit d045ab150e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 10 deletions

View File

@ -121,7 +121,8 @@ void KeeperSnapshotManagerS3::updateS3Configuration(const Poco::Util::AbstractCo
auth_settings.use_insecure_imds_request.value_or(false),
auth_settings.expiration_window_seconds.value_or(S3::DEFAULT_EXPIRATION_WINDOW_SECONDS),
auth_settings.no_sign_request.value_or(false),
});
},
credentials.GetSessionToken());
auto new_client = std::make_shared<KeeperSnapshotManagerS3::S3Configuration>(std::move(new_uri), std::move(auth_settings), std::move(client));

View File

@ -1451,7 +1451,8 @@ void StorageS3::Configuration::connect(const ContextPtr & context)
auth_settings.expiration_window_seconds.value_or(
context->getConfigRef().getUInt64("s3.expiration_window_seconds", S3::DEFAULT_EXPIRATION_WINDOW_SECONDS)),
auth_settings.no_sign_request.value_or(context->getConfigRef().getBool("s3.no_sign_request", false)),
});
},
credentials.GetSessionToken());
}
void StorageS3::processNamedCollectionResult(StorageS3::Configuration & configuration, const NamedCollection & collection)

View File

@ -1414,10 +1414,10 @@ def test_signatures(started_cluster):
)
assert int(result) == 1
result = instance.query(
error = instance.query_and_get_error(
f"select * from s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test.arrow', 'minio', 'minio123', '{session_token}')"
)
assert int(result) == 1
assert "S3_ERROR" in error
result = instance.query(
f"select * from s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test.arrow', 'Arrow', 'x UInt64', 'auto')"
@ -1429,20 +1429,20 @@ def test_signatures(started_cluster):
)
assert int(result) == 1
result = instance.query(
error = instance.query_and_get_error(
f"select * from s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test.arrow', 'minio', 'minio123', '{session_token}', 'Arrow')"
)
assert int(result) == 1
assert "S3_ERROR" in error
lt = instance.query(
error = instance.query_and_get_error(
f"select * from s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test.arrow', 'minio', 'minio123', '{session_token}', 'Arrow', 'x UInt64')"
)
assert int(result) == 1
assert "S3_ERROR" in error
lt = instance.query(
error = instance.query_and_get_error(
f"select * from s3('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test.arrow', 'minio', 'minio123', '{session_token}', 'Arrow', 'x UInt64', 'auto')"
)
assert int(result) == 1
assert "S3_ERROR" in error
def test_select_columns(started_cluster):