alepha@docs:~/docs/packages/alepha$
cat security.md
1 min read
Last commit:

#Alepha - Security

#Installation

Part of the alepha package. Import from alepha/security.

npm install alepha

#Overview

Complete authentication and authorization system with JWT, RBAC, and multi-issuer support.

Features:

  • JWT token issuer with role definitions
  • Role-based access control (RBAC)
  • Fine-grained permissions
  • HTTP Basic Authentication
  • Service-to-service authentication
  • Multi-issuer support for federated auth
  • JWKS (JSON Web Key Set) for external issuers
  • Token refresh logic
  • User profile extraction from JWT

#API Reference

#Primitives

  • $basicAuth — Middleware that enforces HTTP Basic Authentication on the request.
  • $issuer — Create a new issuer.
  • $permission — Create a new permission.
  • $role — Create a new role.
  • $secure — * Restrict to specific issuers (realms).
  • $serviceAccount — Allow to get an access token for a service account.

#Providers

  • JwtProvider — Provides utilities for working with JSON Web Tokens (JWT).