Skip to content
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

Feature/storage/blob access policy bug #14872

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/storage/Azure.Storage.Blobs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 12.7.0-preview.1 (Unreleased)
- Fixed bug where Stream returned from AppendBlobClient.OpenWrite(), BlockBlobClient.OpenWrite() and PageBlobClient.OpenWrite() did not flush while disposing preventing compatibility with using keyword.
- Fixed bug where Listing Blobs with BlobTraits.Metadata would return BlobItems with null metadata instead of an empty dictionary if no metadata was present.
- Fixed bug where BlobAccessPolicy.StartsOn and .ExpiresOn would cause the process to crash.

## 12.6.0 (2020-08-31)
- Fixed bug where BlobClient.Upload(), BlockBlobClient.Upload(), AppendBlobClient.AppendBlock(), and PageBlobClient.UploadPages() would deadlock if the content stream's position was not 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public System.DateTimeOffset StartsOn
get
{
return PolicyStartsOn == default ?
StartsOn :
(DateTimeOffset)PolicyStartsOn;
new DateTimeOffset() :
PolicyStartsOn.Value;
}
set
{
Expand All @@ -42,8 +42,8 @@ public System.DateTimeOffset ExpiresOn
get
{
return PolicyExpiresOn == default ?
ExpiresOn :
(DateTimeOffset)PolicyExpiresOn;
new DateTimeOffset() :
PolicyExpiresOn.Value;
}
set
{
Expand Down
12 changes: 12 additions & 0 deletions sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,18 @@ await test.Container.SetAccessPolicyAsync(
Assert.AreEqual(signedIdentifiers[0].AccessPolicy.Permissions, acl.AccessPolicy.Permissions);
}

[Test]
public void BlobAccessPolicyNullStartsOnExpiresOnTest()
{
BlobAccessPolicy accessPolicy = new BlobAccessPolicy()
{
Permissions = "rw"
};

Assert.AreEqual(new DateTimeOffset(), accessPolicy.StartsOn);
Assert.AreEqual(new DateTimeOffset(), accessPolicy.ExpiresOn);
}

[Test]
public async Task SetAccessPolicyAsync_OldProperties()
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.