public final class AzureKeyCredentialPolicy extends Object implements HttpPipelinePolicy
AzureKeyCredential to set the authorization key for a request.
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 key.
| Constructor and Description |
|---|
AzureKeyCredentialPolicy(String name,
AzureKeyCredential credential)
Creates a policy that uses the passed
AzureKeyCredential to set the specified header name. |
| Modifier and Type | Method and Description |
|---|---|
Mono<HttpResponse> |
process(HttpPipelineCallContext context,
HttpPipelineNextPolicy next)
Processes provided request context and invokes the next policy.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPipelinePositionpublic AzureKeyCredentialPolicy(String name, AzureKeyCredential credential)
AzureKeyCredential to set the specified header name.name - The name of the key header that will be set to AzureKeyCredential.getKey().credential - The AzureKeyCredential containing the authorization key to use.NullPointerException - If name or credential is null.IllegalArgumentException - If name is empty.public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)
HttpPipelinePolicyprocess in interface HttpPipelinePolicycontext - The request context.next - The next policy to invoke.Copyright © 2021 Microsoft Corporation. All rights reserved.