azure-docs-sdk-node icon indicating copy to clipboard operation
azure-docs-sdk-node copied to clipboard

Correct confusing ms number in expiresOn parameter for SAS links

Open mylesrankin opened this issue 4 years ago • 1 comments

Within the documentation for the generation of blob SAS links, there is a expiry date that uses +86400 on new Date().valueOf() to calculate an expiry. I can only assume that the person who provided this example was intending on an expiry of 24 hrs, as 86400s / 60 / 60 = 24 hrs - however javascript date .valueOf uses milliseconds, so this number is actually only 1 minute and 26.4 seconds. This is confusing, in our case we had someone copy the snippet and consequently was confused when the SAS link was expiring so soon.

We are now using date-fns to calculate our expiresOn date, but it makes sense to add * 1000 to this documentation to make it actually create a 24 hr expiry.

Thank you.

mylesrankin avatar Oct 20 '21 14:10 mylesrankin

Docs Build status updates of commit 593a94a:

:warning: Validation status: warnings

File Status Preview URL Details
docs-ref-autogen/@azure/storage-blob/index.yml :warning:Warning View (azure-node-latest) Details

docs-ref-autogen/@azure/storage-blob/index.yml

  • Line 355, Column 13: [Warning: xref-not-found] Cross reference not found: 'SASQueryParameters'.

For more details, please refer to the build report.

If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

opbld32 avatar Oct 20 '21 14:10 opbld32