Skip to content

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

Merged
merged 28 commits into from
Jun 19, 2025

Conversation

MarioJGMsoft
Copy link
Contributor

@MarioJGMsoft MarioJGMsoft commented Jun 10, 2025

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

@github-actions github-actions bot added base: main PRs targeted against main branch area: driver Driver related issues area: odsp-driver labels Jun 10, 2025
@MarioJGMsoft MarioJGMsoft changed the title update the shareLink enum Update odsp driver for new header Jun 10, 2025
@github-actions github-actions bot added the public api change Changes to a public API label Jun 11, 2025
@MarioJGMsoft MarioJGMsoft marked this pull request as ready for review June 11, 2025 22:11
@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 22:11
@MarioJGMsoft MarioJGMsoft requested a review from a team as a code owner June 11, 2025 22:11
Copy link
Contributor

@Copilot Copilot AI left a 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 to headers 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 be true (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",

@github-actions github-actions bot added the area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct label Jun 17, 2025
@github-actions github-actions bot removed the area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct label Jun 17, 2025
* 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
Copy link
Contributor

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.

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  225443 links
    1710 destination URLs
    1941 URLs ignored
       0 warnings
       0 errors


@MarioJGMsoft MarioJGMsoft merged commit a734b33 into microsoft:main Jun 19, 2025
37 checks passed
@MarioJGMsoft MarioJGMsoft deleted the ODSPHeaderNonDurableRedeem branch June 19, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: driver Driver related issues area: odsp-driver base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants