Package com.azure.storage.common.sas
Class AccountSasSignatureValues
java.lang.Object
com.azure.storage.common.sas.AccountSasSignatureValues
Used to initialize parameters for a Shared Access Signature (SAS) for an Azure Storage account. Once all the
values here are set, use the generateSas method on the desired service client to obtain a representation of the SAS
which can then be applied to a new client using the .sasToken(String) method on the desired client builder.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.AccountSasSignatureValues(OffsetDateTime expiryTime, AccountSasPermission permissions, AccountSasService services, AccountSasResourceType resourceTypes) Initializes a newAccountSasSignatureValuesobject. -
Method Summary
Modifier and TypeMethodDescriptiongenerateSasQueryParameters(StorageSharedKeyCredential storageSharedKeyCredentials) Deprecated.Please use the generateAccountSas(AccountSasSignatureValues) method on the desired service client after initializingAccountSasSignatureValues.Gets the encryption scope that will be applied to any write operations performed with the sasGets the time after which the SAS will no longer work.Gets the operations the SAS user may perform.Gets theSasProtocolwhich determines the HTTP protocol that will be used.Gets the resource types accessible with this SAS.Gets theSasIpRangewhich determines the IP ranges that are allowed to use the SAS.Gets the services accessible with this SAS.Gets when the SAS will take effect.Gets the service version that is targeted, ifnullor empty the latest service version targeted by the library will be used.setEncryptionScope(String encryptionScope) Sets the encryption scope that will be applied to any write operations performed with the sassetExpiryTime(OffsetDateTime expiryTime) Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the expiry time.setPermissions(AccountSasPermission permissions) Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the allowed permissions.setProtocol(SasProtocol protocol) Sets theSasProtocolwhich determines the HTTP protocol that will be used.setResourceTypes(String resourceTypes) Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the resource types being targeted.setSasIpRange(SasIpRange sasIpRange) Sets theSasIpRangewhich determines the IP ranges that are allowed to use the SAS.setServices(String services) Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the services being targeted.setStartTime(OffsetDateTime startTime) Sets when the SAS will take effect.setVersion(String version) Deprecated.The version is set to the latest version of sas.
-
Constructor Details
-
AccountSasSignatureValues
Deprecated.Initializes a newAccountSasSignatureValuesobject. -
AccountSasSignatureValues
public AccountSasSignatureValues(OffsetDateTime expiryTime, AccountSasPermission permissions, AccountSasService services, AccountSasResourceType resourceTypes) Initializes a newAccountSasSignatureValuesobject.- Parameters:
expiryTime- The time after which the SAS will no longer work.permissions-AccountSasPermissionallowed by the SAS.services-AccountSasServicetargeted by the SAS.resourceTypes-AccountSasResourceTypetargeted by the SAS.
-
-
Method Details
-
getVersion
Gets the service version that is targeted, ifnullor empty the latest service version targeted by the library will be used.- Returns:
- the service version that is targeted, if
nullor empty the latest service version targeted by the library will be used.
-
setVersion
Deprecated.The version is set to the latest version of sas. Users should stop calling this API as it is now treated as a no-op.Sets the service version that is targeted. Leave thisnullor empty to target the version used by the library.- Parameters:
version- Target version to set- Returns:
- the updated AccountSasSignatureValues object.
-
getProtocol
Gets theSasProtocolwhich determines the HTTP protocol that will be used.- Returns:
- the
SasProtocolwhich determines the HTTP protocol that will be used.
-
setProtocol
Sets theSasProtocolwhich determines the HTTP protocol that will be used.- Parameters:
protocol- Protocol to set- Returns:
- the updated AccountSasSignatureValues object.
-
getStartTime
Gets when the SAS will take effect.- Returns:
- when the SAS will take effect.
-
setStartTime
Sets when the SAS will take effect.- Parameters:
startTime- Start time to set- Returns:
- the updated AccountSasSignatureValues object.
-
getExpiryTime
Gets the time after which the SAS will no longer work.- Returns:
- the time after which the SAS will no longer work.
-
setExpiryTime
Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the expiry time.Sets the time after which the SAS will no longer work.- Parameters:
expiryTime- Expiry time to set- Returns:
- the updated AccountSasSignatureValues object.
-
getPermissions
Gets the operations the SAS user may perform.- Returns:
- The operations the SAS user may perform. Please refer to
AccountSasPermissionto help determine which permissions are allowed.
-
setPermissions
Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the allowed permissions.Sets the operations the account SAS user may perform. Please refer toAccountSasPermissionfor help constructing the permissions string.- Parameters:
permissions- Permissions to set.- Returns:
- the updated AccountSasSignatureValues object.
- Throws:
NullPointerException- ifpermissionsis null.
-
getSasIpRange
Gets theSasIpRangewhich determines the IP ranges that are allowed to use the SAS.- Returns:
- the
SasIpRangewhich determines the IP ranges that are allowed to use the SAS.
-
setSasIpRange
Sets theSasIpRangewhich determines the IP ranges that are allowed to use the SAS.- Parameters:
sasIpRange- Allowed IP range to set- Returns:
- the updated AccountSasSignatureValues object.
- See Also:
-
getServices
Gets the services accessible with this SAS. Please refer toAccountSasServiceto help determine which services are accessible.- Returns:
- the services accessible with this SAS. Please refer to
AccountSasServiceto help determine which services are accessible.
-
setServices
Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the services being targeted.Sets the services accessible with this SAS. Please refer toAccountSasServiceto construct this value.- Parameters:
services- Allowed services string to set- Returns:
- the updated AccountSasSignatureValues object.
-
getResourceTypes
Gets the resource types accessible with this SAS. Please refer toAccountSasResourceTypeto help determine the resource types that are accessible.- Returns:
- the resource types accessible with this SAS. Please refer to
AccountSasResourceTypeto help determine the resource types that are accessible.
-
setResourceTypes
Deprecated.Please useAccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)to specify the resource types being targeted.Sets the resource types accessible with this SAS. Please refer toAccountSasResourceTypeto construct this value.- Parameters:
resourceTypes- Allowed resource types string to set- Returns:
- the updated AccountSasSignatureValues object.
-
getEncryptionScope
Gets the encryption scope that will be applied to any write operations performed with the sas- Returns:
- An encryption scope that will be applied to any write operations performed with the sas
-
setEncryptionScope
Sets the encryption scope that will be applied to any write operations performed with the sas- Parameters:
encryptionScope- the encryption scope to set- Returns:
- the updated AccountSasSignatureValues object.
-
AccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService, AccountSasResourceType)