Skip to content

Commit

Permalink
Merge pull request #14 from jerzyadamowski/feature/fixing_extending_p…
Browse files Browse the repository at this point in the history
…rovide_example

Feature/fixing extending provide example
  • Loading branch information
jerzyadamowski authored Sep 26, 2024
2 parents f16382f + 4f53399 commit 892197f
Show file tree
Hide file tree
Showing 10 changed files with 1,138 additions and 442 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ name: Node.js CI

on:
push:
branches: ["*"]
branches: ['*']
pull_request:
branches: ["main"]
branches: ['main']

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run lint
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18, 20]
node: [18, 20, 22]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci
Expand All @@ -28,8 +28,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
recursive: true,
require: 'ts-node/register',
import: 'tsx',
'watch-files': ['src/test/**/*.spec.ts', 'src/test/**/*.ts'],
spec: 'src/test/**/*.spec.ts',
timeout: 5000, // debug session
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# aws4-express
Express middleware handlers for validation AWS Signature V4. Your web app can mimic AWS services, and you can use benefit from already well-defined standard to securing web API.


At this moment, library is based on general version of aws4 signature:
[Authenticating Requests (AWS Signature Version 4)](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html)

### Alpha stage
### Beta stage
Until we hit >=1.x.x, there could be possible breaking changes on minor changes.
Use at least 0.5.2 version.
Use at least 0.8.0 version.

## Install

Expand All @@ -31,6 +30,7 @@ If you use express parsers like `express.raw()` or `express.json()` or `express.
// when json parser u may use like this
app.use(
express.json({
type: '*/*',
verify: rawBodyFromVerify,
}),
);
Expand All @@ -46,6 +46,8 @@ If you use express parsers like `express.raw()` or `express.json()` or `express.
// or when url encoded body u may use like this
app.use(
express.urlencoded({
extended: true,
type: '*/*',
verify: rawBodyFromVerify,
}),
);
Expand All @@ -72,6 +74,10 @@ If you use express parsers like `express.raw()` or `express.json()` or `express.
return app;
```

## Example:

- [simpleIntegration.ts](/src/examples/simpleIntegration.ts)

## Features:

- [x] General implementation standard: aws4 signature.
Expand Down
Loading

0 comments on commit 892197f

Please sign in to comment.