Skip to content

Refactor/nodejs quickstart#5

Open
KMilej wants to merge 8 commits intomainfrom
refactor/nodejs-quickstart
Open

Refactor/nodejs quickstart#5
KMilej wants to merge 8 commits intomainfrom
refactor/nodejs-quickstart

Conversation

@KMilej
Copy link
Copy Markdown

@KMilej KMilej commented Jan 19, 2026

Summary

  • Complete Nodejs demo API with Approov token verification and optional token binding.
  • Expose protected (/token-check, /token-binding, /token-double-binding) and unprotected endpoints.
  • Provide Docker run scripts, .env configuration, and a CLI test harness.
  • Locally, it uses npm install and npm start

How to run

  • Clone repo.
  • cp .env.example .env.
  • Set APPROOV_BASE64URL_SECRET.
  • approov api -add example.com
  • bash run_server.sh.
  • In another terminal: bash test.sh.

@KMilej KMilej force-pushed the refactor/nodejs-quickstart branch from ef50f88 to 3c2999d Compare February 4, 2026 12:27
- ApproovApplication.js: added centralized error handling (HttpError + handleRequestError) and return 400 for invalid request URL.

- approovTokenVerifier now passes auth failures to middleware flow (next(error)) for missing Approov-Token, invalid token, and binding mismatch.

- Token binding now uses constructTokenBindingInput(req, bindingHeaders) and generateTokenBindingHash(), with explicit 401 missing_binding_header when a required header is absent.

- scripts/build.sh now validates APPROOV_BASE64URL_SECRET in .env (rejects empty/placeholder values) before starting Docker.

- scripts/build.sh now prints container logs on startup failure; runtime moved to Node 24 (package engines + Docker base image), and .dockerignore + LICENSE were added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant