Skip to content

feat: support force_path_style S3 config override #118

Merged
quettabit merged 1 commit into
mainfrom
qb/fps
Jun 5, 2026
Merged

feat: support force_path_style S3 config override #118
quettabit merged 1 commit into
mainfrom
qb/fps

Conversation

@quettabit

Copy link
Copy Markdown
Member

No description provided.

@quettabit

Copy link
Copy Markdown
Member Author

@greptileai review pls

@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds support for a force_path_style S3 config override via the fps=<bool> key in the C0-Config request header, allowing callers to switch between virtual-hosted and path-style S3 addressing on a per-request basis.

  • src/object_store/config.rs: Adds force_path_style: Option<bool> to RequestConfig and extends is_noop() to account for it.
  • src/object_store/downloader.rs: Applies the override to the per-request AWS SDK config builder, following the same pattern used for timeout and retry overrides.
  • src/service/routes.rs: Parses the new fps header key, moves parse_duration outside the loop (cleaning up the previous P2), fixes a typo in the ma error message, and adds two new tests covering the happy path and invalid input.

Confidence Score: 5/5

Safe to merge — the change is additive, follows established patterns, and is covered by tests.

The new force_path_style field integrates cleanly into the existing per-request override mechanism. is_noop() is correctly extended so the fast path is still taken when the field is absent, and the override is applied via the same builder pattern already in use for timeout and retry configs. Tests cover both the valid fps=true case and the invalid fps=1 rejection.

No files require special attention.

Important Files Changed

Filename Overview
src/object_store/config.rs Adds force_path_style: Option<bool> field to RequestConfig and updates is_noop() — minimal, correct change following the existing pattern.
src/object_store/downloader.rs Applies force_path_style to the per-request config override builder, consistent with how timeout and retry overrides are applied.
src/service/routes.rs Adds fps key parsing for force_path_style, moves parse_duration outside the loop, fixes a typo in the ma error message, and adds two new tests.
README.md Documents the new fps=<bool> header option.

Sequence Diagram

sequenceDiagram
    participant Client
    participant Routes as routes.rs (FromRequestParts)
    participant Downloader as downloader.rs
    participant AWS as AWS SDK S3

    Client->>Routes: "GET /... C0-Config: fps=true"
    Routes->>Routes: Parse header key "fps"
    Routes->>Routes: "value.parse::<bool>() → true"
    Routes-->>Downloader: "RequestConfig { force_path_style: Some(true), ... }"

    Downloader->>Downloader: is_noop()? → false
    Downloader->>Downloader: client_config.to_builder()
    Downloader->>Downloader: config_override.force_path_style(true)
    Downloader->>AWS: request.customize().config_override(builder).send()
    AWS-->>Downloader: GetObjectOutput
    Downloader-->>Client: Response bytes
Loading

Reviews (3): Last reviewed commit: "initial commit" | Re-trigger Greptile

@quettabit

Copy link
Copy Markdown
Member Author

@greptileai review again pls

@quettabit quettabit changed the title [WIP] feat: support force_path_style S3 config override Jun 5, 2026
@quettabit
quettabit marked this pull request as ready for review June 5, 2026 17:56
@quettabit
quettabit merged commit 3bf3d1d into main Jun 5, 2026
12 of 13 checks passed
@quettabit
quettabit deleted the qb/fps branch June 5, 2026 17:59
@github-actions github-actions Bot mentioned this pull request Jun 5, 2026
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.

2 participants