@azure/data-tables 13.3.1-alpha.20250108.1 → 13.3.1-alpha.20250110.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/dist/browser/sas/accountSasPermissions.d.ts +1 -1
- package/dist/browser/sas/accountSasPermissions.js +2 -2
- package/dist/browser/sas/accountSasPermissions.js.map +1 -1
- package/dist/browser/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/browser/sas/accountSasResourceTypes.js +1 -1
- package/dist/browser/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/browser/sas/accountSasSignatureValues.d.ts +3 -3
- package/dist/browser/sas/accountSasSignatureValues.js +1 -1
- package/dist/browser/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/browser/sas/generateAccountSas.d.ts +1 -1
- package/dist/browser/sas/generateAccountSas.js +1 -1
- package/dist/browser/sas/generateAccountSas.js.map +1 -1
- package/dist/browser/sas/generateTableSas.d.ts +1 -1
- package/dist/browser/sas/generateTableSas.js +1 -1
- package/dist/browser/sas/generateTableSas.js.map +1 -1
- package/dist/browser/sas/sasQueryParameters.d.ts +3 -3
- package/dist/browser/sas/sasQueryParameters.js.map +1 -1
- package/dist/browser/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/browser/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/accountSasPermissions.d.ts +1 -1
- package/dist/commonjs/sas/accountSasPermissions.js +2 -2
- package/dist/commonjs/sas/accountSasPermissions.js.map +1 -1
- package/dist/commonjs/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/commonjs/sas/accountSasResourceTypes.js +1 -1
- package/dist/commonjs/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/commonjs/sas/accountSasSignatureValues.d.ts +3 -3
- package/dist/commonjs/sas/accountSasSignatureValues.js +1 -1
- package/dist/commonjs/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/generateAccountSas.d.ts +1 -1
- package/dist/commonjs/sas/generateAccountSas.js +1 -1
- package/dist/commonjs/sas/generateAccountSas.js.map +1 -1
- package/dist/commonjs/sas/generateTableSas.d.ts +1 -1
- package/dist/commonjs/sas/generateTableSas.js +1 -1
- package/dist/commonjs/sas/generateTableSas.js.map +1 -1
- package/dist/commonjs/sas/sasQueryParameters.d.ts +3 -3
- package/dist/commonjs/sas/sasQueryParameters.js.map +1 -1
- package/dist/commonjs/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/commonjs/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/commonjs/tablesNamedCredentialPolicy.js +1 -1
- package/dist/commonjs/tablesNamedCredentialPolicy.js.map +1 -1
- package/dist/esm/sas/accountSasPermissions.d.ts +1 -1
- package/dist/esm/sas/accountSasPermissions.js +2 -2
- package/dist/esm/sas/accountSasPermissions.js.map +1 -1
- package/dist/esm/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/esm/sas/accountSasResourceTypes.js +1 -1
- package/dist/esm/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/esm/sas/accountSasSignatureValues.d.ts +3 -3
- package/dist/esm/sas/accountSasSignatureValues.js +1 -1
- package/dist/esm/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/esm/sas/generateAccountSas.d.ts +1 -1
- package/dist/esm/sas/generateAccountSas.js +1 -1
- package/dist/esm/sas/generateAccountSas.js.map +1 -1
- package/dist/esm/sas/generateTableSas.d.ts +1 -1
- package/dist/esm/sas/generateTableSas.js +1 -1
- package/dist/esm/sas/generateTableSas.js.map +1 -1
- package/dist/esm/sas/sasQueryParameters.d.ts +3 -3
- package/dist/esm/sas/sasQueryParameters.js.map +1 -1
- package/dist/esm/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/esm/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/esm/tablesNamedCredentialPolicy.js +1 -1
- package/dist/esm/tablesNamedCredentialPolicy.js.map +1 -1
- package/dist/react-native/sas/accountSasPermissions.d.ts +1 -1
- package/dist/react-native/sas/accountSasPermissions.js +2 -2
- package/dist/react-native/sas/accountSasPermissions.js.map +1 -1
- package/dist/react-native/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/react-native/sas/accountSasResourceTypes.js +1 -1
- package/dist/react-native/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/react-native/sas/accountSasSignatureValues.d.ts +3 -3
- package/dist/react-native/sas/accountSasSignatureValues.js +1 -1
- package/dist/react-native/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/react-native/sas/generateAccountSas.d.ts +1 -1
- package/dist/react-native/sas/generateAccountSas.js +1 -1
- package/dist/react-native/sas/generateAccountSas.js.map +1 -1
- package/dist/react-native/sas/generateTableSas.d.ts +1 -1
- package/dist/react-native/sas/generateTableSas.js +1 -1
- package/dist/react-native/sas/generateTableSas.js.map +1 -1
- package/dist/react-native/sas/sasQueryParameters.d.ts +3 -3
- package/dist/react-native/sas/sasQueryParameters.js.map +1 -1
- package/dist/react-native/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/react-native/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/react-native/tablesNamedCredentialPolicy.js +1 -1
- package/dist/react-native/tablesNamedCredentialPolicy.js.map +1 -1
- package/package.json +2 -2
|
@@ -7,7 +7,7 @@ import { tableSasPermissionsFromString } from "./tableSasPermisions.js";
|
|
|
7
7
|
* Generates a Table Service Shared Access Signature (SAS) URI based on the client properties
|
|
8
8
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
9
9
|
*
|
|
10
|
-
* @see https://
|
|
10
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
|
11
11
|
*
|
|
12
12
|
* @param options - Optional parameters.
|
|
13
13
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateTableSas.js","sourceRoot":"","sources":["../../../src/sas/generateTableSas.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,UAA8B,EAC9B,UAAmC,EAAE;IAErC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEzC,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,8DAA8D;IAC9D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,6BAA6B,CAAC,GAAG,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,MAAM,GAAG,GAAG,+BAA+B,CAAC,SAAS,EAAE,UAAU,kCAC5D,OAAO,KACV,SAAS;QACT,WAAW,IACX,CAAC,QAAQ,EAAE,CAAC;IAEd,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport { isNamedKeyCredential } from \"@azure/core-auth\";\nimport type { TableSasSignatureValues } from \"./tableSasSignatureValues.js\";\nimport { generateTableSasQueryParameters } from \"./tableSasSignatureValues.js\";\nimport { tableSasPermissionsFromString } from \"./tableSasPermisions.js\";\n\n/**\n * Generates a Table Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://
|
|
1
|
+
{"version":3,"file":"generateTableSas.js","sourceRoot":"","sources":["../../../src/sas/generateTableSas.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,UAA8B,EAC9B,UAAmC,EAAE;IAErC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEzC,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,8DAA8D;IAC9D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,6BAA6B,CAAC,GAAG,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,MAAM,GAAG,GAAG,+BAA+B,CAAC,SAAS,EAAE,UAAU,kCAC5D,OAAO,KACV,SAAS;QACT,WAAW,IACX,CAAC,QAAQ,EAAE,CAAC;IAEd,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport { isNamedKeyCredential } from \"@azure/core-auth\";\nimport type { TableSasSignatureValues } from \"./tableSasSignatureValues.js\";\nimport { generateTableSasQueryParameters } from \"./tableSasSignatureValues.js\";\nimport { tableSasPermissionsFromString } from \"./tableSasPermisions.js\";\n\n/**\n * Generates a Table Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\nexport function generateTableSas(\n tableName: string,\n credential: NamedKeyCredential,\n options: TableSasSignatureValues = {},\n): string {\n let { expiresOn, permissions } = options;\n\n if (!isNamedKeyCredential(credential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n // expiresOn and permissions are optional if an identifier is provided\n // set defaults when no identifier and no values were provided\n if (!options.identifier) {\n if (!permissions) {\n permissions = tableSasPermissionsFromString(\"r\");\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n }\n\n const sas = generateTableSasQueryParameters(tableName, credential, {\n ...options,\n expiresOn,\n permissions,\n }).toString();\n\n return sas;\n}\n"]}
|
|
@@ -53,7 +53,7 @@ export declare class SasQueryParameters {
|
|
|
53
53
|
/**
|
|
54
54
|
* Optional. The signed identifier (only for {@link TableSasSignatureValues}).
|
|
55
55
|
*
|
|
56
|
-
* @see https://
|
|
56
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy
|
|
57
57
|
*/
|
|
58
58
|
readonly identifier?: string;
|
|
59
59
|
/**
|
|
@@ -197,12 +197,12 @@ export interface SasQueryParametersOptions {
|
|
|
197
197
|
/**
|
|
198
198
|
* Optional. The signed identifier for access policy
|
|
199
199
|
*
|
|
200
|
-
* @see https://
|
|
200
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy
|
|
201
201
|
*/
|
|
202
202
|
identifier?: string;
|
|
203
203
|
/**
|
|
204
204
|
* Optional. Specifies which resources are accessible via the SAS (only for {@link AccountSasSignatureValues}).
|
|
205
|
-
* @see https://
|
|
205
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only
|
|
206
206
|
*/
|
|
207
207
|
resource?: string;
|
|
208
208
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sasQueryParameters.js","sourceRoot":"","sources":["../../../src/sas/sasQueryParameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAOvE;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAwI7B;;;;OAIG;IACH,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;gBAC1B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;aAC/B,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;OAMG;IACH,YAAY,OAAe,EAAE,SAAiB,EAAE,UAAqC,EAAE;QACrF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,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B,CAAC,CAAC;oBACrE,MAAM;gBACR,KAAK,KAAK;oBACR,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;oBAC/D,MAAM;gBACR,KAAK,KAAK;oBACR,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;oBACnE,MAAM;gBACR,KAAK,KAAK;oBACR,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;oBAC7D,MAAM;YACV,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACK,uBAAuB,CAAC,OAAiB,EAAE,GAAW,EAAE,KAAc;QAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QAED,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { SasIPRange } from \"./sasIPRange.js\";\nimport { ipRangeToString } from \"./sasIPRange.js\";\nimport type { UserDelegationKey } from \"./models.js\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date.js\";\n\n/**\n * Protocols for generated SAS.\n */\nexport type SasProtocol = \"https\" | \"https,http\";\n\n/**\n * Represents the components that make up an Azure SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSasSignatureValues} and {@link TableSasSignatureValues}\n * types. Once generated, it can be encoded into a `string` and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SasQueryParameters {\n /**\n * The Tables API version.\n */\n public readonly version: string;\n\n /**\n * Optional. Table name to generate the SAS for\n */\n public readonly tableName?: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SasProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The table services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The table resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link TableSasSignatureValues}).\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * The Azure Active Directory object ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedOid?: string;\n\n /**\n * The Azure Active Directory tenant ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedTenantId?: string;\n\n /**\n * The date-time the key is active.\n * Property of user delegation key.\n */\n private readonly signedStartsOn?: Date;\n\n /**\n * The date-time the key expires.\n * Property of user delegation key.\n */\n private readonly signedExpiresOn?: Date;\n\n /**\n * Abbreviation of the Azure Table service that accepts the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedService?: string;\n\n /**\n * The service version that created the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedVersion?: string;\n\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This is only used for User Delegation SAS.\n */\n public readonly preauthorizedAgentObjectId?: string;\n\n /**\n * A GUID value that will be logged in the table diagnostic logs and can be used to correlate SAS generation with table resource access.\n * This is only used for User Delegation SAS.\n */\n public readonly correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endRowKey?: string;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the table service version\n * @param signature - Representing the signature for the SAS token\n * @param options - Optional. Options to construct the SASQueryParameters.\n */\n constructor(version: string, signature: string, options: SasQueryParametersOptions = {}) {\n this.version = version;\n this.signature = signature;\n\n this.permissions = options.permissions;\n this.services = options.services;\n this.resourceTypes = options.resourceTypes;\n this.protocol = options.protocol;\n this.startsOn = options.startsOn;\n this.expiresOn = options.expiresOn;\n this.ipRangeInner = options.ipRange;\n this.identifier = options.identifier;\n this.tableName = options.tableName;\n this.endPartitionKey = options.endPartitionKey;\n this.endRowKey = options.endRowKey;\n this.startPartitionKey = options.startPartitionKey;\n this.startRowKey = options.startRowKey;\n\n if (options.userDelegationKey) {\n this.signedOid = options.userDelegationKey.signedObjectId;\n this.signedTenantId = options.userDelegationKey.signedTenantId;\n this.signedStartsOn = options.userDelegationKey.signedStartsOn;\n this.signedExpiresOn = options.userDelegationKey.signedExpiresOn;\n this.signedService = options.userDelegationKey.signedService;\n this.signedVersion = options.userDelegationKey.signedVersion;\n\n this.preauthorizedAgentObjectId = options.preauthorizedAgentObjectId;\n this.correlationId = options.correlationId;\n }\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\n \"sv\", // SignedVersion\n \"ss\", // SignedServices\n \"srt\", // SignedResourceTypes\n \"spr\", // SignedProtocol\n \"st\", // SignedStart\n \"se\", // SignedExpiry\n \"sip\", // SignedIP\n \"si\", // SignedIdentifier\n \"skoid\", // Signed object ID\n \"sktid\", // Signed tenant ID\n \"skt\", // Signed key start time\n \"ske\", // Signed key expiry time\n \"sks\", // Signed key service\n \"skv\", // Signed key version\n \"sr\", // signedResource\n \"sp\", // SignedPermission\n \"sig\", // Signature\n \"rscc\", // Cache-Control\n \"rscd\", // Content-Disposition\n \"rsce\", // Content-Encoding\n \"rscl\", // Content-Language\n \"rsct\", // Content-Type\n \"saoid\", // signedAuthorizedObjectId\n \"scid\", // signedCorrelationId\n \"tn\", // TableName,\n \"srk\", // StartRowKey\n \"spk\", // StartPartitionKey\n \"epk\", // EndPartitionKey\n \"erk\", // EndRowKey\n ];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"skoid\": // Signed object ID\n this.tryAppendQueryParameter(queries, param, this.signedOid);\n break;\n case \"sktid\": // Signed tenant ID\n this.tryAppendQueryParameter(queries, param, this.signedTenantId);\n break;\n case \"skt\": // Signed key start time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined,\n );\n break;\n case \"ske\": // Signed key expiry time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : undefined,\n );\n break;\n case \"sks\": // Signed key service\n this.tryAppendQueryParameter(queries, param, this.signedService);\n break;\n case \"skv\": // Signed key version\n this.tryAppendQueryParameter(queries, param, this.signedVersion);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"saoid\":\n this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);\n break;\n case \"scid\":\n this.tryAppendQueryParameter(queries, param, this.correlationId);\n break;\n case \"tn\":\n this.tryAppendQueryParameter(queries, param, this.tableName);\n break;\n case \"spk\":\n this.tryAppendQueryParameter(queries, param, this.startPartitionKey);\n break;\n case \"srk\":\n this.tryAppendQueryParameter(queries, param, this.startRowKey);\n break;\n case \"epk\":\n this.tryAppendQueryParameter(queries, param, this.endPartitionKey);\n break;\n case \"erk\":\n this.tryAppendQueryParameter(queries, param, this.endRowKey);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n\n/**\n * Options to construct {@link SasQueryParameters}.\n */\nexport interface SasQueryParametersOptions {\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n permissions?: string;\n /**\n * Optional. Table name to generate the SAS for\n */\n tableName?: string;\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n services?: string;\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n resourceTypes?: string;\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n protocol?: SasProtocol;\n /**\n * Optional. The start time for this SAS token.\n */\n startsOn?: Date;\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n expiresOn?: Date;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n /**\n * Optional. The signed identifier for access policy\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n /**\n * Optional. Specifies which resources are accessible via the SAS (only for {@link AccountSasSignatureValues}).\n * @see https://docs.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only\n */\n resource?: string;\n /**\n * User delegation key properties.\n */\n userDelegationKey?: UserDelegationKey;\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This cannot be used in conjuction with {@link signedUnauthorizedUserObjectId}.\n * This is only used for User Delegation SAS.\n */\n preauthorizedAgentObjectId?: string;\n /**\n * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access.\n * This is only used for User Delegation SAS.\n */\n correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endRowKey?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sasQueryParameters.js","sourceRoot":"","sources":["../../../src/sas/sasQueryParameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAOvE;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAwI7B;;;;OAIG;IACH,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;gBAC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,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { SasIPRange } from \"./sasIPRange.js\";\nimport { ipRangeToString } from \"./sasIPRange.js\";\nimport type { UserDelegationKey } from \"./models.js\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date.js\";\n\n/**\n * Protocols for generated SAS.\n */\nexport type SasProtocol = \"https\" | \"https,http\";\n\n/**\n * Represents the components that make up an Azure SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSasSignatureValues} and {@link TableSasSignatureValues}\n * types. Once generated, it can be encoded into a `string` and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SasQueryParameters {\n /**\n * The Tables API version.\n */\n public readonly version: string;\n\n /**\n * Optional. Table name to generate the SAS for\n */\n public readonly tableName?: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SasProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The table services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The table resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link TableSasSignatureValues}).\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * The Azure Active Directory object ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedOid?: string;\n\n /**\n * The Azure Active Directory tenant ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedTenantId?: string;\n\n /**\n * The date-time the key is active.\n * Property of user delegation key.\n */\n private readonly signedStartsOn?: Date;\n\n /**\n * The date-time the key expires.\n * Property of user delegation key.\n */\n private readonly signedExpiresOn?: Date;\n\n /**\n * Abbreviation of the Azure Table service that accepts the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedService?: string;\n\n /**\n * The service version that created the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedVersion?: string;\n\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This is only used for User Delegation SAS.\n */\n public readonly preauthorizedAgentObjectId?: string;\n\n /**\n * A GUID value that will be logged in the table diagnostic logs and can be used to correlate SAS generation with table resource access.\n * This is only used for User Delegation SAS.\n */\n public readonly correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endRowKey?: string;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the table service version\n * @param signature - Representing the signature for the SAS token\n * @param options - Optional. Options to construct the SASQueryParameters.\n */\n constructor(version: string, signature: string, options: SasQueryParametersOptions = {}) {\n this.version = version;\n this.signature = signature;\n\n this.permissions = options.permissions;\n this.services = options.services;\n this.resourceTypes = options.resourceTypes;\n this.protocol = options.protocol;\n this.startsOn = options.startsOn;\n this.expiresOn = options.expiresOn;\n this.ipRangeInner = options.ipRange;\n this.identifier = options.identifier;\n this.tableName = options.tableName;\n this.endPartitionKey = options.endPartitionKey;\n this.endRowKey = options.endRowKey;\n this.startPartitionKey = options.startPartitionKey;\n this.startRowKey = options.startRowKey;\n\n if (options.userDelegationKey) {\n this.signedOid = options.userDelegationKey.signedObjectId;\n this.signedTenantId = options.userDelegationKey.signedTenantId;\n this.signedStartsOn = options.userDelegationKey.signedStartsOn;\n this.signedExpiresOn = options.userDelegationKey.signedExpiresOn;\n this.signedService = options.userDelegationKey.signedService;\n this.signedVersion = options.userDelegationKey.signedVersion;\n\n this.preauthorizedAgentObjectId = options.preauthorizedAgentObjectId;\n this.correlationId = options.correlationId;\n }\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\n \"sv\", // SignedVersion\n \"ss\", // SignedServices\n \"srt\", // SignedResourceTypes\n \"spr\", // SignedProtocol\n \"st\", // SignedStart\n \"se\", // SignedExpiry\n \"sip\", // SignedIP\n \"si\", // SignedIdentifier\n \"skoid\", // Signed object ID\n \"sktid\", // Signed tenant ID\n \"skt\", // Signed key start time\n \"ske\", // Signed key expiry time\n \"sks\", // Signed key service\n \"skv\", // Signed key version\n \"sr\", // signedResource\n \"sp\", // SignedPermission\n \"sig\", // Signature\n \"rscc\", // Cache-Control\n \"rscd\", // Content-Disposition\n \"rsce\", // Content-Encoding\n \"rscl\", // Content-Language\n \"rsct\", // Content-Type\n \"saoid\", // signedAuthorizedObjectId\n \"scid\", // signedCorrelationId\n \"tn\", // TableName,\n \"srk\", // StartRowKey\n \"spk\", // StartPartitionKey\n \"epk\", // EndPartitionKey\n \"erk\", // EndRowKey\n ];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"skoid\": // Signed object ID\n this.tryAppendQueryParameter(queries, param, this.signedOid);\n break;\n case \"sktid\": // Signed tenant ID\n this.tryAppendQueryParameter(queries, param, this.signedTenantId);\n break;\n case \"skt\": // Signed key start time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined,\n );\n break;\n case \"ske\": // Signed key expiry time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : undefined,\n );\n break;\n case \"sks\": // Signed key service\n this.tryAppendQueryParameter(queries, param, this.signedService);\n break;\n case \"skv\": // Signed key version\n this.tryAppendQueryParameter(queries, param, this.signedVersion);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"saoid\":\n this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);\n break;\n case \"scid\":\n this.tryAppendQueryParameter(queries, param, this.correlationId);\n break;\n case \"tn\":\n this.tryAppendQueryParameter(queries, param, this.tableName);\n break;\n case \"spk\":\n this.tryAppendQueryParameter(queries, param, this.startPartitionKey);\n break;\n case \"srk\":\n this.tryAppendQueryParameter(queries, param, this.startRowKey);\n break;\n case \"epk\":\n this.tryAppendQueryParameter(queries, param, this.endPartitionKey);\n break;\n case \"erk\":\n this.tryAppendQueryParameter(queries, param, this.endRowKey);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n\n/**\n * Options to construct {@link SasQueryParameters}.\n */\nexport interface SasQueryParametersOptions {\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n permissions?: string;\n /**\n * Optional. Table name to generate the SAS for\n */\n tableName?: string;\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n services?: string;\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n resourceTypes?: string;\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n protocol?: SasProtocol;\n /**\n * Optional. The start time for this SAS token.\n */\n startsOn?: Date;\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n expiresOn?: Date;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n /**\n * Optional. The signed identifier for access policy\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n /**\n * Optional. Specifies which resources are accessible via the SAS (only for {@link AccountSasSignatureValues}).\n * @see https://learn.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only\n */\n resource?: string;\n /**\n * User delegation key properties.\n */\n userDelegationKey?: UserDelegationKey;\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This cannot be used in conjuction with {@link signedUnauthorizedUserObjectId}.\n * This is only used for User Delegation SAS.\n */\n preauthorizedAgentObjectId?: string;\n /**\n * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access.\n * This is only used for User Delegation SAS.\n */\n correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endRowKey?: string;\n}\n"]}
|
|
@@ -45,7 +45,7 @@ export interface TableSasSignatureValues {
|
|
|
45
45
|
/**
|
|
46
46
|
* Optional. The name of the access policy on the container this SAS references if any.
|
|
47
47
|
*
|
|
48
|
-
* @see https://
|
|
48
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy
|
|
49
49
|
*/
|
|
50
50
|
identifier?: string;
|
|
51
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableSasSignatureValues.js","sourceRoot":"","sources":["../../../src/sas/tableSasSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AA8EvE;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAC7C,SAAiB,EACjB,UAA8B,EAC9B,uBAAgD;;IAEhD,MAAM,OAAO,GAAG,MAAA,uBAAuB,CAAC,OAAO,mCAAI,eAAe,CAAC;IAEnE,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC3F,MAAM,WAAW,GAAG,uB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,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,SAAS,EAAE,uBAAuB,CAAC,SAAS;QAC5C,OAAO,EAAE,uBAAuB,CAAC,OAAO;QACxC,UAAU,EAAE,uBAAuB,CAAC,UAAU;QAC9C,SAAS;QACT,iBAAiB,EAAE,uBAAuB,CAAC,iBAAiB;QAC5D,WAAW,EAAE,uBAAuB,CAAC,WAAW;QAChD,eAAe,EAAE,uBAAuB,CAAC,eAAe;QACxD,SAAS,EAAE,uBAAuB,CAAC,SAAS;KAC7C,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAC9D,yHAAyH;IACzH,yDAAyD;IACzD,OAAO,UAAU,WAAW,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating SAS tokens for tables.\n */\n\nimport type { SasIPRange } from \"./sasIPRange.js\";\nimport { ipRangeToString } from \"./sasIPRange.js\";\nimport type { SasProtocol } from \"./sasQueryParameters.js\";\nimport { SasQueryParameters } from \"./sasQueryParameters.js\";\nimport type { TableSasPermissions } from \"./tableSasPermisions.js\";\nimport { tableSasPermissionsToString } from \"./tableSasPermisions.js\";\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport { SERVICE_VERSION } from \"../utils/constants.js\";\nimport { computeHMACSHA256 } from \"../utils/computeHMACSHA256.js\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating Table service SAS tokens for tables\n */\nexport interface TableSasSignatureValues {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SasProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of one hour from the time the token is generated.\n * The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of \"read\"\n * Please refer to {@link TableSasPermissions} depending on the resource\n * being accessed for help constructing the permissions string.\n */\n permissions?: TableSasPermissions;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the container this SAS references if any.\n *\n * @see https://
|
|
1
|
+
{"version":3,"file":"tableSasSignatureValues.js","sourceRoot":"","sources":["../../../src/sas/tableSasSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AA8EvE;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAC7C,SAAiB,EACjB,UAA8B,EAC9B,uBAAgD;;IAEhD,MAAM,OAAO,GAAG,MAAA,uBAAuB,CAAC,OAAO,mCAAI,eAAe,CAAC;IAEnE,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED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AAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAElE,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE;QAChD,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,SAAS,EAAE,uBAAuB,CAAC,SAAS;QAC5C,OAAO,EAAE,uBAAuB,CAAC,OAAO;QACxC,UAAU,EAAE,uBAAuB,CAAC,UAAU;QAC9C,SAAS;QACT,iBAAiB,EAAE,uBAAuB,CAAC,iBAAiB;QAC5D,WAAW,EAAE,uBAAuB,CAAC,WAAW;QAChD,eAAe,EAAE,uBAAuB,CAAC,eAAe;QACxD,SAAS,EAAE,uBAAuB,CAAC,SAAS;KAC7C,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAC9D,yHAAyH;IACzH,yDAAyD;IACzD,OAAO,UAAU,WAAW,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating SAS tokens for tables.\n */\n\nimport type { SasIPRange } from \"./sasIPRange.js\";\nimport { ipRangeToString } from \"./sasIPRange.js\";\nimport type { SasProtocol } from \"./sasQueryParameters.js\";\nimport { SasQueryParameters } from \"./sasQueryParameters.js\";\nimport type { TableSasPermissions } from \"./tableSasPermisions.js\";\nimport { tableSasPermissionsToString } from \"./tableSasPermisions.js\";\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport { SERVICE_VERSION } from \"../utils/constants.js\";\nimport { computeHMACSHA256 } from \"../utils/computeHMACSHA256.js\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating Table service SAS tokens for tables\n */\nexport interface TableSasSignatureValues {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SasProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of one hour from the time the token is generated.\n * The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of \"read\"\n * Please refer to {@link TableSasPermissions} depending on the resource\n * being accessed for help constructing the permissions string.\n */\n permissions?: TableSasPermissions;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the container this SAS references if any.\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n\n /**\n * Define the start of a Partition Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n startPartitionKey?: string;\n /**\n * Define the end of a Partition Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n endPartitionKey?: string;\n /**\n * Define the start of a Row Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n startRowKey?: string;\n /**\n * Define the end of a Row Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n endRowKey?: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates an instance of SASQueryParameters.\n *\n * **Note**: When identifier is not provided, permissions has a default value of \"read\" and expiresOn of one hour from the time the token is generated.\n */\nexport function generateTableSasQueryParameters(\n tableName: string,\n credential: NamedKeyCredential,\n tableSasSignatureValues: TableSasSignatureValues,\n): SasQueryParameters {\n const version = tableSasSignatureValues.version ?? SERVICE_VERSION;\n\n if (credential === undefined) {\n throw TypeError(\"Invalid NamedKeyCredential\");\n }\n\n if (!tableName) {\n throw new Error(\"Must provide a 'tableName'\");\n }\n\n const signedPermissions = tableSasPermissionsToString(tableSasSignatureValues.permissions);\n const signedStart = tableSasSignatureValues.startsOn\n ? truncatedISO8061Date(tableSasSignatureValues.startsOn, false /** withMilliseconds */)\n : \"\";\n const signedExpiry = tableSasSignatureValues.expiresOn\n ? truncatedISO8061Date(tableSasSignatureValues.expiresOn, false /** withMilliseconds */)\n : \"\";\n const canonicalizedResource = getCanonicalName(credential.name, tableName);\n const signedIdentifier = tableSasSignatureValues.identifier ?? \"\";\n const signedIP = ipRangeToString(tableSasSignatureValues.ipRange);\n const signedProtocol = tableSasSignatureValues.protocol || \"\";\n const startingPartitionKey = tableSasSignatureValues.startPartitionKey ?? \"\";\n const startingRowKey = tableSasSignatureValues.startRowKey ?? \"\";\n const endingPartitionKey = tableSasSignatureValues.endPartitionKey ?? \"\";\n const endingRowKey = tableSasSignatureValues.endRowKey ?? \"\";\n\n const stringToSign = [\n signedPermissions,\n signedStart,\n signedExpiry,\n canonicalizedResource,\n signedIdentifier,\n signedIP,\n signedProtocol,\n version,\n startingPartitionKey,\n startingRowKey,\n endingPartitionKey,\n endingRowKey,\n ].join(\"\\n\");\n\n const signature = computeHMACSHA256(stringToSign, credential.key);\n\n return new SasQueryParameters(version, signature, {\n permissions: signedPermissions,\n protocol: tableSasSignatureValues.protocol,\n startsOn: tableSasSignatureValues.startsOn,\n expiresOn: tableSasSignatureValues.expiresOn,\n ipRange: tableSasSignatureValues.ipRange,\n identifier: tableSasSignatureValues.identifier,\n tableName,\n startPartitionKey: tableSasSignatureValues.startPartitionKey,\n startRowKey: tableSasSignatureValues.startRowKey,\n endPartitionKey: tableSasSignatureValues.endPartitionKey,\n endRowKey: tableSasSignatureValues.endRowKey,\n });\n}\n\nfunction getCanonicalName(accountName: string, tableName: string): string {\n // Sample CanonicalName for URL = https://myaccount.table.core.windows.net/Employees(PartitionKey='Jeff',RowKey='Price'):\n // canonicalizedResource = \"/table/myaccount/employees\"\n return `/table/${accountName}/${tableName.toLowerCase()}`;\n}\n"]}
|
|
@@ -49,7 +49,7 @@ function getHeaderValueToSign(request, headerName) {
|
|
|
49
49
|
return value;
|
|
50
50
|
}
|
|
51
51
|
function getCanonicalizedResourceString(request, credential) {
|
|
52
|
-
// https://
|
|
52
|
+
// https://learn.microsoft.com/rest/api/storageservices/authorize-with-shared-key#shared-key-lite-and-table-service-format-for-2009-09-19-and-later
|
|
53
53
|
const url = new URL(request.url);
|
|
54
54
|
const path = url.pathname || "/";
|
|
55
55
|
let canonicalizedResourceString = "/" + credential.name + path;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tablesNamedCredentialPolicy.js","sourceRoot":"","sources":["../../src/tablesNamedCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,gCAAgC,CAAC;AAEnF;;GAEG;AACH,MAAM,UAAU,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CAAC;AACf,CAAC;AAED,SAAS,8BAA8B,CACrC,OAAwB,EACxB,UAA8B;IAE9B,mJAAmJ;IACnJ,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC;IACjC,IAAI,2BAA2B,GAAG,GAAG,GAAG,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;IAE/D,sKAAsK;IACtK,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAI,IAAI,EAAE,CAAC;QACT,2BAA2B,GAAG,GAAG,2BAA2B,SAAS,IAAI,EAAE,CAAC;IAC9E,CAAC;IAED,OAAO,2BAA2B,CAAC;AACrC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { HeaderConstants } from \"./utils/constants.js\";\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport { computeHMACSHA256 } from \"./utils/computeHMACSHA256.js\";\n\n/**\n * The programmatic identifier of the tablesNamedKeyCredentialPolicy.\n */\nexport const tablesNamedKeyCredentialPolicyName = \"tablesNamedKeyCredentialPolicy\";\n\n/**\n * tablesNamedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key.\n */\nexport function tablesNamedKeyCredentialPolicy(credential: NamedKeyCredential): PipelinePolicy {\n function signRequest(request: PipelineRequest): void {\n const headerValue = getAuthorizationHeader(request, credential);\n request.headers.set(HeaderConstants.AUTHORIZATION, headerValue);\n }\n\n return {\n name: tablesNamedKeyCredentialPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n signRequest(request);\n return next(request);\n },\n };\n}\n\nexport function getAuthorizationHeader(\n request: PipelineRequest,\n credential: NamedKeyCredential,\n): string {\n if (!request.headers.has(HeaderConstants.X_MS_DATE)) {\n request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());\n }\n\n if (request.body && typeof request.body === \"string\" && request.body.length > 0) {\n request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));\n }\n\n // If x-ms-date is present, use it otherwise date\n const dateHeader = getHeaderValueToSign(request, HeaderConstants.X_MS_DATE);\n\n if (!dateHeader) {\n throw new Error(\"Failed to sign request: x-ms-date or date header must be present\");\n }\n\n const stringToSign: string = [\n dateHeader,\n getCanonicalizedResourceString(request, credential),\n ].join(\"\\n\");\n\n const signature = computeHMACSHA256(stringToSign, credential.key);\n\n return `SharedKeyLite ${credential.name}:${signature}`;\n}\n\nfunction getHeaderValueToSign(request: PipelineRequest, headerName: string): string {\n const value = request.headers.get(headerName);\n\n if (!value) {\n return \"\";\n }\n return value;\n}\n\nfunction getCanonicalizedResourceString(\n request: PipelineRequest,\n credential: NamedKeyCredential,\n): string {\n // https://learn.microsoft.com/rest/api/storageservices/authorize-with-shared-key#shared-key-lite-and-table-service-format-for-2009-09-19-and-later\n const url = new URL(request.url);\n const path = url.pathname || \"/\";\n let canonicalizedResourceString = \"/\" + credential.name + path;\n\n // The query string should include the question mark and the comp parameter (for example, ?comp=metadata). No other parameters should be included on the query string.\n const comp = url.searchParams.get(\"comp\");\n\n if (comp) {\n canonicalizedResourceString = `${canonicalizedResourceString}?comp=${comp}`;\n }\n\n return canonicalizedResourceString;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/data-tables",
|
|
3
|
-
"version": "13.3.1-alpha.
|
|
3
|
+
"version": "13.3.1-alpha.20250110.1",
|
|
4
4
|
"description": "An isomorphic client library for the Azure Tables service.",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"azure-table-storage"
|
|
89
89
|
],
|
|
90
90
|
"requiredResources": {
|
|
91
|
-
"Azure Storage instance": "https://
|
|
91
|
+
"Azure Storage instance": "https://learn.microsoft.com/azure/storage/tables/table-storage-quickstart-portal"
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"//metadata": {
|