apache / apache/arrow-rs-object-store

Why not allow object paths with control characters?

Open
#384 15 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
322
Forks
212
Avg merge
5d 2h
Merged PRs (30d)
10

Description

**Which part is this question about**
the `Path::parse` and `PathSegment::parse` API(s).

**Describe your question**
Right now PathSegment::parse returns InvalidPart if any character within is a control character.

As a concrete example: I can create an object `\x01.txt` in a GCS bucket which I then can't delete through the `object_store` API. This is because:
1. If I use `Path::parse("\x01.txt")`, this results in an InvalidPart error.
2. If I use `Path::from("\x01.txt")`, this results in a Path with the raw string "%01.txt", which gets percent-encoded _again_ in the GCS client to become `%2501.txt` before being used in a GCS API URL.

I don't understand why this is considered an error. Maybe this comes down to an inconsistency in object store implementations, where some expect to get safe paths from `Path`, and others (like GCS) expect unsafe paths which need percent-encoding again? I don't have a lot of context.

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start with the Path::parse and PathSegment::parse APIs, then trace how Path::from and the GCS client encode object names. Resolve whether control-character paths should be accepted and how encoding should remain consistent across implementations; done means the behavior and its compatibility expectations are agreed and covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.