Skip to content

feat(storage): support copying CSEK-encrypted files to non-CSEK destinations#8771

Open
thiyaguk09 wants to merge 4 commits into
googleapis:mainfrom
thiyaguk09:feat/7351-copy-csek-to-unencrypted
Open

feat(storage): support copying CSEK-encrypted files to non-CSEK destinations#8771
thiyaguk09 wants to merge 4 commits into
googleapis:mainfrom
thiyaguk09:feat/7351-copy-csek-to-unencrypted

Conversation

@thiyaguk09

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #7351

…SEK and fix copy behavior for non-encrypted destinations
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jun 29, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for setting a File's encryption key to null, enabling the copying of a Customer-Supplied Encryption Key (CSEK) encrypted file to a standard non-CSEK destination. Feedback on the changes highlights a critical async bug and race condition in the copy method, where this.getRequestInterceptors is temporarily overridden synchronously around an asynchronous request. Because the request pipeline runs asynchronously, the synchronous restoration happens too early, and concurrent operations on the same File instance will interfere with each other. The reviewer recommends isolating custom interceptors using request-scoped configuration instead of modifying the shared instance.

Comment thread handwritten/storage/src/file.ts Outdated
Comment thread handwritten/storage/src/file.ts Outdated
@thiyaguk09 thiyaguk09 marked this pull request as ready for review June 29, 2026 14:16
@thiyaguk09 thiyaguk09 requested a review from a team as a code owner June 29, 2026 14:16
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to copy a file encrypted with customer-supplied key to a file without customer-supplied key

1 participant