googleapis / googleapis/google-cloud-rust

BytesValue in Any rejects unpadded and URL-safe base64

Open Beginner friendly
#6,714 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

Unconfirmed. This is the result of a search with Claude, may be a false positive.

In `src/wkt/src/wrappers.rs`, `BytesValue` deserialization from `Any` JSON representation decodes the string using standard base64 engine:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/wkt/src/wrappers.rs#L340-L349

```rust
STANDARD
.decode(s)
.map(BytesValue::from)
.map_err(crate::AnyError::deser)
```

The Proto3 JSON specification specifies that byte fields must accept either standard with padding or URL-safe with/without padding base64 encoding.

Using `STANDARD` rejects valid Proto3 JSON payloads that contain unpadded base64 or URL-safe base64 characters (`-` and `_`).

Contributor guide

Open the contributing guide

Research direction

Start in src/wkt/src/wrappers.rs at the BytesValue deserialization path referenced in the issue, and verify the Proto3 JSON base64 requirements against the current behavior. Add regression coverage for padded, unpadded, and URL-safe inputs, then run the wkt tests to confirm all accepted forms decode correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.