Class AzureSasCredentialPolicy

java.lang.Object
com.azure.core.http.policy.AzureSasCredentialPolicy
All Implemented Interfaces:
HttpPipelinePolicy

public final class AzureSasCredentialPolicy extends Object implements HttpPipelinePolicy
Pipeline policy that uses an AzureSasCredential to set the shared access signature for a request.
  • Constructor Details

    • AzureSasCredentialPolicy

      public AzureSasCredentialPolicy(AzureSasCredential credential)
      Creates a policy that uses the passed AzureSasCredential to append sas to query string.

      Requests sent with this pipeline policy are required to use HTTPS. If the request isn't using HTTPS an exception will be thrown to prevent leaking the shared access signature.

      Parameters:
      credential - The AzureSasCredential containing the shared access signature to use.
      Throws:
      NullPointerException - If credential is null.
    • AzureSasCredentialPolicy

      public AzureSasCredentialPolicy(AzureSasCredential credential, boolean requireHttps)
      Creates a policy that uses the passed AzureSasCredential to append sas to query string.
      Parameters:
      credential - The AzureSasCredential containing the shared access signature to use.
      requireHttps - A flag indicating whether HTTPS is required.
      Throws:
      NullPointerException - If credential is null.
  • Method Details