← All Learning Paths

REST API Security

Secure REST APIs end to end: boundaries, headers, rate limits, idempotency, and token handling.

technicalintermediate11 nodes11.42h total

Learning path

Secure REST APIs end to end: boundaries, headers, rate limits, idempotency, and token handling.

  1. Read "Security Boundaries in Modern Web Applications" for the "Subresource Integrity, Trusted Types, and Cookie Hardening" argument, then name the decision in rest api security work it would change.

    Completion criteria: Attach a one-page summary that quotes "Subresource Integrity, Trusted Types, and Cookie Hardening", lists two trade-offs, and links the commit where you applied it.

    Next step: Add a Content Security Policy with Nonces

    ⏱ 1h

  2. Apply "Add a Content Security Policy with Nonces" to a rest api security task, checking that "Generate a cryptographically random nonce per response and expose it to the template" appears after the "Each response has a unique nonce available to templates." step.

    Completion criteria: Deliver a transcript of "Add a Content Security Policy with Nonces" with each step's command and observed state, ending at "Each response has a unique nonce available to templates.".

    Next step: Add Idempotency Keys to a Write Endpoint

    ⏱ 0.5h

  3. Execute "Add Idempotency Keys to a Write Endpoint" end to end, then repeat the last step with one parameter changed and compare "Requests without a valid key are rejected before any side effect.".

    Prerequisites: Add a Content Security Policy with Nonces

    Completion criteria: Show the command for every step of "Add Idempotency Keys to a Write Endpoint" and paste the output proving "Requests without a valid key are rejected before any side effect."; then note the step where "Require a client-generated idempotency key with a bounded length and reject missing or" appears.

    Next step: Add Rate Limiting Middleware

    ⏱ 0.5h

  4. Run "req.ip reflects the client address appended by the trusted proxy." from "Add Rate Limiting Middleware" and confirm the documented result "Configure the proxy trust setting so req.ip is derived from a trusted forwarding header,".

    Prerequisites: Add Idempotency Keys to a Write Endpoint

    Completion criteria: Run the steps through "Configure the proxy trust setting so req.ip is derived from a trusted forwarding header,", paste the command output, and mark the line that matches "The first 60 requests return 200 and the rest return 429."; then rerun with one parameter changed.

    Next step: Add API Deprecation Headers

    ⏱ 0.5h

  5. Apply "Add API Deprecation Headers" to a rest api security task, checking that "Remove the endpoint only after the sunset date and after confirming that the remaining" appears after the "The headers are visible until the endpoint is retired." step.

    Prerequisites: Add Rate Limiting Middleware

    Completion criteria: Deliver a transcript of "Add API Deprecation Headers" with each step's command and observed state, ending at "Remove the endpoint only after the sunset date and after confirming that the remaining".

    Next step: JWT Token Decoder

    ⏱ 0.5h

  6. Use "JWT Token Decoder" on a rest api security sample, then check "jwt, security, decode" against your manual result.

    Prerequisites: Add API Deprecation Headers

    Completion criteria: Paste two input/output pairs from "JWT Token Decoder" and annotate the one where "jwt, security, decode" changes the result.

    Next step: HMAC Generator

    ⏱ 0.25h

  7. Feed a representative input into "HMAC Generator" and verify "text to hash" by hand.

    Prerequisites: JWT Token Decoder

    Completion criteria: Paste two input/output pairs from "HMAC Generator" and annotate the one where "Compute an HMAC-SHA-256, SHA-384, or SHA-512 signature for a message and key using the Web" changes the result.

    Next step: Helmet

    ⏱ 0.25h

  8. Wire "Helmet" into a scratch rest api security project, invoke helmet() helmet(options?: HelmetOptions): RequestHandler, and record the error path.

    Prerequisites: HMAC Generator

    Completion criteria: Attach the request, response, and error code from "Helmet"; annotate which field caused the failure.

    Next step: How to Build a Rate Limiter in Node.js

    ⏱ 1h

  9. Reconstruct the reasoning behind "How to Build a Rate Limiter in Node.js" by tracing "Design the key" to the failure it prevents in rest api security systems.

    Prerequisites: Helmet

    Completion criteria: Attach a one-page summary that quotes "Design the key", lists two trade-offs, and links the commit where you applied it.

    Next step: Run an Authorization Matrix as a Test

    ⏱ 1h

  10. Build "Run an Authorization Matrix as a Test" for rest api security code and verify {passed:false,failed:[admin]} against both samples.

    Prerequisites: How to Build a Rate Limiter in Node.js

    Completion criteria: Attach the solution file for "REST API Security", two passing sample runs, and one failing run whose error matches the contract.

    Next step: Capstone: REST API Security

    ⏱ 0.42h

  11. Ship "Limit headers on every proxied response expose remaining quota and reset time" from "Build a Rate Limiting Reverse Proxy in Node.js", then prove it with the project's test suite and an acceptance note.

    Prerequisites: How to Build a Rate Limiter in Node.js, Run an Authorization Matrix as a Test

    Completion criteria: Run the project's test command for "Build a Rate Limiting Reverse Proxy in Node.js", paste the passing output, and attach the acceptance note for "Limit headers on every proxied response expose remaining quota and reset time" with the test name.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h