Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storage): revise Reader to send XML preconditions #4479

Merged
merged 12 commits into from
Jul 23, 2021

Conversation

cojenco
Copy link
Contributor

@cojenco cojenco commented Jul 22, 2021

This updates Reader to send precondition request headers to fit the XML API used for downloads.

  • adds a new function setConditionsHeaders() that parses Conditions and sets the corresponding precondition headers
  • revises NewRangerReader to call setConditionsHeaders()
  • if an object version is specified via generation, include generation as query string parameters
  • updates tests

Fixes #4470

@cojenco cojenco requested a review from a team July 22, 2021 00:15
@cojenco cojenco requested a review from a team as a code owner July 22, 2021 00:15
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jul 22, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 22, 2021
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Side note, the docs for this in the XML API reference are kind of terrible...

storage/reader.go Show resolved Hide resolved
storage/storage.go Outdated Show resolved Hide resolved
storage/integration_test.go Show resolved Hide resolved
storage/reader.go Show resolved Hide resolved
@cojenco cojenco requested a review from tritone July 22, 2021 22:06
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this!!

@cojenco cojenco added the automerge Merge the pull request once unit tests and other checks pass. label Jul 23, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit e36b29a into googleapis:master Jul 23, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jul 23, 2021
gcf-merge-on-green bot pushed a commit that referenced this pull request Aug 31, 2021
🤖 I have created a release \*beep\* \*boop\*
---
### [1.16.1](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.16.0...storage/v1.16.1) (2021-08-30)


### Bug Fixes

* **storage/internal:** Update encryption_key fields to "bytes" type. fix: Improve date/times and field name clarity in lifecycle conditions. ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758))
* **storage:** accept emulator env var without scheme ([#4616](https://www.github.com/googleapis/google-cloud-go/issues/4616)) ([5f8cbb9](https://www.github.com/googleapis/google-cloud-go/commit/5f8cbb98070109e2a34409ac775ed63b94d37efd))
* **storage:** preserve supplied endpoint's scheme ([#4609](https://www.github.com/googleapis/google-cloud-go/issues/4609)) ([ee2756f](https://www.github.com/googleapis/google-cloud-go/commit/ee2756fb0a335d591464a770c9fa4f8fe0ba2e01))
* **storage:** remove unnecessary variable ([#4608](https://www.github.com/googleapis/google-cloud-go/issues/4608)) ([27fc784](https://www.github.com/googleapis/google-cloud-go/commit/27fc78456fb251652bdf5cdb493734a7e1e643e1))
* **storage:** retry LockRetentionPolicy ([#4439](https://www.github.com/googleapis/google-cloud-go/issues/4439)) ([09879ea](https://www.github.com/googleapis/google-cloud-go/commit/09879ea80cb67f9bfd8fc9384b0fda335567cba9)), refs [#4437](https://www.github.com/googleapis/google-cloud-go/issues/4437)
* **storage:** revise Reader to send XML preconditions ([#4479](https://www.github.com/googleapis/google-cloud-go/issues/4479)) ([e36b29a](https://www.github.com/googleapis/google-cloud-go/commit/e36b29a3d43bce5c1c044f7daf6e1db00b0a49e0)), refs [#4470](https://www.github.com/googleapis/google-cloud-go/issues/4470)

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage: Reader uses the xml api but sends json preconditions
2 participants