Repository navigation
Conversation
Prevent Gapic::Rest::ClientStub and Gapic::ResumableUpload from sending requests or accepting resumable upload session URLs with http:// or other non-https schemes when the client stub endpoint uses https://. - Add internal Gapic::Rest::UriValidation helper to validate request URIs (allowing relative RPC paths including AIP custom methods while rejecting non-https, protocol-relative, authority-less https, whitespace/control-character, and invalid-encoding URIs) and absolute https:// upload URLs, normalizing uppercase HTTPS:// scheme prefixes to lowercase https://. - Update Gapic::Rest::ClientStub#initialize to normalize endpoint schemes case-insensitively and cache @https_endpoint after yielding @connection; enforce scheme validation in base_make_http_request. - Update Gapic::ResumableUpload#start and #resume to validate initial_url and ResumeHandle#upload_url before replacing @driver, and pass require_https to StartUploadConfig so Rules rejects non-https X-Goog-Upload-URL headers immediately with a non-resumable BadResponseError ("Upload URL must be a valid https URL"). - Add unit tests across UriValidation, ClientStub, Rules, and ResumableUpload covering downgrade vectors, resumable? state, permissive retry_predicate non-retry, AIP relative paths, UTF-8 paths, cross-host https://, and http:// emulators. Fixes b/593062793
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevent Gapic::Rest::ClientStub and Gapic::ResumableUpload from sending requests or accepting resumable upload session URLs with http:// or other non-https schemes when the client stub endpoint uses https://.
b/593062793