Type Safe Servant Auth Roles
Summary
The article presents a design for a type-safe, role-based authorization system for a Servant API in Haskell. It introduces a custom combinator (RequireRole) and a HasServer instance to gate routes, discusses a potential Proof-based approach for enforcing capabilities, and walks through a concrete API example using role checks and fall-through routing. It also explores advanced topics like singletons, dispatch, and the theoretical foundations behind dependent types in the context of API security.