CASE STUDY · API SECURITY · ZERO TRUST

Zero Trust API

Production-deployed financial security laboratory demonstrating JWT authentication, role-based authorization and PostgreSQL Row-Level Security with Neon, Express and automated security verification.

01

Financial APIs require stronger trust boundaries.

Traditional perimeter-based security models assume that internal traffic can be trusted. Modern distributed applications require a stricter model where every request is evaluated based on identity, permissions and context.

02

Never trust implicitly. Verify every request.

Identity

Every sensitive operation is tied to an authenticated identity.

Authorization

Access decisions depend on permissions rather than network location.

Least Privilege

Users and services receive only the access required for their role.

Continuous Validation

Requests are treated as untrusted until security requirements are satisfied.

03

Security controls integrated across the application.

01Client

User-facing application and request origin

02Identity

Authentication and session validation

03Authorization

Permission and role-based access decisions

04API

Protected financial operations and business logic

05Data

Controlled persistence and database access

04

Security designed into the workflow.

Access Control

Sensitive application functions are protected through explicit access rules.

Input Validation

Untrusted input is treated as a security boundary and validated before processing.

Data Protection

Application and database boundaries are designed to minimize unnecessary data exposure.

Auditability

Security-sensitive operations can be structured for traceability and review.

05

Testing security behavior, not just happy paths.

Authentication Tests

Validate protected access and unauthenticated behavior.

Authorization Tests

Verify that restricted operations reject insufficient privileges.

API Validation

Check expected responses, error handling and request boundaries.

Negative Testing

Exercise invalid and unauthorized scenarios intentionally.

06

Automated proof that access control is enforced.

401 Without JWT

Protected transaction endpoints reject requests that do not provide an Authorization Bearer token.

403 Invalid JWT

Invalid or malformed tokens are rejected before any database access is attempted.

Branch Isolation

The gerente10 role was verified against 50 returned records, with every transaction restricted to sucursal_id 10.

Regional Auditor Access

The auditor_regional role was verified with multi-branch visibility while PostgreSQL RLS remained the authorization boundary.

01JWT

Authenticated identity established

02Role Context

Application role injected into PostgreSQL

03RLS

Database filters rows according to authorization policy

04Automated Test

Security behavior verified end-to-end in production

0 Dependency Vulnerabilities

The production dependency tree was verified with npm audit reporting zero known vulnerabilities.

Security Headers

Production responses include protections such as X-Content-Type-Options, X-Frame-Options, Referrer-Policy and Permissions-Policy.

No Sensitive Caching

Authentication and protected financial endpoints explicitly return Cache-Control: no-store.

Production Deployment

The hardened API is deployed on Vercel and connected to Neon PostgreSQL with runtime secrets stored as environment variables.

Authentication identities in this project are intentionally mocked for demonstration and security-testing purposes. The portfolio case study focuses on authorization, JWT verification, database-enforced Row-Level Security and defensive API design rather than production identity management.

07

Technology stack.

Zero TrustAPI SecurityNode.jsExpressJWTPostgreSQLNeonRow-Level SecurityVercel
08

A portfolio project combining backend engineering and security.

Zero Trust API Financiera demonstrates how software engineering, API design and defensive security principles can be combined in a practical application instead of being treated as separate topics.