Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
35eb6c0
Remove SAS generation methods from Azure Blob clients
alzimmermsft Oct 1, 2019
6baef0a
Add some resource type logic to BlobServiceSASSignatureValues
alzimmermsft Oct 1, 2019
c046ba2
Fix failing test
alzimmermsft Oct 1, 2019
50766c6
Removed SAS token method in File clients
alzimmermsft Oct 1, 2019
7da16db
Removed SAS token methods in Queue clients
alzimmermsft Oct 1, 2019
7cdf2bf
Merge branch 'master' into AzStorage_RemoveClientSasMethods
alzimmermsft Oct 1, 2019
b66fd2a
Fixing some more tests
alzimmermsft Oct 2, 2019
8071857
Merged in master
alzimmermsft Oct 2, 2019
4019a46
Fix Javadoc links
alzimmermsft Oct 2, 2019
f50ccee
Merge branch 'master' into AzStorage_RemoveClientSasMethods
alzimmermsft Oct 2, 2019
f8fade5
Fixing linting issues, prototyping BlobSasConstructor
alzimmermsft Oct 2, 2019
9b7362c
Minor refactoring in new class
alzimmermsft Oct 2, 2019
c0f968c
Merged in master
alzimmermsft Oct 3, 2019
861abef
Merge branch 'master' into AzStorage_RemoveClientSasMethods
alzimmermsft Oct 3, 2019
3736fb0
Re-record failing tests
alzimmermsft Oct 3, 2019
db93d7b
Merge branch 'master' into AzStorage_RemoveClientSasMethods
alzimmermsft Oct 3, 2019
d865559
Fix checkstyle issues
alzimmermsft Oct 3, 2019
e8e5e2e
Fix accidentally method name change
alzimmermsft Oct 3, 2019
1708e54
Fix javadoc issue
alzimmermsft Oct 3, 2019
17839e3
Merged in master
alzimmermsft Oct 3, 2019
63f2ad8
Cleanup checkstyle issues
alzimmermsft Oct 3, 2019
879172b
Merge branch 'master' into AzStorage_RemoveClientSasMethods
alzimmermsft Oct 4, 2019
f6eb821
Merged in master, fixed unit test
alzimmermsft Oct 4, 2019
63050e0
Make SAS generation classes public API
alzimmermsft Oct 4, 2019
83e6185
Merge branch 'master' into AzStorage_RemoveClientSasMethods
alzimmermsft Oct 4, 2019
6b1755a
Fixing checkstyle issues
alzimmermsft Oct 4, 2019
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@
import com.azure.storage.blob.models.StorageServiceProperties;
import com.azure.storage.blob.models.StorageServiceStats;
import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.common.AccountSASPermission;
import com.azure.storage.common.AccountSASResourceType;
import com.azure.storage.common.AccountSASService;
import com.azure.storage.common.AccountSASSignatureValues;
import com.azure.storage.common.IPRange;
import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import reactor.core.publisher.Mono;

import java.net.MalformedURLException;
Expand Down Expand Up @@ -457,51 +450,4 @@ Mono<Response<StorageAccountInfo>> getAccountInfoWithResponse(Context context) {
return postProcessResponse(this.azureBlobStorage.services().getAccountInfoWithRestResponseAsync(context))
.map(rb -> new SimpleResponse<>(rb, new StorageAccountInfo(rb.getDeserializedHeaders())));
}

/**
* Generates an account SAS token with the specified parameters
*
* @param accountSASService The {@code AccountSASService} services for the account SAS
* @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
* @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
* @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
* @return A string that represents the SAS token
*/
public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
AccountSASPermission accountSASPermission, OffsetDateTime expiryTime) {
return this.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime,
null /* startTime */, null /* version */, null /* ipRange */, null /* sasProtocol */);
}

/**
* Generates an account SAS token with the specified parameters
*
* <p><strong>Code Samples</strong></p>
*
* {@codesnippet com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol}
*
* <p>For more information, see the
* <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas">Azure Docs</a></p>
*
* @param accountSASService The {@code AccountSASService} services for the account SAS
* @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
* @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
* @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
* @param startTime The {@code OffsetDateTime} start time for the account SAS
* @param version The {@code String} version for the account SAS
* @param ipRange An optional {@code IPRange} ip address range for the SAS
* @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
* @return A string that represents the SAS token
*/
public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
IPRange ipRange, SASProtocol sasProtocol) {

SharedKeyCredential sharedKeyCredential =
Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline());
Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);

return AccountSASSignatureValues.generateAccountSAS(sharedKeyCredential, accountSASService,
accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
import com.azure.storage.blob.models.StorageServiceProperties;
import com.azure.storage.blob.models.StorageServiceStats;
import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.common.AccountSASPermission;
import com.azure.storage.common.AccountSASResourceType;
import com.azure.storage.common.AccountSASService;
import com.azure.storage.common.IPRange;
import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;

Expand Down Expand Up @@ -361,46 +356,4 @@ public Response<StorageAccountInfo> getAccountInfoWithResponse(Duration timeout,

return Utility.blockWithOptionalTimeout(response, timeout);
}

/**
* Generates an account SAS token with the specified parameters
*
* @param accountSASService The {@code AccountSASService} services for the account SAS
* @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
* @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
* @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
* @return A string that represents the SAS token
*/
public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
AccountSASPermission accountSASPermission, OffsetDateTime expiryTime) {
return this.blobServiceAsyncClient.generateAccountSAS(accountSASService, accountSASResourceType,
accountSASPermission, expiryTime);
}

/**
* Generates an account SAS token with the specified parameters
*
* <p><strong>Code Samples</strong></p>
*
* {@codesnippet com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol}
*
* <p>For more information, see the
* <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas">Azure Docs</a></p>
*
* @param accountSASService The {@code AccountSASService} services for the account SAS
* @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
* @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
* @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
* @param startTime The {@code OffsetDateTime} start time for the account SAS
* @param version The {@code String} version for the account SAS
* @param ipRange An optional {@code IPRange} ip address range for the SAS
* @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
* @return A string that represents the SAS token
*/
public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
IPRange ipRange, SASProtocol sasProtocol) {
return this.blobServiceAsyncClient.generateAccountSAS(accountSASService, accountSASResourceType,
accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol);
}
}
Loading