Categories
Backend

Declaratively bypassing guards in a NestJS endpoint with JWT and RBAC

I recently started using NestJS – a relatively new Node.js backend framework, which puts convention over configuration. One of the concepts introduced by NestJS are guards, which are a context aware alternative to regular Express middleware. In one of my projects, I’ve run into a use case, which well illustrates the advantages of guards vs middleware.