AzureSasCredentialPolicy Class
- java.
lang. Object - com.
azure. core. http. policy. AzureSasCredentialPolicy
- com.
Implements
public final class AzureSasCredentialPolicy
implements HttpPipelinePolicy
The AzureSasCredentialPolicy
class is an implementation of the HttpPipelinePolicy interface. This policy uses an AzureSasCredential to append a shared access signature (SAS) to the query string of a request.
This class is useful when you need to authorize requests with a SAS from Azure. It ensures that the requests are sent over HTTPS to prevent the SAS from being leaked.
Code sample:
In this example, an AzureSasCredentialPolicy
is created with a SAS. The policy can then added to the pipeline. The request sent by the pipeline will then include the SAS appended to its query string.
AzureSasCredential credential = new AzureSasCredential("my_sas");
AzureSasCredentialPolicy policy = new AzureSasCredentialPolicy(credential);
Constructor | Description |
---|---|
Azure |
Creates a policy that uses the passed AzureSasCredential to append sas to query string. |
Azure |
Creates a policy that uses the passed AzureSasCredential to append sas to query string. |
Modifier and Type | Method and Description |
---|---|
Mono<Http |
process(Http Processes provided request context and invokes the next policy. |
Http |
process Processes provided request context and invokes the next policy synchronously. |
Methods inherited from java.lang.Object
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:
AzureSasCredentialPolicy
public AzureSasCredentialPolicy(AzureSasCredential credential, boolean requireHttps)
Creates a policy that uses the passed AzureSasCredential to append sas to query string.
Parameters:
HTTPS
is required.
process
public Mono
Processes provided request context and invokes the next policy.
Parameters:
processSync
public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)
Processes provided request context and invokes the next policy synchronously.
Parameters:
Azure SDK for Java geri bildirimi
Azure SDK for Java, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: