System Overview

Kirino is a layered authentication and authorization framework. Each layer builds on the one below it, with clear trait boundaries for customization.

mermaid

Authentication Layer

Kirino authenticates users through a three-step pipeline:

mermaid

Identity Types

TypeDescription
AnonymousUnauthenticated visitor, minimal permissions
BasicStandard user, starts with minimal permissions
TemporaryTime-limited account, auto-expires
ServiceService account for permission delegation

Credential Types

TypeDescription
OneTimeTokenSingle-use token, consumed on first use
Basic (JWT)JSON Web Token with claims and expiry
ServiceTokenLong-lived token for service accounts

Passport (Challenge) Types

TypeDescription
StaticPasswordPassword verified via argon2
KeyPairSSH key or TLS certificate verification
OAuthThird-party OAuth provider
DynamicPasswordTOTP/HOTP, email code, SMS code
CaptchareCAPTCHA or similar bot detection
BiologicalFingerprint, voice, face recognition
TemporaryWhitelistTime-limited whitelist entry

Authorization Layer

The RBAC engine follows the ANSI INCITS 359-2004 standard and implements all three RBAC levels:

mermaid

Core Design Principles

  1. 1
    Fully generic: Downstream projects define their own Permission and Subject types via traits.
  2. 2
    Deny-override semantics: Denied permissions always take precedence.
  3. 3
    In-memory first: All backends have zero-dependency reference implementations.
  4. 4
    Layered: RBAC0/1/2 are layered as separate impl blocks on RbacEngine.
  5. 5
    Cache-aware: Permission checks are cached with TTL for performance.

Session Management

Sessions bridge authentication and authorization:

mermaid

Where to Start