Class EdgeGridV1Signer
This class implements the EdgeGrid Request Signature algorithm described by
API Client
Authentication. All OPEN API requests should have a signature generated by
getSignature(Request, ClientCredential)
sent as their
Authorization
header.
This class is deliberately designed to be library-agnostic. Instances of this class hold no local state, so they can be re-used repeatedly to produce request signatures.
The main entry point to produce a signature is
getSignature(Request, ClientCredential)
. This method's two arguments are
immutable representations of exactly what they sound like: an API request and your client
credentials. They should be built with their builder classes (Request.RequestBuilder
and
ClientCredential.ClientCredentialBuilder
respectively).
- Author:
- [email protected], [email protected]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetSignature
(Request request, ClientCredential credential) Generates signature for a given HTTP request and client credential.
-
Constructor Details
-
EdgeGridV1Signer
public EdgeGridV1Signer()Creates signer with default configuration.
-
-
Method Details
-
getSignature
public String getSignature(Request request, ClientCredential credential) throws RequestSigningException Generates signature for a given HTTP request and client credential. The result of this method call should be appended as the "Authorization" header to an HTTP request.- Parameters:
request
- a HTTP request to signcredential
- client credential used to sign a request- Returns:
- signature for Authorization HTTP header
- Throws:
RequestSigningException
- if signing of a given request failedNullPointerException
- ifrequest
orcredential
isnull
IllegalArgumentException
- if request contains multiple request headers with the same header name
-