aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/cloud/s3client.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add EC2 IMDS credential provider for S3ClientStefan Boberg3 days1-6/+32
| | | | | | | | | | | | | | | | | Add ImdsCredentialProvider that fetches and caches temporary AWS credentials from the EC2 Instance Metadata Service (IMDSv2), enabling S3Client to work on EC2 instances without static credentials. - New ImdsCredentialProvider class (RefCounted) with RwLock-based double-checked caching and 5-minute pre-expiration refresh - S3ClientOptions gains optional CredentialProvider field; when set, SignRequest/GeneratePresignedUrl use dynamic credentials and invalidate the signing key cache on access key rotation - Move CloudProvider enum and MockImdsService from zencompute to zenutil for reuse; extend mock with IAM credential endpoints - Add --imds flag to zens3-testbed for EC2 credential testing - Integration tests using mock IMDS server verify fetch, caching, invalidation, and unreachable endpoint graceful failure
* Refactor S3Client to return payloads in per-method result typesStefan Boberg3 days1-73/+60
| | | | | | | | | | - Add typed result structs (S3GetObjectResult, S3HeadObjectResult, S3ListObjectsResult, S3CreateMultipartUploadResult, S3UploadPartResult) that inherit from S3Result and carry method-specific fields - Remove out-parameters from GetObject, HeadObject, ListObjects, CreateMultipartUpload, and UploadPart - Add S3GetObjectResult::AsText() for convenient string_view access - Update internal caller PutObjectMultipart and all tests/testbed code
* Add MinioProcess test helper and S3Client integration testsStefan Boberg3 days1-0/+199
| | | | | | | | | | - Extend CreateProcOptions with per-process environment variables (Windows: Unicode env block via GetEnvironmentStringsW, Unix: setenv in child) - Add MinioProcess helper class following the ConsulProcess pattern - Add MinIO xmake package and copy-to-target-dir build step - Add S3Client integration tests against local MinIO: PUT/GET/DELETE/HEAD, ListObjects, multipart upload, and pre-signed URLs - Wire up s3client and sigv4 forcelinks so their suites run in zenutil-test
* Add path-style addressing support to S3Client for MinIO compatibilityStefan Boberg3 days1-6/+40
| | | | | | | S3-compatible services like MinIO require path-style addressing (endpoint/bucket/key) instead of virtual-hosted style (bucket.endpoint/key). This adds a PathStyle option that adjusts endpoint construction, host headers, and request paths accordingly.
* Replace bool+OutError pattern with S3Result return typeStefan Boberg4 days1-87/+82
| | | | | | | Introduce S3Result struct (Error string, IsSuccess(), operator bool()) as a common result type for all S3Client operations, replacing the bool return + std::optional<std::string>& OutError parameter pattern. Data out-parameters are preserved; only the error signalling changes.
* Improve S3Client thread safety, code clarity, and reduce repetitionStefan Boberg4 days1-55/+84
| | | | | | | | Use RwLock instead of std::mutex for signing key cache to allow concurrent reads on the hot path. Factor out KeyToPath and BuildRequestPath helpers to eliminate repeated formatting patterns. Replace auto with concrete types for readability and use StrCaseCompare for case-insensitive header lookup.
* Add S3 client with SigV4 signingStefan Boberg4 days1-0/+716
Introduces an S3Client class for interacting with S3-compatible storage, backed by a standalone AWS Signature Version 4 implementation using platform-native crypto (BCrypt on Windows, OpenSSL on Linux/Mac). Supported operations: PUT, GET, DELETE, HEAD, ListObjectsV2, multipart upload, and pre-signed URL generation. Includes a test bed binary (zens3-testbed) for exercising operations against a real bucket.