Partilhar via


DataLakeServiceSasSignatureValues Class

  • java.lang.Object
    • com.azure.storage.file.datalake.sas.DataLakeServiceSasSignatureValues

public final class DataLakeServiceSasSignatureValues

Used to initialize parameters for a Shared Access Signature (SAS) for an Azure Data Lake Storage service. Once all the values here are set, use the appropriate SAS generation method on the desired file system/path 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
DataLakeServiceSasSignatureValues(String identifier)

Creates an object with the specified identifier.

DataLakeServiceSasSignatureValues(OffsetDateTime expiryTime, FileSystemSasPermission permissions)

Creates an object with the specified expiry time and permissions

DataLakeServiceSasSignatureValues(OffsetDateTime expiryTime, PathSasPermission permissions)

Creates an object with the specified expiry time and permissions

Method Summary

Modifier and Type Method and Description
String getAgentObjectId()
String getCacheControl()
String getContentDisposition()
String getContentEncoding()
String getContentLanguage()
String getContentType()
String getCorrelationId()
String getEncryptionScope()

Get the encryptionScope property: The name of the encryption scope under which the file system is encrypted.

OffsetDateTime getExpiryTime()
String getIdentifier()
String getPermissions()
String getPreauthorizedAgentObjectId()
SasProtocol getProtocol()
SasIpRange getSasIpRange()
OffsetDateTime getStartTime()
String getVersion()
DataLakeServiceSasSignatureValues setAgentObjectId(String agentObjectId)

Sets the AAD object ID of a user assumed to be unauthorized by the owner of the user delegation key to perform the action granted by the SAS token.

DataLakeServiceSasSignatureValues setCacheControl(String cacheControl)

Sets the cache-control header for the SAS.

DataLakeServiceSasSignatureValues setContentDisposition(String contentDisposition)

Sets the content-disposition header for the SAS.

DataLakeServiceSasSignatureValues setContentEncoding(String contentEncoding)

Sets the content-encoding header for the SAS.

DataLakeServiceSasSignatureValues setContentLanguage(String contentLanguage)

Sets the content-language header for the SAS.

DataLakeServiceSasSignatureValues setContentType(String contentType)

Sets the content-type header for the SAS.

DataLakeServiceSasSignatureValues setCorrelationId(String correlationId)

Sets the correlation id value for the SAS.

DataLakeServiceSasSignatureValues setEncryptionScope(String encryptionScope)

Set the encryptionScope property: The name of the encryption scope under which the file system is encrypted.

DataLakeServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime)

Sets the time after which the SAS will no longer work.

DataLakeServiceSasSignatureValues setIdentifier(String identifier)

Sets the name of the access policy on the file system this SAS references if any.

DataLakeServiceSasSignatureValues setPermissions(FileSystemSasPermission permissions)

Sets the File System permissions allowed by the SAS.

DataLakeServiceSasSignatureValues setPermissions(PathSasPermission permissions)

Sets the Path permissions allowed by the SAS.

DataLakeServiceSasSignatureValues 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.

DataLakeServiceSasSignatureValues setProtocol(SasProtocol protocol)

Sets the SasProtocol which determines the protocols allowed by the SAS.

DataLakeServiceSasSignatureValues setSasIpRange(SasIpRange sasIpRange)

Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS.

DataLakeServiceSasSignatureValues setStartTime(OffsetDateTime startTime)

Sets when the SAS will take effect.

DataLakeServiceSasSignatureValues 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.

Methods inherited from java.lang.Object

Constructor Details

DataLakeServiceSasSignatureValues

public DataLakeServiceSasSignatureValues(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

DataLakeServiceSasSignatureValues

public DataLakeServiceSasSignatureValues(OffsetDateTime expiryTime, FileSystemSasPermission permissions)

Creates an object with the specified expiry time and permissions

Parameters:

expiryTime - The time after which the SAS will no longer work.
permissions - FileSystemSasPermission allowed by the SAS.

DataLakeServiceSasSignatureValues

public DataLakeServiceSasSignatureValues(OffsetDateTime expiryTime, PathSasPermission permissions)

Creates an object with the specified expiry time and permissions

Parameters:

expiryTime - When the SAS will no longer work
permissions - PathSasPermission allowed by the SAS

Method Details

getAgentObjectId

public String getAgentObjectId()

Returns:

The AAD object ID of a user assumed to be unauthorized 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 and the service will perform an additional POSIX ACL check to determine if this user is authorized to perform the requested operation.

getCacheControl

public String getCacheControl()

Returns:

the cache-control header for the SAS.

getContentDisposition

public String getContentDisposition()

Returns:

the content-disposition header for the SAS.

getContentEncoding

public String getContentEncoding()

Returns:

the content-encoding header for the SAS.

getContentLanguage

public String getContentLanguage()

Returns:

the content-language header for the SAS.

getContentType

public String getContentType()

Returns:

the content-type header for the SAS.

getCorrelationId

public String getCorrelationId()

Returns:

the correlation id value for the SAS.

getEncryptionScope

public String getEncryptionScope()

Get the encryptionScope property: The name of the encryption scope under which the file system is encrypted.

Returns:

the encryptionScope value.

getExpiryTime

public OffsetDateTime getExpiryTime()

Returns:

the time after which the SAS will no longer work.

getIdentifier

public String getIdentifier()

Returns:

the name of the access policy on the file system this SAS references if any. Please see here for more information.

getPermissions

public String getPermissions()

Returns:

the permissions string allowed by the SAS. Please refer to either FileSystemSasPermission or PathSasPermission depending on the resource being accessed for help determining the permissions allowed.

getPreauthorizedAgentObjectId

public String getPreauthorizedAgentObjectId()

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.

getProtocol

public SasProtocol getProtocol()

Returns:

the SasProtocol which determines the protocols allowed by the SAS.

getSasIpRange

public SasIpRange getSasIpRange()

Returns:

the SasIpRange which determines the IP ranges that are allowed to use the SAS.

getStartTime

public OffsetDateTime getStartTime()

Returns:

when the SAS will take effect.

getVersion

public String getVersion()

Returns:

the version of the service this SAS will target. If not specified, it will default to the version targeted by the library.

setAgentObjectId

public DataLakeServiceSasSignatureValues setAgentObjectId(String agentObjectId)

Sets the AAD object ID of a user assumed to be unauthorized by the owner of the user delegation key to perform the action granted by the SAS token.

Parameters:

agentObjectId - The AAD object ID of a user assumed to be unauthorized 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 and the service will perform an additional POSIX ACL check to determine if this user is authorized to perform the requested operation.

Returns:

the updated DataLakeServiceSasSignatureValues object

setCacheControl

public DataLakeServiceSasSignatureValues setCacheControl(String cacheControl)

Sets the cache-control header for the SAS.

Parameters:

cacheControl - Cache-Control header value

Returns:

the updated DataLakeServiceSasSignatureValues object

setContentDisposition

public DataLakeServiceSasSignatureValues setContentDisposition(String contentDisposition)

Sets the content-disposition header for the SAS.

Parameters:

contentDisposition - Content-Disposition header value

Returns:

the updated DataLakeServiceSasSignatureValues object

setContentEncoding

public DataLakeServiceSasSignatureValues setContentEncoding(String contentEncoding)

Sets the content-encoding header for the SAS.

Parameters:

contentEncoding - Content-Encoding header value

Returns:

the updated DataLakeServiceSasSignatureValues object

setContentLanguage

public DataLakeServiceSasSignatureValues setContentLanguage(String contentLanguage)

Sets the content-language header for the SAS.

Parameters:

contentLanguage - Content-Language header value

Returns:

the updated DataLakeServiceSasSignatureValues object

setContentType

public DataLakeServiceSasSignatureValues setContentType(String contentType)

Sets the content-type header for the SAS.

Parameters:

contentType - Content-Type header value

Returns:

the updated DataLakeServiceSasSignatureValues object

setCorrelationId

public DataLakeServiceSasSignatureValues 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 DataLakeServiceSasSignatureValues object

setEncryptionScope

public DataLakeServiceSasSignatureValues setEncryptionScope(String encryptionScope)

Set the encryptionScope property: The name of the encryption scope under which the file system is encrypted.

Parameters:

encryptionScope - the encryptionScope value to set.

Returns:

the updated DataLakeServiceSasSignatureValues object

setExpiryTime

public DataLakeServiceSasSignatureValues 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 DataLakeServiceSasSignatureValues object

setIdentifier

public DataLakeServiceSasSignatureValues setIdentifier(String identifier)

Sets the name of the access policy on the file system this SAS references if any. Please see here for more information.

Parameters:

identifier - Name of the access policy

Returns:

the updated DataLakeServiceSasSignatureValues object

setPermissions

public DataLakeServiceSasSignatureValues setPermissions(FileSystemSasPermission permissions)

Sets the File System permissions allowed by the SAS.

Parameters:

permissions - FileSystemSasPermission

Returns:

the updated DataLakeServiceSasSignatureValues object

setPermissions

public DataLakeServiceSasSignatureValues setPermissions(PathSasPermission permissions)

Sets the Path permissions allowed by the SAS.

Parameters:

permissions - PathSasPermission

Returns:

the updated DataLakeServiceSasSignatureValues object

setPreauthorizedAgentObjectId

public DataLakeServiceSasSignatureValues 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 DataLakeServiceSasSignatureValues object

setProtocol

public DataLakeServiceSasSignatureValues setProtocol(SasProtocol protocol)

Sets the SasProtocol which determines the protocols allowed by the SAS.

Parameters:

protocol - Protocol for the SAS

Returns:

the updated DataLakeServiceSasSignatureValues object

setSasIpRange

public DataLakeServiceSasSignatureValues 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 DataLakeServiceSasSignatureValues object

setStartTime

public DataLakeServiceSasSignatureValues setStartTime(OffsetDateTime startTime)

Sets when the SAS will take effect.

Parameters:

startTime - When the SAS takes effect

Returns:

the updated DataLakeServiceSasSignatureValues object

setVersion

@Deprecated
public DataLakeServiceSasSignatureValues 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 DataLakeServiceSasSignatureValues object

Applies to