Skip to content

Add CreateSession S3 API operation#511

Merged
Nugine merged 5 commits intomainfrom
copilot/create-session-api
Feb 27, 2026
Merged

Add CreateSession S3 API operation#511
Nugine merged 5 commits intomainfrom
copilot/create-session-api

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

  • Remove CreateSession from SKIPPED_OPS in codegen/src/v1/ops.rs
  • Fix has_unconditional_builder in codegen/src/v1/aws_conv.rs to handle CreateSessionOutput
  • Fix collect_types_needing_custom_default in codegen/src/v1/dto.rs to include operation output types
  • Add Default implementation for Timestamp type
  • Run code generation (just codegen) to generate the operation code
  • Verify generated code includes CreateSession trait method, HTTP serialization, routing, and access control
  • Run linting and tests - all checks passed
  • Add tests to improve code coverage for CreateSession-related code
Original prompt

This section details on the original issue you should resolve

<issue_title>CreateSession</issue_title>
<issue_description>https://docs.amazonaws.cn/en_us/AmazonS3/latest/API/API_CreateSession.html</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

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>
Copilot AI changed the title [WIP] Add CreateSession API implementation Add CreateSession S3 API operation Feb 25, 2026
@Nugine Nugine added the needs-human-intervention AI PRs that need non-trivial work to make progress label Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

@Nugine
Copy link
Member

Nugine commented Feb 26, 2026

@copilot Try to improve code coverage since codecov complains.
#511 (comment)

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>
Copy link
Contributor Author

Copilot AI commented Feb 26, 2026

@copilot Try to improve code coverage since codecov complains.
#511 (comment)

Added tests in commit 7255442 to cover the non-generated CreateSession code paths:

  • Timestamp::default() impl (3 lines in timestamp.rs)
  • CreateSession::deserialize_http with session mode header parsing
  • CreateSession::serialize_http with credentials output
  • Route resolution for GET /{Bucket}?session
  • CreateSessionOutput XML serialization format

The remaining uncovered lines are all in auto-generated minio variant files (generated_minio.rs), which are only compiled under the minio feature flag and mirror the standard generated code.

@Nugine Nugine marked this pull request as ready for review February 27, 2026 15:07
Copilot AI review requested due to automatic review settings February 27, 2026 15:07
@Nugine Nugine removed the needs-human-intervention AI PRs that need non-trivial work to make progress label Feb 27, 2026
Copy link
Contributor

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

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 CreateSession from the SKIPPED_OPS list in codegen to enable code generation for this operation
  • Extended codegen to properly handle operation output types that require custom Default implementations, specifically for SessionCredentials and CreateSessionOutput
  • Added Default implementation for the Timestamp type 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

@Nugine Nugine added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit c87ca1c Feb 27, 2026
21 checks passed
@Nugine Nugine deleted the copilot/create-session-api branch February 27, 2026 15:37
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.

CreateSession

3 participants