The aws-sign4 Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The aws-sign4 Reference Manual

This is the aws-sign4 Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:14:45 2022 GMT+0.

Table of Contents


1 Introduction

Common Lisp library for Amazon Web Services signing version 4.

Project home: https://github.com/rotatef/aws-sign4

This library implements the Signature Version 4 Signing Process, as described here: http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html

Highlights:

Example

See example.lisp for an example of using Drakma to make a request to SWF.

S3 supports presigned URL. This make is possible to give a web browser temporary access to download an object directly from S3. Example:

(let ((aws-sign4:*aws-credentials*
        (lambda ()
          (values "AKIAIOSFODNN7EXAMPLE" "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"))))
  (aws-sign4:aws-sign4 :region :eu-west-1
                       :service :s3
                       :host "s3-eu-west-1.amazonaws.com"
                       :path "/some-bucket/some-file"
                       :expires 300)) 
=> "https://s3-eu-west-1.amazonaws.com/some-bucket/some-file?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20170908%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20170908T121925Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=42c841837976e9c206f80554b50aa879fdb3aa4f3e6f61934ce8eba436205abf                      

API

Variable

AWS-SIGN4:*AWS-CREDENTIALS*

Bind this variable to a function returning two values, the access key and the secret key.

AWS-SIGN4:AWS-SIGN4 &key ...

Calculates the signature for a http request.

Parameters:

Returns seven values. Only the two first are needed, the others are useful for debugging.


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 aws-sign4

A library for Amazon Web Services signing version 4

Author

Thomas Bakketun <thomas.bakketun@copyleft.no>

License

GNU Lesser General Public Licence 3.0

Dependencies
  • local-time (system).
  • cl-ppcre (system).
  • ironclad (system).
  • split-sequence (system).
  • flexi-streams (system).
  • secret-values (system).
Source

aws-sign4.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 aws-sign4/aws-sign4.asd

Source

aws-sign4.asd.

Parent Component

aws-sign4 (system).

ASDF Systems

aws-sign4.


3.1.2 aws-sign4/package.lisp

Source

aws-sign4.asd.

Parent Component

aws-sign4 (system).

Packages

aws-sign4.


Previous: , Up: Lisp   [Contents][Index]

3.1.3 aws-sign4/aws-sign4.lisp

Dependency

package.lisp (file).

Source

aws-sign4.asd.

Parent Component

aws-sign4 (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 aws-sign4

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: *aws-credentials*
Package

aws-sign4.

Source

aws-sign4.lisp.


5.1.2 Ordinary functions

Function: aws-sign4 (&key region service method host path params headers payload date-header request-date expires scheme)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: calculate-signature (k-secret string-to-sign date region service)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: create-canonical-headers (headers)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: create-canonical-path (path)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: create-canonical-query-string (params)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: create-canonical-request (method canonical-path canonical-query-string canonical-headers signed-headers payload)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: get-credentials ()
Package

aws-sign4.

Source

aws-sign4.lisp.


5.2 Internals


Previous: , Up: Internals   [Contents][Index]

5.2.1 Ordinary functions

Function: create-signed-headers (canonical-headers)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: ensure-octets (data)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: hash (data)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: hex-encode (bytes)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: hmac (key data)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: merge-duplicate-headers (headers)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: string-to-sign (request-date credential-scope canonical-request)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: trimall (string)
Package

aws-sign4.

Source

aws-sign4.lisp.

Function: url-encode (string &key escape%)

URL-encodes a string using the external format UTF-8. If keyword parameter ESCAPE% is NIL, the % is not escaped.

Package

aws-sign4.

Source

aws-sign4.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   C   E   F   G   H   M   S   T   U  
Index Entry  Section

A
aws-sign4: Public ordinary functions

C
calculate-signature: Public ordinary functions
create-canonical-headers: Public ordinary functions
create-canonical-path: Public ordinary functions
create-canonical-query-string: Public ordinary functions
create-canonical-request: Public ordinary functions
create-signed-headers: Private ordinary functions

E
ensure-octets: Private ordinary functions

F
Function, aws-sign4: Public ordinary functions
Function, calculate-signature: Public ordinary functions
Function, create-canonical-headers: Public ordinary functions
Function, create-canonical-path: Public ordinary functions
Function, create-canonical-query-string: Public ordinary functions
Function, create-canonical-request: Public ordinary functions
Function, create-signed-headers: Private ordinary functions
Function, ensure-octets: Private ordinary functions
Function, get-credentials: Public ordinary functions
Function, hash: Private ordinary functions
Function, hex-encode: Private ordinary functions
Function, hmac: Private ordinary functions
Function, merge-duplicate-headers: Private ordinary functions
Function, string-to-sign: Private ordinary functions
Function, trimall: Private ordinary functions
Function, url-encode: Private ordinary functions

G
get-credentials: Public ordinary functions

H
hash: Private ordinary functions
hex-encode: Private ordinary functions
hmac: Private ordinary functions

M
merge-duplicate-headers: Private ordinary functions

S
string-to-sign: Private ordinary functions

T
trimall: Private ordinary functions

U
url-encode: Private ordinary functions

Jump to:   A   C   E   F   G   H   M   S   T   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*aws-credentials*: Public special variables

S
Special Variable, *aws-credentials*: Public special variables

Jump to:   *  
S