-
Notifications
You must be signed in to change notification settings - Fork 549
Update odsp driver for new header #24819
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
Update odsp driver for new header #24819
Conversation
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.
Pull Request Overview
Adds support for a new isNonDurableRedeem
header to enable temporal, non-durable access via share links. Key changes include:
- Extending the resolver and contracts to extract and propagate the new header.
- Modifying snapshot redemption and download flows to honor the non-durable flag.
- Updating public API definitions and adding unit tests for the new behavior.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/drivers/odsp-driver/src/test/odspDriverUrlResolverForShareLink.spec.ts | Added tests verifying isNonDurableRedeem is set or ignored |
packages/drivers/odsp-driver/src/odspDriverUrlResolverForShareLink.ts | Extract and attach isNonDurableRedeem to shareLinkInfo |
packages/drivers/odsp-driver/src/fetchSnapshot.ts | Propagate isNonDurableRedeem into prefer headers for redeem and download APIs |
packages/drivers/odsp-driver/src/contractsPublic.ts | Extended SharingLinkHeader enum and internal interface |
packages/drivers/odsp-driver-definitions/src/resolvedUrl.ts | Added isNonDurableRedeem to ShareLinkInfoType |
packages/drivers/odsp-driver-definitions/api-report/odsp-driver-definitions.legacy.alpha.api.md | Updated API report with new field |
Comments suppressed due to low confidence (4)
packages/drivers/odsp-driver/src/contractsPublic.ts:37
- This header may be omitted in normal requests. Consider making the property optional (
[SharingLinkHeader.isNonDurableRedeem]?: boolean
) to reflect its conditional presence.
[SharingLinkHeader.isNonDurableRedeem]: boolean;
packages/drivers/odsp-driver/src/fetchSnapshot.ts:740
- [nitpick] Rename
header
toheaders
to clarify that this object holds multiple HTTP headers and align with the naming used elsewhere in the file.
const header = isNonDurableRedeem
packages/drivers/odsp-driver/src/test/odspDriverUrlResolverForShareLink.spec.ts:373
- [nitpick] The assertion message is generic. Consider specifying that you expect the
isNonDurableRedeem
flag to betrue
(e.g.,Expected isNonDurableRedeem to be true
).
"Sharing link should be set in resolved url",
packages/drivers/odsp-driver/src/test/odspDriverUrlResolverForShareLink.spec.ts:390
- [nitpick] This assertion message could more clearly reference
isNonDurableRedeem
(e.g.,Expected isNonDurableRedeem to be undefined
).
"Sharing link should not be set in resolved url",
packages/drivers/odsp-driver/src/odspDriverUrlResolverForShareLink.ts
Outdated
Show resolved
Hide resolved
packages/drivers/odsp-driver-definitions/api-report/odsp-driver-definitions.legacy.alpha.api.md
Outdated
Show resolved
Hide resolved
* When a sharingLinkToRedeem is used, this parameter can be set to make the request with | ||
* the redemption expire after a certain time period. | ||
* The duration of the redemption is not set by Fluid. | ||
* @defaultValue false |
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.
@defaultValue
is intended to describe the behavior that results from not specifying a value (or setting it to undefined). So here it should describe the default boolean value that will be used when this is undefined.
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
Description
A new header variable is necessary when redeeming a share link so that a certain type of user has temporal access to the document to which the link points to.
Reviewer Guidance
Let me know if there's something I need to add or be aware of.
Fixes: AB#41357