public final class BlobServiceSasSignatureValues
Used to initialize parameters for a Shared Access Signature (SAS) for an Azure Blob Storage service. Once all the values here are set, use the appropriate SAS generation method on the desired container/blob 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.
Constructor Summary Constructor Description BlobServiceSasSignatureValues()Deprecated
Please use
BlobServiceSasSignatureValues(String identifier),
BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobSasPermission permissions), or
BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobContainerSasPermission permissions)Creates an object with empty values for all fields.
BlobServiceSasSignatureValues(String identifier)Creates an object with the specified identifier.
BlobServiceSasSignatureValues(String version, SasProtocol sasProtocol, OffsetDateTime startTime, OffsetDateTime expiryTime, String permission, SasIpRange sasIpRange, String identifier, String cacheControl, String contentDisposition, String contentEncoding, String contentLanguage, String contentType)Deprecated
Please use
BlobServiceSasSignatureValues(String identifier),
BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobSasPermission permissions), or
BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobContainerSasPermission permissions)followed by calls to the desired setters.
Creates an object with the specified values.
BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobContainerSasPermission permissions)Creates an object with the specified expiry time and permissions
BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobSasPermission permissions)Creates an object with the specified expiry time and permissions
Method Summary Methods inherited from java.lang.Object Constructor Details BlobServiceSasSignatureValues@Deprecated
public BlobServiceSasSignatureValues()
Deprecated
Creates an object with empty values for all fields.
BlobServiceSasSignatureValuespublic BlobServiceSasSignatureValues(String identifier)
Creates an object with the specified identifier. NOTE: Identifier can not be used for a UserDelegationKey SAS.
Parameters:
identifier - Name of the access policy
BlobServiceSasSignatureValues@Deprecated
public BlobServiceSasSignatureValues(String version, SasProtocol sasProtocol, OffsetDateTime startTime, OffsetDateTime expiryTime, String permission, SasIpRange sasIpRange, String identifier, String cacheControl, String contentDisposition, String contentEncoding, String contentLanguage, String contentType)
Deprecated
Creates an object with the specified values.
Parameters:
version - The version of the service this SAS will target. If not specified, it will default to the version targeted by the library.
sasProtocol- The
SasProtocolwhich determines the protocols allowed by the SAS.
startTime - When the SAS will take effect.
expiryTime - The time after which the SAS will no longer work.
permission - The permissions string allowed by the SAS.
sasIpRange- The
SasIpRangewhich determines the IP ranges that are allowed to use the SAS.
identifier - The name of the access policy on the container this SAS references if any.
cacheControl - The cache-control header for the SAS.
contentDisposition - The content-disposition header for the SAS.
contentEncoding - The content-encoding header for the SAS.
contentLanguage - The content-language header for the SAS.
contentType - The content-type header for the SAS.
BlobServiceSasSignatureValuespublic BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobContainerSasPermission permissions)
Creates an object with the specified expiry time and permissions
Parameters:
expiryTime - The time after which the SAS will no longer work.
BlobServiceSasSignatureValuespublic BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobSasPermission permissions)
Creates an object with the specified expiry time and permissions
Parameters:
expiryTime - When the SAS will no longer work
Method Details generateSasQueryParameters@Deprecated
public BlobServiceSasQueryParameters generateSasQueryParameters(UserDelegationKey delegationKey, String accountName)
Deprecated
Please use the generate
User
Delegation
Sas(Blob
Service
Sas
Signature
Values, User
Delegation
Key) method on the desired container/blob client after initializing
BlobServiceSasSignatureValues.
Uses a user delegation key to sign these signature values to produce the proper SAS query parameters.
Notes on SAS generation
The type of SAS query parameters returned depends on the following:
See class level JavaDocs for code snippets.
Parameters:
accountName - Azure Storage account name to generate SAS for.
Returns:
getBlobName@Deprecated
public String getBlobName()
Deprecated
Blob name is now auto-populated by the SAS generation methods provided on the desired blob client.
Decodes and gets the name of the blob the SAS user may access. null
or an empty string is returned when a creating a container SAS.
Returns:
The decoded name of the blob the SAS user may access. null
or an empty string is returned when a creating a container SAS.
public String getCacheControl()
Gets the encryption scope to use for the SAS.
Returns:
the cache-control header for the SAS.
getContainerName@Deprecated
public String getContainerName()
Deprecated
Container name is now auto-populated by the SAS generation methods provided on the desired container/blob client.
Gets the name of the container the SAS user may access.
Returns:
The name of the container the SAS user may access.
getContentDispositionpublic String getContentDisposition()
Gets the content-disposition header for the SAS.
Returns:
the content-disposition header for the SAS.
getContentEncodingpublic String getContentEncoding()
Gets the content-encoding header for the SAS.
Returns:
the content-encoding header for the SAS.
getContentLanguagepublic String getContentLanguage()
Gets the content-language header for the SAS.
Returns:
the content-language header for the SAS.
getContentTypepublic String getContentType()
Gets the content-type header for the SAS.
Returns:
the content-type header for the SAS.
getCorrelationIdpublic String getCorrelationId()
Gets the encryption scope to use for the SAS.
Returns:
the correlation id value for the SAS.
getExpiryTimepublic OffsetDateTime getExpiryTime()
Gets the time after which the SAS will no longer work.
Returns:
the time after which the SAS will no longer work.
getIdentifierpublic String getIdentifier()
Gets the name of the access policy on the container this SAS references if any. Please see here for more information.
Returns:
the name of the access policy on the container this SAS references if any. Please see
herefor more information.
getPermissionspublic String getPermissions()
Gets the permissions string allowed by the SAS. Please refer to either BlobContainerSasPermission or BlobSasPermission depending on the resource being accessed for help determining the permissions allowed.
Returns:
public String getPreauthorizedAgentObjectId()
Gets the AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the action granted by the SAS token.
Returns:
The AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the action granted by the SAS token. The service will validate the SAS token and ensure that the owner of the user delegation key has the required permissions before granting access but no additional permission check for the agent object id will be performed.
getProtocolpublic SasProtocol getProtocol()
Gets the SasProtocol which determines the protocols allowed by the SAS.
Returns:
the
SasProtocolwhich determines the protocols allowed by the SAS.
getSasIpRangepublic SasIpRange getSasIpRange()
Gets the SasIpRange which 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.
getSnapshotId@Deprecated
public String getSnapshotId()
Deprecated
Snapshot id is now auto-populated by the SAS generation methods provided on the desired (snapshot) blob client.
Gets the specific snapshot the SAS user may access.
Returns:
the specific snapshot the SAS user may access.
getStartTimepublic OffsetDateTime getStartTime()
Gets when the SAS will take effect.
Returns:
when the SAS will take effect.
getVersionpublic String getVersion()
Gets the version of the service this SAS will target. If not specified, it will default to the version targeted by the library.
Returns:
the version of the service this SAS will target. If not specified, it will default to the version targeted by the library.
setBlobName@Deprecated
public BlobServiceSasSignatureValues setBlobName(String blobName)
Deprecated
Please use the SAS generation methods provided on the desired blob client that will auto-populate the blob name.
Sets the blob the SAS user may access. Use null
or an empty string to create a container SAS.
Parameters:
blobName - The name of the blob. Use null
or an empty string to create a container SAS.
Returns:
The updated BlobServiceSASSignatureValues object.
setCacheControlpublic BlobServiceSasSignatureValues setCacheControl(String cacheControl)
Sets the cache-control header for the SAS.
Parameters:
cacheControl - Cache-Control header value
Returns:
the updated BlobServiceSASSignatureValues object
setContainerName@Deprecated
public BlobServiceSasSignatureValues setContainerName(String containerName)
Deprecated
Please use the SAS generation methods provided on the desired container/blob client that will auto-populate the container name.
Sets the container the SAS user may access.
Parameters:
containerName - The name of the container.
Returns:
The updated BlobServiceSASSignatureValues object.
setContentDispositionpublic BlobServiceSasSignatureValues setContentDisposition(String contentDisposition)
Sets the content-disposition header for the SAS.
Parameters:
contentDisposition - Content-Disposition header value
Returns:
the updated BlobServiceSASSignatureValues object
setContentEncodingpublic BlobServiceSasSignatureValues setContentEncoding(String contentEncoding)
Sets the content-encoding header for the SAS.
Parameters:
contentEncoding - Content-Encoding header value
Returns:
the updated BlobServiceSASSignatureValues object
setContentLanguagepublic BlobServiceSasSignatureValues setContentLanguage(String contentLanguage)
Sets the content-language header for the SAS.
Parameters:
contentLanguage - Content-Language header value
Returns:
the updated BlobServiceSASSignatureValues object
setContentTypepublic BlobServiceSasSignatureValues setContentType(String contentType)
Sets the content-type header for the SAS.
Parameters:
contentType - Content-Type header value
Returns:
the updated BlobServiceSASSignatureValues object
setCorrelationIdpublic BlobServiceSasSignatureValues setCorrelationId(String correlationId)
Sets the correlation id value for the SAS.
Note: This parameter is only valid for user delegation SAS.
Parameters:
correlationId - A correlation ID used to correlate the storage audit logs with the audit logs used by the principal generating and distributing SAS.
Returns:
the updated BlobServiceSasSignatureValues object
setExpiryTimepublic BlobServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime)
Sets the time after which the SAS will no longer work.
Parameters:
expiryTime - When the SAS will no longer work
Returns:
the updated BlobServiceSASSignatureValues object
setIdentifierpublic BlobServiceSasSignatureValues setIdentifier(String identifier)
Sets the name of the access policy on the container this SAS references if any. Please see here for more information.
Parameters:
identifier - Name of the access policy
Returns:
the updated BlobServiceSASSignatureValues object
setPermissionspublic BlobServiceSasSignatureValues setPermissions(BlobContainerSasPermission permissions)
Sets the Container permissions allowed by the SAS.
Parameters:
Returns:
the updated BlobServiceSASSignatureValues object
setPermissionspublic BlobServiceSasSignatureValues setPermissions(BlobSasPermission permissions)
Sets the Blob permissions allowed by the SAS.
Parameters:
Returns:
the updated BlobServiceSASSignatureValues object
setPreauthorizedAgentObjectIdpublic BlobServiceSasSignatureValues setPreauthorizedAgentObjectId(String preauthorizedAgentObjectId)
Sets the AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the action granted by the SAS token.
Parameters:
preauthorizedAgentObjectId - The AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the action granted by the SAS token. The service will validate the SAS token and ensure that the owner of the user delegation key has the required permissions before granting access but no additional permission check for the agent object id will be performed.
Returns:
the updated BlobServiceSASSignatureValues object
setProtocolpublic BlobServiceSasSignatureValues setProtocol(SasProtocol protocol)
Sets the SasProtocol which determines the protocols allowed by the SAS.
Parameters:
protocol - Protocol for the SAS
Returns:
the updated BlobServiceSASSignatureValues object
setSasIpRangepublic BlobServiceSasSignatureValues setSasIpRange(SasIpRange sasIpRange)
Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS.
Parameters:
sasIpRange - Allowed IP range to set
Returns:
the updated BlobServiceSASSignatureValues object
setSnapshotId@Deprecated
public BlobServiceSasSignatureValues setSnapshotId(String snapshotId)
Deprecated
Please use the SAS generation methods provided on the desired (snapshot) blob client that will auto-populate the snapshot id.
Sets the specific snapshot the SAS user may access.
#resource will be set to #SAS_BLOB_SNAPSHOT_CONSTANT if the passed snapshotId
isn't null
amd #resource is set to #SAS_BLOB_CONSTANT.
Parameters:
snapshotId - Identifier of the snapshot
Returns:
the updated BlobServiceSASSignatureValues object
setStartTimepublic BlobServiceSasSignatureValues setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect.
Parameters:
startTime - When the SAS takes effect
Returns:
the updated BlobServiceSASSignatureValues object
setVersion@Deprecated
public BlobServiceSasSignatureValues setVersion(String version)
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 version of the service this SAS will target. If not specified, it will default to the version targeted by the library.
Parameters:
version - Version to target
Returns:
the updated BlobServiceSASSignatureValues object
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4