Skip to content

Support common AWS signature version 2 & 4 library for S3 gateway and other services #109

@shawnhankim

Description

@shawnhankim

Is your feature request related to a problem? Please describe.
As a Software Engineer,
I want to reuse the common AWS signature version 4 library for not only NGINX S3 gateway but also other services such as NGINX Lambda gateway.

As one of the steps,
I want to reuse the library which creates a signature for use authenticating against AWS compatible APIs.

Describe the solution you'd like

  • Refactor S3 gateway NJS codebase.
  • Ability to provide the following reusable AWS signature V4 functions in awssig4.js:
    • signatureV4(): Create HTTP Authorization header for authenticating with an AWS compatible v4 API.
    • _buildCanonicalRequest(): Creates a canonical request that will later be signed.
    • _buildSignatureV4(): Creates a signature for use authenticating against an AWS compatible API.
    • _buildSigningKeyHash(): Creates a signing key HMAC. This value is used to sign the request made to the API.
    • _splitCachedValues(): Splits the cached values into an array with two elements or returns an empty array if the input string is invalid.
  • Ability to provide the following reusable AWS signature V4 functions in awssig2.js:
    • signatureV2(): Create HTTP Authorization header for authenticating with an AWS compatible v2 API.
  • Common utils in utils.js:
    • getAmzDatetime(): Creates a string in the ISO601 date format (YYYYMMDD'T'HHMMSS'Z').
    • getEightDigitDate(): Formats a timestamp into a date string in the format 'YYYYMMDD'.

Describe alternatives you've considered

  • NGINX AWS signature repo: will be considered once the common AWS signature library completes.
  • NGINX AWS signature module: TBD

Additional context

  • NGINX AWS Signature Library Integration Flow 1 for NGINX S3 Gateway:

nginx-s3-gateway-w-aws-signature

  • NGINX AWS Signature Library Integration Flow 2 for NGINX S3 Gateway:

nginx-s3-gateway-signature-flow

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions