fix(gcs): map cacheControl and customTime on the gRPC object path - #184
fix(gcs): map cacheControl and customTime on the gRPC object path#184exoego wants to merge 2 commits into
Conversation
UpdateObject rejected the mask paths. Both are now mapped like their siblings. A live GCS probe also set the rules: an unset custom_time or null customTime keeps the value, a decrease is rejected, and only contentEncoding is honoured as an upload query parameter.
|
| Filename | Overview |
|---|---|
| src/main/java/io/floci/gcp/services/gcs/GcsCustomTime.java | Centralizes REST and gRPC custom-time normalization, range handling, and monotonicity validation. |
| src/main/java/io/floci/gcp/services/gcs/GcsGrpcMapper.java | Maps cache control and custom time across gRPC object paths, but malformed legacy stored timestamps can still break response mapping. |
| src/main/java/io/floci/gcp/services/gcs/GcsService.java | Applies normalized custom-time updates without clearing or decreasing an existing value. |
| src/main/java/io/floci/gcp/services/gcs/GcsUploadController.java | Limits upload URL system metadata to content encoding and validates custom time from JSON metadata. |
| src/test/java/io/floci/gcp/services/gcs/GcsGrpcControllerTest.java | Covers gRPC metadata round trips, masks, monotonicity, malformed timestamps, and boundary behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
REST[REST upload or patch] --> CT[GcsCustomTime validation]
GRPC[gRPC write or update] --> CT
CT --> SVC[GcsService object metadata]
SVC --> STORE[Stored GcsObjectMeta]
STORE --> MAP[GcsGrpcMapper]
MAP --> READ[GetObject and ListObjects]
Reviews (2): Last reviewed commit: "fix(gcs): reject or saturate malformed c..." | Re-trigger Greptile
Summary
UpdateObject rejected the mask paths. Both are now mapped like their siblings.
A live GCS probe also set the rules: an unset custom_time or null customTime keeps the value, a decrease is rejected, and only contentEncoding is honoured as an upload query parameter.
Type of change
fix:)feat:)feat!:orfix!:)GCP Compatibility
GetObject/ListObjectsreturned an emptycache_controland nocustom_timefor objects written over REST, andUpdateObjectrejected both mask paths. They now maps both fields.custom_timeunder the mask, or a JSONcustomTime: null, cleared the field. They are now kept.customTimewas accepted. It is now rejected with INVALID_ARGUMENT / 400; the message is pinned in tests.cache_controlunder the mask stored"". It is now unset.customTimewas stored as sent. It is now rendered in UTC and rejected with 400 if unparsable values.contentEncodingis honoured now.Checklist
./mvnw testpasses locally