Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.

Repository from Github https://github.comAzure/azure-sdk-for-jsRepository from Github https://github.comAzure/azure-sdk-for-js

Bad typing for `SignedIdentifier` in @azure/storage-file-share

craxal opened this issue · comments

  • Package Name: @azure/storage-file-share
  • Package Version: 12.26.0
  • Operating system: N/A
  • nodejs
    • version: 22
  • browser
    • name/version:
  • typescript
    • version: 5
  • Is the bug related to documentation in

Describe the bug

Stored access policies can optionally define any of the following properties (see https://docs.microsoft.com/en-us/rest/api/storageservices/define-stored-access-policy#creating-or-modifying-a-stored-access-policy)

  • Permissons
  • Start time
  • Expiry time

However, the type for SignedIdentifier as defined in the @azure/storage-file-share package requires all three properties:

export declare interface SignedIdentifier {
    id: string;
    accessPolicy: {
        startsOn: Date;
        expiresOn: Date;
        permissions: string;
    };
}

For comparison, the @azure/storage-blob package defines SignedIdentifier as expected:

export declare interface SignedIdentifier {
id: string;
accessPolicy: {
startsOn?: Date;
expiresOn?: Date;
permissions?: string;
};
}

To Reproduce
Steps to reproduce the behavior:

  1. Install the npm package and search for the SignedIdentifier declaration.

Expected behavior
The properties of the accessPolicy should be optional.

Screenshots
N/A

Additional context

This issue was originally reported in #13540. Additional clarification was requested by the issue author, but the conversation was not picked up by the repo owners, and the issue was closed without resolution.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.