Skip to content

Commit 19a7ce9

Browse files
committed
Cleaned up string to sign
1 parent 463d167 commit 19a7ce9

File tree

4 files changed

+23
-47
lines changed

4 files changed

+23
-47
lines changed

sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,11 @@ public class QueueSasBuilder
9393
public string QueueName { get; set; }
9494

9595
/// <summary>
96-
/// Optional. Beginning in version 2020-02-10, this value will be used for
97-
/// the AAD Object ID of a user authorized by the owner of the
98-
/// User Delegation Key to perform the action granted by the SAS.
99-
/// The Azure Storage service will ensure that the owner of the
100-
/// user delegation key has the required permissions before granting access.
101-
/// No additional permission check for the user specified in this value will be performed.
102-
/// This is only used with generating User Delegation SAS.
96+
/// Optional. Beginning in version 2025-07-05, this value specifies the Entra ID of the user would is authorized to
97+
/// use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been
98+
/// issued to the user specified in this value.
10399
/// </summary>
104-
public string PreauthorizedAgentObjectId { get; set; }
100+
public string DelegatedUserObjectId { get; set; }
105101

106102
/// <summary>
107103
/// Initializes a new instance of the <see cref="QueueSasBuilder"/>
@@ -348,15 +344,8 @@ public QueueSasQueryParameters ToSasQueryParameters(UserDelegationKey userDelega
348344
keyExpiry: userDelegationKey.SignedExpiresOn,
349345
keyService: userDelegationKey.SignedService,
350346
keyVersion: userDelegationKey.SignedVersion,
351-
signature: signature,
352-
cacheControl: null, // CacheControl,
353-
contentDisposition: null, // ContentDisposition,
354-
contentEncoding: null, // ContentEncoding,
355-
contentLanguage: null, // ContentLanguage,
356-
contentType: null, // ContentType,
357-
authorizedAadObjectId: PreauthorizedAgentObjectId,
358-
correlationId: null, //CorrelationId,
359-
encryptionScope: null /*EncryptionScope*/);
347+
delegatedUserObjectId: DelegatedUserObjectId,
348+
signature: signature);
360349
return p;
361350
}
362351

@@ -379,16 +368,10 @@ private string ToStringToSign(UserDelegationKey userDelegationKey, string accoun
379368
signedExpiry,
380369
userDelegationKey.SignedService,
381370
userDelegationKey.SignedVersion,
382-
PreauthorizedAgentObjectId,
383-
null, // AgentObjectId - enabled only in HNS accounts
384-
null, // CorrelationId
385371
null, // SignedKeyDelegatedUserTenantId, will be added in a future release.
386-
//null, // SignedDelegatedUserObjectId, will be added in future release.
387-
//IPRange.ToString(),
388-
//SasExtensions.ToProtocolString(Protocol),
389-
//null, // Unknown
390-
//null, // Unknown
391-
//null, // Unknown
372+
DelegatedUserObjectId,
373+
IPRange.ToString(),
374+
SasExtensions.ToProtocolString(Protocol),
392375
Version);
393376
}
394377

sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasQueryParameters.cs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,7 @@ internal QueueSasQueryParameters(
8282
DateTimeOffset keyExpiry = default,
8383
string keyService = default,
8484
string keyVersion = default,
85-
string cacheControl = default,
86-
string contentDisposition = default,
87-
string contentEncoding = default,
88-
string contentLanguage = default,
89-
string contentType = default,
90-
string authorizedAadObjectId = default,
91-
string unauthorizedAadObjectId = default,
92-
string correlationId = default,
93-
string encryptionScope = default)
85+
string delegatedUserObjectId = default)
9486
: base(
9587
version,
9688
services,
@@ -103,16 +95,17 @@ internal QueueSasQueryParameters(
10395
resource,
10496
permissions,
10597
signature,
106-
cacheControl,
107-
contentDisposition,
108-
contentEncoding,
109-
contentLanguage,
110-
contentType,
111-
authorizedAadObjectId,
112-
unauthorizedAadObjectId,
113-
correlationId,
98+
cacheControl: null,
99+
contentDisposition: null,
100+
contentEncoding: null,
101+
contentLanguage: null,
102+
contentType: null,
103+
authorizedAadObjectId: null,
104+
unauthorizedAadObjectId: null,
105+
correlationId: null,
114106
directoryDepth: null,
115-
encryptionScope)
107+
encryptionScope: null,
108+
delegatedUserObjectId)
116109
{
117110
KeyProperties = new UserDelegationKeyProperties
118111
{

sdk/storage/Azure.Storage.Queues/tests/QueueClientTestFixtureAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public QueueClientTestFixtureAttribute(params object[] additionalParameters)
4646
},
4747
additionalParameters: additionalParameters)
4848
{
49-
RecordingServiceVersion = QueueClientOptions.ServiceVersion.V2025_05_05;
50-
LiveServiceVersions = new object[] { QueueClientOptions.ServiceVersion.V2025_07_05, };
49+
RecordingServiceVersion = StorageVersionExtensions.MaxVersion;
50+
LiveServiceVersions = new object[] { StorageVersionExtensions.MaxVersion };
5151
}
5252
}
5353
}

sdk/storage/Azure.Storage.Queues/tests/QueueClientTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ public async Task SendMessageAsync_SAS()
12871287
}
12881288

12891289
[RecordedTest]
1290-
//[ServiceVersion(Min = QueueClientOptions.ServiceVersion.V2026_02_06)]
1290+
[ServiceVersion(Min = QueueClientOptions.ServiceVersion.V2026_02_06)]
12911291
public async Task SendMessageAsync_UserDelegationSAS()
12921292
{
12931293
// Arrange

0 commit comments

Comments
 (0)