Common Lisp Package: ZAWS

README:

FUNCTION

Public

AWS-URL-ENCODE (STRING)

URL-encode STRING according to AWS's requirements.

BASE64 (VECTOR)

Encode VECTOR as a base64 string.

HMAC-SHA256-SIGNATURE-BASE64 (SECRET-KEY VECTOR)

Return a base64-encoded string of the SHA256-HMAC of VECTOR with the UTF-8 encoded octets of the string SECRET-KEY.

ISO8601-TIMESTAMP (&OPTIONAL (TIME (GET-UNIVERSAL-TIME)))

Return an ISO 8601-style UTC timestamp string.

MAKE-PARAMETERS (&REST KEYS-AND-VALUES)

Convert KEYS-AND-VALUES to an alist suitable for using as parameters or headers in an HTTP request. Keys and values are coerced to strings, if necessary.

OCTET-VECTOR (&REST OCTETS)

Return a specialized array initialized with OCTETS.

PARSE-ISO8601-TIMESTAMP (TIMESTAMP)

Parse an ISO 8601-style UTC timestamp and return a universal time and fraction of a second as multiple values.

RFC1123-TIMESTAMP (&OPTIONAL (TIME (GET-UNIVERSAL-TIME)))

Return an RFC 1123-style GMT timestamp string.

UTF8 (STRING)

Return STRING encoded as UTF-8 octets.

Undocumented

SHA256 (VECTOR)

SUBMIT-COMMON-QUERY (CLASS INITARGS ACTION &REST ACTION-PARAMETERS)

Private

CALL-WITH-OUTPUT-SINK (FUN)

Call FUN with one argument, an octet sink.

PARAMETERS-AS-AUTH-STRING (PARAMETERS)

Convert the alist PARAMETERS to a string suitable for use in authentication strings-to-sign.

STARTS-WITH (PREFIX STRING)

Return T if STRING starts with PREFIX.

Undocumented

JSON-AUTH-V3-HEADERS (REQUEST)

NTH-LINE (N FILE &OPTIONAL (ERRORP T))

MACRO

Public

DO-PARAMETERS ((KEY VALUE &OPTIONAL RESULT) PARAMETERS &BODY BODY)

Evaluate BODY for with KEY and VALUE bound to each car and cdr in in the alist PARAMETERS.

WITH-OCTET-SINK ((SINK) &BODY BODY)

Evaluate BODY with SINK bound to a newly created octet sink. Returns the octet vector accumulated in SINK when finished.

GENERIC-FUNCTION

Public

ACCESS-KEY-ID (CREDENTIALS)

The access key id of CREDENTIALS.

CHECK-RESPONSE-ERROR (REQUEST RESPONSE)

Check the low-level response object for errors and signal if found.

CONTENT-STRING (OBJECT)

If the content of OBJECT is a string, return it, otherwise treat it as utf-8 encoded octets and return its conversion to a string.

DELETE-HEADER (KEY HTTP-MESSAGE)

Remove any header named by KEY from HTTP-MESSAGE's list of headers.

DELETE-PARAMETER (KEY REQUEST)

Remove any parameter named KEY from REQUEST's list of parameters.

ENSURE-HEADER (KEY VALUE HTTP-MESSAGE)

Ensure that the header named by KEY in HTTP-MESSAGE has the value VALUE, updating or creating the header as needed.

EXPIRATION (CREDENTIALS)

The expiration time, as a universal time, of CREDENTIALS.

EXPIREDP (CREDENTIALS)

Returns T if CREDENTIALS have expired.

PREPARE-FOR-SIGNING (REQUEST)

Prepare REQUEST for signing by adding or converting any information that needs to be available for the signing process. Returns the REQUST object.

PROCESS-RESPONSE (REQUEST RESPONSE)

Process a valid response object into a suitable specialized object according to REQUEST. The default method returns the response unchanged.

SECRET-ACCESS-KEY (CREDENTIALS)

The secret access key of CREDENTIALS.

SESSION-TOKEN (CREDENTIALS)

The session token of CREDENTIALS.

SIGN (REQUEST)

Add authentication information to REQUEST based on the current value of *CREDENTIALS* and the contents of the request. Return the REQUEST object.

SINK-WRITE (OBJECT SINK)

Write OBJECT to SINK.

STRING-TO-SIGN (REQUEST)

The string to sign for authentication.

SUBMIT (REQUEST)

Send REQUEST and return a response object, or signal an error if there's a problem with the response.

VECTOR-TO-SIGN (REQUEST)

The vector to sign for authentication; should be used in preference to creating a string to sign if the string includes ASCII control codes like LF; otherwise defaults to an UTF-8 encoding of the string to sign.

Undocumented

ENSURE-PARAMETER (KEY VALUE REQUEST)

RESPONSE-ERROR-REQUEST (CONDITION)

RESPONSE-ERROR-RESPONSE (CONDITION)

Private

HEADER-VALUE (KEY HTTP-MESSAGE)

Return the value of the header named by KEY.

SLOT-ACCESSOR

Public

ACTION (REQUEST)

The The 'action' of a common query request.

ACTION-PARAMETERS (REQUEST)

The The parameters given to the 'action' of a common query request.

SETFACTION-PARAMETERS (NEW-VALUE OBJECT)

Set the The parameters given to the 'action' of a common query request.

API-VERSION (REQUEST)

The The API version of a request.

CONTENT (OBJECT)

The The content (aka body) of OBJECT.

SETFCONTENT (NEW-VALUE OBJECT)

Set the The content (aka body) of OBJECT.

HEADERS (OBJECT)

The The headers of OBJECT.

SETFHEADERS (NEW-VALUE OBJECT)

Set the The headers of OBJECT.

HOST (REQUEST)

The The target host of the request.

METHOD (REQUEST)

The The HTTP method as a keyword, e.g. :GET, :POST, :PUT, etc.

PROTOCOL (REQUEST)

The The protocol of the request as a string, e.g. "http" or "https".

REASON-PHRASE (RESPONSE)

The The HTTP reason phrase (e.g. "OK") of RESPONSE.

SETFREASON-PHRASE (NEW-VALUE OBJECT)

Set the The HTTP reason phrase (e.g. "OK") of RESPONSE.

STATUS-CODE (RESPONSE)

The The HTTP status code of RESPONSE as an integer.

URI (OBJECT)

The The URI of OBJECT.

SETFURI (NEW-VALUE OBJECT)

Set the The URI of OBJECT.

Undocumented

CONTENT-TYPE (REQUEST)

SETFCONTENT-TYPE (NEW-VALUE OBJECT)

PARAMETERS (REQUEST)

SETFPARAMETERS (NEW-VALUE REQUEST)

REQUEST (RESPONSE)

URI-PATH (REQUEST)

Private

Undocumented

SIGNATURE-VERSION (OBJECT)

VARIABLE

Public

*CREDENTIALS*

The credentials used for authenticating AWS requests. Built-in credentials can be a list, a pathname, or a string designating a pathname. For a list, the first two elements are used as the access key and secret key, and the third element, if present, is the session token. For a pathname, the first two lines of the file are the access key and secret key, and the third line, if present, is the session token.

Private

Undocumented

*ASCII-CONTROL-CODE-VALUES*

*ASCII-CONTROL-CODES*

*UNRESERVED-OCTETS*

CLASS

Public

AWS-AUTH-MIXIN

Any class that uses this mixin will be automatically signed before submission.

QUERY-AUTH-V2

Adding this class as a mixin to a request will automatically sign requests per the AWS Query Auth version 2 spec.

Undocumented

COMMON-QUERY-REQUEST

JSON-AUTH-V3

QUERY-AUTH-V3

REQUEST (RESPONSE)

RESPONSE

Private

HTTP-MESSAGE

HTTP-MESSAGE is the parent class of both REQUESTs and RESPONSEs.

CONDITION

Public

Undocumented

RESPONSE-ERROR