Module: RackJwtAegis

Defined in:
lib/rack_jwt_aegis.rb,
lib/rack_jwt_aegis/version.rb,
lib/rack_jwt_aegis/middleware.rb,
lib/rack_jwt_aegis/debug_logger.rb,
lib/rack_jwt_aegis/rbac_manager.rb,
lib/rack_jwt_aegis/cache_adapter.rb,
lib/rack_jwt_aegis/configuration.rb,
lib/rack_jwt_aegis/jwt_validator.rb,
lib/rack_jwt_aegis/request_context.rb,
lib/rack_jwt_aegis/response_builder.rb,
lib/rack_jwt_aegis/multi_tenant_validator.rb

Overview

RackJwtAegis is a comprehensive JWT authentication and authorization middleware for Rack applications. It provides multi-tenant support, RBAC (Role-Based Access Control), and caching capabilities.

Features:

  • JWT token validation with configurable algorithms
  • Multi-tenant validation (subdomain and pathname slug based)
  • RBAC with flexible permission caching
  • Multiple cache adapter support (Memory, Redis, Memcached, SolidCache)
  • Request context management
  • Configurable skip paths and custom validators

Examples:

Basic usage

use RackJwtAegis::Middleware, jwt_secret: ENV['JWT_SECRET']

Multi-tenant with RBAC

use RackJwtAegis::Middleware, {
  jwt_secret: ENV['JWT_SECRET'],
  validate_subdomain: true,
  validate_pathname_slug: true,
  rbac_enabled: true,
}

Author:

  • Ken Camajalan Demanawa

Since:

  • 0.1.0

Defined Under Namespace

Modules: DebugLogger Classes: AuthenticationError, AuthorizationError, CacheAdapter, CacheError, Configuration, ConfigurationError, Error, JwtValidator, MemcachedAdapter, MemoryAdapter, Middleware, MultiTenantValidator, RbacManager, RedisAdapter, RequestContext, ResponseBuilder, SolidCacheAdapter

Constant Summary collapse

VERSION =

Since:

  • 0.1.0

'1.1.1'