-
Notifications
You must be signed in to change notification settings - Fork 45
[bundles] Add range request support to other support bundle APIs #8202
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
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b3580dd
Update to dropshot 0.16.1
smklein c5a9fea
workspace hack
smklein 62a3561
[wip] Working towards range requests for download API
smklein 27d1af2
Proxying range requests into sled agent
smklein 52ccb16
Merge branch 'main' into dropshot-update
smklein 4bda871
Merge branch 'dropshot-update' into range-request-sb
smklein 71f9fd1
add tests
smklein 0b80eb6
Upstream dropshot, omdb, openapi spec internal/external API
smklein 54e9da1
clippy
smklein 7a714e6
rust docs
smklein 761d5a0
feedback
smklein 4896684
doctest
smklein 2128d79
wip
smklein a4b0bf6
openapi
smklein 222ccc6
Merge branch 'range-request-sb' into more-rr
smklein 1343cf0
[bundles] Add range request support to other support bundle download …
smklein 50160a8
More text
smklein 7d946ae
Merge branch 'range-request-sb' into more-rr
smklein 1ed79bf
Merge branch 'main' into range-request-sb
smklein 2e3dfea
Merge branch 'range-request-sb' into more-rr
smklein a3a017e
doc changes again
smklein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,6 @@ use propolis_client::support::tungstenite::protocol::{ | |
CloseFrame, Role as WebSocketRole, | ||
}; | ||
use range_requests::PotentialRange; | ||
use range_requests::RequestContextEx; | ||
use ref_cast::RefCast; | ||
|
||
type NexusApiDescription = ApiDescription<ApiContext>; | ||
|
@@ -7078,6 +7077,7 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
|
||
async fn support_bundle_index( | ||
rqctx: RequestContext<Self::Context>, | ||
headers: Header<RangeRequest>, | ||
path_params: Path<params::SupportBundlePath>, | ||
) -> Result<Response<Body>, HttpError> { | ||
let apictx = rqctx.context(); | ||
|
@@ -7088,7 +7088,10 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
crate::context::op_context_for_external_api(&rqctx).await?; | ||
|
||
let head = false; | ||
let range = rqctx.range(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you can see here, we actually were parsing the range request headers before - just not visibly through the API spec. |
||
let range = headers | ||
.into_inner() | ||
.range | ||
.map(|r| PotentialRange::new(r.as_bytes())); | ||
|
||
let body = nexus | ||
.support_bundle_download( | ||
|
@@ -7146,6 +7149,7 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
|
||
async fn support_bundle_download_file( | ||
rqctx: RequestContext<Self::Context>, | ||
headers: Header<RangeRequest>, | ||
path_params: Path<params::SupportBundleFilePath>, | ||
) -> Result<Response<Body>, HttpError> { | ||
let apictx = rqctx.context(); | ||
|
@@ -7155,7 +7159,10 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
let opctx = | ||
crate::context::op_context_for_external_api(&rqctx).await?; | ||
let head = false; | ||
let range = rqctx.range(); | ||
let range = headers | ||
.into_inner() | ||
.range | ||
.map(|r| PotentialRange::new(r.as_bytes())); | ||
|
||
let body = nexus | ||
.support_bundle_download( | ||
|
@@ -7177,6 +7184,7 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
|
||
async fn support_bundle_head( | ||
rqctx: RequestContext<Self::Context>, | ||
headers: Header<RangeRequest>, | ||
path_params: Path<params::SupportBundlePath>, | ||
) -> Result<Response<Body>, HttpError> { | ||
let apictx = rqctx.context(); | ||
|
@@ -7186,7 +7194,10 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
let opctx = | ||
crate::context::op_context_for_external_api(&rqctx).await?; | ||
let head = true; | ||
let range = rqctx.range(); | ||
let range = headers | ||
.into_inner() | ||
.range | ||
.map(|r| PotentialRange::new(r.as_bytes())); | ||
|
||
let body = nexus | ||
.support_bundle_download( | ||
|
@@ -7208,6 +7219,7 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
|
||
async fn support_bundle_head_file( | ||
rqctx: RequestContext<Self::Context>, | ||
headers: Header<RangeRequest>, | ||
path_params: Path<params::SupportBundleFilePath>, | ||
) -> Result<Response<Body>, HttpError> { | ||
let apictx = rqctx.context(); | ||
|
@@ -7217,7 +7229,10 @@ impl NexusExternalApi for NexusExternalApiImpl { | |
let opctx = | ||
crate::context::op_context_for_external_api(&rqctx).await?; | ||
let head = true; | ||
let range = rqctx.range(); | ||
let range = headers | ||
.into_inner() | ||
.range | ||
.map(|r| PotentialRange::new(r.as_bytes())); | ||
|
||
let body = nexus | ||
.support_bundle_download( | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a minor change, but this part is actually critical: for all these APIs, where Nexus was proxying requests to the sled agent over progenitor APIs, it was previously unable to forward range request headers.
Now, with the new progenitor work, it can do so, for all bundle-related APIs.
(This is wiring up the same thing we did already in #8183 , but for other more granular bundle access)