Conversation
Remove CreateSession from SKIPPED_OPS and regenerate code to support the S3 Express One Zone CreateSession API. This adds: - CreateSessionInput/CreateSessionOutput DTOs - S3 trait method create_session - HTTP serialization/deserialization and routing - S3Access method for access control - AWS SDK conversion support Also adds Default impl for Timestamp and handles AWS SDK output builders that have required fields but infallible build() methods. Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@copilot Try to improve code coverage since codecov complains. |
Add tests for non-generated CreateSession code paths:
- Timestamp::default() returns UNIX epoch
- CreateSession HTTP deserialization with session mode header
- CreateSession HTTP serialization with credentials
- CreateSession route resolution via GET /{Bucket}?session
- CreateSessionOutput XML serialization format
Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
Added tests in commit 7255442 to cover the non-generated CreateSession code paths:
The remaining uncovered lines are all in auto-generated minio variant files ( |
There was a problem hiding this comment.
Pull request overview
This PR adds support for the CreateSession S3 API operation, which is used to establish temporary security credentials for S3 Express One Zone directory buckets. The implementation follows the project's code generation workflow and includes comprehensive test coverage.
Changes:
- Removed
CreateSessionfrom theSKIPPED_OPSlist in codegen to enable code generation for this operation - Extended codegen to properly handle operation output types that require custom Default implementations, specifically for
SessionCredentialsandCreateSessionOutput - Added
Defaultimplementation for theTimestamptype to support default construction of session credentials - Generated complete operation code including HTTP serialization/deserialization, routing, XML handling, AWS SDK integration, and access control
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| codegen/src/v1/ops.rs | Removed CreateSession from SKIPPED_OPS to enable code generation |
| codegen/src/v1/dto.rs | Extended collect_types_needing_custom_default to include operation output types |
| codegen/src/v1/aws_conv.rs | Added CreateSessionOutput to has_unconditional_builder list for AWS SDK integration |
| crates/s3s/src/dto/timestamp.rs | Added Default implementation for Timestamp (returns UNIX_EPOCH) with test |
| crates/s3s/src/dto/generated.rs | Generated CreateSessionInput/Output types, SessionMode enum, SessionCredentials, and builders |
| crates/s3s/src/dto/generated_minio.rs | Generated types for MinIO variant |
| crates/s3s/src/s3_trait.rs | Added create_session trait method with comprehensive documentation |
| crates/s3s/src/ops/generated.rs | Generated HTTP serialization, operation implementation, and routing for ?session query |
| crates/s3s/src/ops/generated_minio.rs | Generated operation code for MinIO variant |
| crates/s3s/src/ops/tests.rs | Added tests for route resolution, HTTP deserialization, and HTTP serialization |
| crates/s3s/src/xml/mod.rs | Added XML serialization test for CreateSessionOutput |
| crates/s3s/src/xml/generated.rs | Generated XML serialization/deserialization for CreateSessionOutput and SessionCredentials |
| crates/s3s/src/xml/generated_minio.rs | Generated XML code for MinIO variant |
| crates/s3s/src/access/generated.rs | Generated access control trait method |
| crates/s3s/src/access/generated_minio.rs | Generated access control for MinIO variant |
| crates/s3s-aws/src/proxy/generated.rs | Generated AWS SDK proxy implementation |
| crates/s3s-aws/src/proxy/generated_minio.rs | Generated proxy for MinIO variant |
| crates/s3s-aws/src/conv/generated.rs | Generated AWS SDK type conversions |
| crates/s3s-aws/src/conv/generated_minio.rs | Generated conversions for MinIO variant |
CreateSessionfromSKIPPED_OPSincodegen/src/v1/ops.rshas_unconditional_builderincodegen/src/v1/aws_conv.rsto handleCreateSessionOutputcollect_types_needing_custom_defaultincodegen/src/v1/dto.rsto include operation output typesDefaultimplementation forTimestamptypejust codegen) to generate the operation codeOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.