Class NetStorageCmsSigner
java.lang.Object
org.frankframework.extensions.akamai.NetStorageCmsSigner
The NetStorageCMSv35Signer is responsible for brokering the communication between the software layer and the API. This
includes the signing and formatting the request appropriately so that the implementation detail is abstracted from
calling libraries. The intended calling library is the NetStorage class, but this layer can be called directly and is
offered as a convenience interface for enhanced implementations.
- Author:
- Niels Meijer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Currently only 3 signing hash types are supported. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNetStorageCmsSigner
(URI uri, String nonce, String accessToken) Primary invocation for an API communication.NetStorageCmsSigner
(URI uri, String nonce, String accessToken, NetStorageCmsSigner.SignType signType) Primary invocation for an API communication.NetStorageCmsSigner
(URI uri, CredentialFactory accessTokenCf, NetStorageCmsSigner.SignType signType) -
Method Summary
Modifier and TypeMethodDescriptioncomputeHeaders
(NetStorageRequest netStorageAction) Assembles the HTTP Headers necessary for API communicationprotected String
Computes the value for the the X-Akamai-ACS-Action: header.protected String
Constructs the X-Akamai-ACS-Auth-Data header which contains the signing version, the current time, a random number and the nonce that is used to sign the data.protected String
getAuthSignHeaderValue
(String action, String authData) Computes the X-Akamai-ACS-Auth-Sign header for a given Action and Data header values.
-
Field Details
-
ACTION_HEADER
- See Also:
-
AUTH_DATA_HEADER
- See Also:
-
AUTH_SIGN_HEADER
- See Also:
-
-
Constructor Details
-
NetStorageCmsSigner
Primary invocation for an API communication. This constructor is used for convenience when not uploading content- Parameters:
uri
- the url to interact with (eg: http://example.akamaihd.net/254462 )nonce
- provisioned nonce from the Luna portalaccessToken
- the associated accessToken generated by the portal
-
NetStorageCmsSigner
public NetStorageCmsSigner(URI uri, String nonce, String accessToken, NetStorageCmsSigner.SignType signType) Primary invocation for an API communication. This constructor is used for convenience when not uploading content- Parameters:
uri
- the url to interact with (eg: http://example.akamaihd.net/254462 )nonce
- provisioned nonce from the Luna portalaccessToken
- the associated accessToken generated by the portalsignType
- the base64 encoded signature algorithm
-
NetStorageCmsSigner
public NetStorageCmsSigner(URI uri, CredentialFactory accessTokenCf, NetStorageCmsSigner.SignType signType)
-
-
Method Details
-
getActionHeaderValue
Computes the value for the the X-Akamai-ACS-Action: header. This is an url query-string encoded separated list of parameters in the form ofname=value&name2=value2
.- Parameters:
action
- the set of action parameters to be sent in the API request- Returns:
- an url encoded query string of name-value pairs from the
NetStorageRequest
-
getAuthDataHeaderValue
Constructs the X-Akamai-ACS-Auth-Data header which contains the signing version, the current time, a random number and the nonce that is used to sign the data.- Returns:
- the data field in a comma separated list
-
getAuthSignHeaderValue
Computes the X-Akamai-ACS-Auth-Sign header for a given Action and Data header values. This results in a base64 encoded representation of the hash as required by the spec. The api server will compute this same hash to validate the request- Parameters:
action
- action header valuesgetActionHeaderValue(NetStorageRequest)
authData
- data header valuesgetAuthDataHeaderValue()
- Returns:
- a base64 encoded return string
-
computeHeaders
Assembles the HTTP Headers necessary for API communication- Parameters:
netStorageAction
- the set of action parameters to be sent in the API request- Returns:
- Map of name-value pairs representing HTTP Headers and values.
-