-
Notifications
You must be signed in to change notification settings - Fork 1
Module auth Future
github-actions[bot] edited this page Aug 31, 2026
·
2 revisions
- hardening and refinement of authentication, revocation, federation, and trust verification flows
- expansion of deterministic reliability and observability behavior for provider integrations
- stricter benchmark-backed guardrails for token/session/policy hot paths
- v1.2.0: async/non-blocking operations and connection pooling for LDAP and HTTP
- v1.3.0: distributed token blacklist with cluster synchronization
- authentication contracts remain backward compatible within major release line.
- token/session validation remains fail-closed under malformed or unsupported states.
- distributed and provider-dependent paths remain bounded and observable.
- trust/policy decisions remain deterministic and auditable.
- async operations never block the caller's thread for network I/O.
- connection pooling reduces per-call overhead while maintaining deterministic behavior.
| Interface | Requirement |
|---|---|
| token validation interfaces | deterministic claim/signature/revocation behavior |
| session/revocation interfaces | bounded lifecycle and consistent invalidation semantics |
| provider/federation interfaces | explicit capability checks and failure classification |
| trust/policy interfaces | clear allow/deny reasoning and auditability |
| async auth interfaces | non-blocking dispatch to worker threads, futures-based results |
| distributed blacklist interfaces | cluster-safe JTI revocation with atomic checks |
Completed Components (v1.2.0 β production-ready):
-
AsyncHTTPAuth (
http_auth_async.h/.cpp)- Non-blocking HTTP GET/POST for OAuth, OIDC, SAML discovery
- Uses AuthWorkerThreadPool for concurrent operations
- Retry logic with exponential backoff for transient failures
- Timeout configuration per request type
- SSL certificate validation options
-
LDAPAuthenticator::authenticateAsync()
- Async wrapper for LDAP bind operations
- Dispatches blocking calls to worker thread pool
- Returns std::future
- P99 latency target: β€50ms visible to callers
-
LDAPConnectionPool (already implemented)
- Pre-warmed pool of idle LDAP connections
- Health checks on every checkout
- Stale connection eviction and recreation
- Configurable min_idle, max_size, checkout_timeout_ms
Completed Components (v1.3.0 β production-ready, TBLK/v1 RPC fully shipped):
-
DistributedTokenBlacklist (
distributed_token_blacklist.h/.cpp)- RocksDB persistence layer (extends RocksDBTokenBlacklist)
- Background purge thread for expired entries
- Background replication thread for cluster sync
- Leader election using node ID ordering (local O(#peers) string comparison)
- Pull-based synchronization from followers to leader β production TBLK/v1 TCP implementation
- Push-based synchronization from leader to all followers β production TBLK/v1 TCP implementation
- TCP server listener (
serveIncomingConnections/handlePeerConnection) for inbound PUSH and PULL_REQ -
getAllEntries()β full RocksDB iterator scan, filtered to non-expired entries -
applyEntries()β LWW batch write, expired entries dropped silently
-
TBLK/v1 Binary Wire Protocol
- Header layout:
magic[4]("TBLK") | version[1](0x01) | type[1] | count[4 BE]= 10 bytes - Entry layout per entry:
jti_len[2 BE] | jti[jti_len] | expiry_unix_secs[8 BE int64] - Message types: PUSH(0x01) = leaderβfollower, PULL_REQ(0x02) = followerβleader, PULL_RESP(0x03) = leaderβfollower, ACK(0x04) = any direction
- Safety caps: max JTI length = 1024 bytes; max entries per message = 1,000,000
- Timeout enforcement: non-blocking
connectWithTimeout()viaselect()+ SO_ERROR; SO_RCVTIMEO / SO_SNDTIMEO for data transfer, bounded bypeer_rpc_timeout_ms - POSIX (
sendAllusesMSG_NOSIGNAL) and Windows (ioctlsocket+closesocket) both supported
- Header layout:
-
Cluster Architecture
- Local node: persists JTI revocations to RocksDB
- Peer nodes: maintain synchronized copy of blacklist
- Leader: node with lexicographically lowest
node_id; acts as source of truth - Followers: pull updates from leader via PULL_REQ / PULL_RESP exchange
- Leader also pushes: leader initiates PUSH to each follower in
performClusterSync() - Conflict resolution: Last-Write-Wins β
applyEntries()overwrites without comparing
-
Fault Tolerance
- Continues operating if peers are temporarily unavailable (bind failure is non-fatal)
- Leader re-election on each
performClusterSync()call (stateless, purely local) - Bounded
peer_rpc_timeout_msprevents cascading delays - Graceful degradation:
performClusterSync()returnsfalsewhen no peers are reachable
- protocol-matrix unit and integration suites across auth methods.
- replay/revocation and distributed-state regression scenarios.
- degraded-provider and failover/fallback deterministic tests.
- release-profile benchmark runs for mapped auth targets.
- New for v1.2.0: async non-blocking behavior validation
- New for v1.2.0: connection pool health checks and reuse metrics
-
v1.3.0 delivered (tests/auth/test_auth_distributed_blacklist.cpp, DBL-01..DBL-17):
- DBL-01..08: core CRUD (add, isRevoked, future/past expiry, purgeExpired, concurrency, idempotent re-add)
- DBL-09..11: leader election (sole node, lowest node_id wins, isLeader() post-election state)
- DBL-12..14: cluster API (syncWithCluster future, single-node convergence, timeout with unreachable peer)
- DBL-15..17: observability + lifecycle (ReplicationStats zero-init, config accessor round-trip, RAII destructor)
- LDAP bind latency P99 β€ 50 ms visible to callers (backend may take 200 ms)
- OAuth token requests never block caller's thread
- OIDC discovery fetches run in background, cached results available immediately
- HTTP retry logic completes within configured timeout (default 30 sec)
- isRevoked() remains O(1) lookup in RocksDB (constant-time, < 1 Β΅s warm cache)
- add() to RocksDB negligible overhead (< 1 ms, single RocksDB Put)
- Cluster sync every 30 seconds without blocking revocation checks (configurable sync_interval_seconds)
- Token validation hot path unaffected by replication activity (background threads)
- Purge thread runs independently; does not compete with validation
- Leader election converges locally (O(#peers) string comparison, < 1 ms)
-
pushRevisionsToFollower()/pullRevisionsFromLeader()bounded bypeer_rpc_timeout_ms(default 5 s)
- maintain strict fail-closed behavior for credential/token/provider errors.
- preserve auditable decision paths for authn/authz and trust checks.
- enforce bounded resource behavior in rate-limiter and session/revocation components.
- keep diagnostics actionable for production incident response.
- async ops: exceptions propagated through futures, never silently dropped
- connection pool: stale connections detected and evicted before use
- distributed blacklist: RocksDB WAL ensures durability; no data loss on restart
- cluster sync: RPC failures cause follower to retry; leader continues accepting revocations
Existing code using synchronous auth methods remains unchanged:
-
LDAPAuthenticator::authenticate()continues to work as before -
OIDCProvider::validateToken()remains synchronous - Token blacklist API is additive; new distributed variant is opt-in
New async code can opt-in:
- Call
authenticateAsync()to get non-blocking future - Configure AsyncHTTPAuth for OAuth/OIDC operations
- Enable
DistributedTokenBlacklistfor cluster deployments
No database migration required; RocksDB schema is auto-created on first use.
ThemisDB 1.9.0-beta Β· Home Β· Module-Index Β· GitHub Β· Issues
ThemisDB 1.9.0-beta Β· Home Β· Wiki-Index Β· Module-Index Β· FAQ Β· Quick-Reference Β· GitHub Β· Issues Β· Discussions Β· License
- Batch Operations
- Best Practices
- CRUD Tutorial
- Custom Document Ingestion
- Getting Started Tutorial
- Interactive Examples
- Schema Design
- Video Tutorials
- AQL Reference
- AQL Examples
- AQL Overview
- AQL Feature Roadmap
- AQL Geospatial Guide
- AQL LLM Migration Guide
- AQL API
- AQL Grammar (EBNF)
- AQL Root Overview
- AQL Examples (root)
- API Reference
- API Module README
- OpenAPI Overview
- Client SDK Overview
- SDK Overview
- Operations
- Operations Overview
- Operations Runbook
- Operations Handbook
- ThemisCtl Admin Guide
- Pipeline E2E SOPs
- Deploy Overview
- Docker Overview
- Docker Hub README
- Helm Overview
- Packaging Overview
- Operator Overview
- Security Policy
- Production Hardening Checklist
- Security Hardening Guide
- Encryption Key Management
- Access Control Framework
- Zero Trust Policy
- API Authentication & Authorization
- HSM Production Setup
- PKCS11 Integration
- DSGVO / SOC2 Checklist
- Access Model Runbooks
- Access Model Dashboard
- Maturity Automation Runbook
- Access Review Automation
- Access Model Dashboard
- Access Model Runbooks
- Rights Revocation
- Dr Checklists
- Dr Testing
- Incident Response Playbook
- Incident Response Testing
- GPU Oom Recovery
- Grammar Debugging
- Metrics Scrape Troubleshooting
- Model Swap Procedure
- Quota Tuning
- Subagent Deployment
- Logging Configuration
- Content Model
- Crypto & Keys
- Feature Flags Reference
- Modular Architecture Roadmap
- Modularization Guide
- Module Architecture Index
- PostgreSQL Wire Protocol
- Query Scheduling
- Raft Consensus Design
- Resource Pooling
- Source Directory Guide
- Unified Access Model
- E1 001 Layered Retrieval Design
- E1 002 Ann Abstraction Strategy
- E1 003 Tensor Summary Types
- E1 004 Lora Package Distinction
- E1 005 Model Switch Compatibility
- E1 006 Federated Tensor Summaries
- E2 001 Evaluation Framework Design
- E2 002 Hardware Profile Strategy
- E2 003 Query Planner Routing Model
- E2 004 Approximation Governance Rules
- E2 005 Cross Layer Fallback Confidence Policy
- E3 001 Distributed Tensor Design
- E3 002 Manifest Coordination Strategy
- E3 003 Recovery And Erasure Choice
- E3 004 Tensor Fabric Infrastructure
- Contributing
- Contributing (root)
- Code of Conduct
- Support
- Maintainers
- CTest Guide
- Build Quick Reference
- Developer Wiki Index
- Build / Test / CI
- Module Index
- Branching Strategy
- Disabled Stub Policy
- Docs PR Policy
- GA Promotion Sign Off
- Github Milestones Setup
- Maturity Claim Verification Checklist
- Maturity Evidence Registry
- Merge Gate Bot Config
- Merge Gate Status Live
- Phase 1 Closure Report
- Phase Closure Policy
- Phase Dependency Graph
- Phase3 Enforcement Runbook
- Plugin Submodule Rollback
- PR Version Targeting
- PR Version Targeting Backfill
- Production Ready 2026 Delivery Plan
- Query Module Status
- Readme
- Release Promotion Gate Policy
- Release Validation Checklist
- Security Module 5671 Evidence Summary
- Sharding P6 Residual Risk Acceptance
- Sourcecode Compliance Governance
- Updates Development Status Sign Off
- Wave C Implementation Complete
- Blob Storage
- Cuda
- Ethics Ai
- Exporters
- Huggingface
- Image Analysis
- Importers
- RPC
- Scraper
- Themisdb Ai Watermark Detector
- User Storage Encrypted
- Chimera Architecture
- Chimera Future
- Chimera Readme
- Chimera Roadmap
- Covina Fastapi Ingestion Architecture
- Covina Fastapi Ingestion Future
- Covina Fastapi Ingestion Roadmap
- Vcc Base Architecture
- Vcc Base Future
- Vcc Base Roadmap
- Vcc Clara Ingestion Architecture
- Vcc Clara Ingestion Future
- Vcc Clara Ingestion Roadmap
- Vcc Veritas Architecture
- Vcc Veritas Future
- Vcc Veritas Roadmap
- 01 Hello World
- 02 Todo App
- 03 Contact Manager
- 04 Inventory System
- 05 Time Series Monitor
- 06 Graph Social Network
- 07 Vector Search Documents
- 08 Dms Erp System
- 09 Iot Sensor Network
- 10 Drone Image Analysis
- 11 Blog Wiki
- 12 Expense Tracker
- 13 Recipe Manager
- 14 Ecommerce Catalog
- 15 Event Management
- 16 Kanban Board
- 17 Crm
- 18 Realtime Chat
- 19 Recommendation Engine
- 20 Smart Home
- 21 Coding Platform
- 22 AQL Diagram Tool
- 23 Traveling Salesman
- 24 Moral Philosophy Debates
- API Versioning
- Distributed Sharding
- Feedback Plugins
- Geo
- Gnn
- Image Analysis
- Legal Lora Training
- LLM
- Lora Sync
- Migration
- Nlp
- Performance
- Railway
- Replication
- Rope Visualization
- Sample Product Config
- Security
- Client SDK Overview
- Quickstart
- Sdk Enhancements
- Sdk Implementation Summary
- Test Suite Readme
- Go
- Java
- Javascript
- Php
- Python
- Ruby
- Rust
- Typescript
- 01 Grundlegende Operationen
- 02 AQL Queries
- 03 Graph Daten
- 04 Multimodell Anwendung
- 01 Quickstart Guide
- 02 AQL Referenz Kurzuebersicht
- 03 Datenmodellierung Guide
- 04 Uebungsaufgaben
- 05 Best Practices Guide
- Training Documents
- Training Overview
- 01 Einfuehrung Und Uebersicht
- 02 Datenmodelle Und Architektur
- 03 AQL Abfragesprache
- 04 Installation Und Setup
- 05 Anwendungsbeispiele
- Training Presentations
- Dependencies Readme
- Processmonitor Readme
- Themis.admintools.shared Readme
- Themis.aqlquerybuilder Readme
- Themis.aqlquerybuilder Roadmap
- Themis.auditlogviewer Readme
- Themis.auditlogviewer Roadmap
- Themis.classificationdashboard Readme
- Themis.classificationdashboard Roadmap
- Themis.compliancereports Readme
- Themis.compliancereports Roadmap
- Themis.gisviewer.controlpanel Readme
- Themis.gisviewer.controlpanel Roadmap
- Themis.impactanalysisviewer Readme
- Themis.impactanalysisviewer Roadmap
- Themis.ingestiontool Readme
- Themis.ingestiontool Roadmap
- Themis.keyrotationdashboard Readme
- Themis.keyrotationdashboard Roadmap
- Themis.piimanager Readme
- Themis.piimanager Roadmap
- Themis.retentionmanager Readme
- Themis.retentionmanager Roadmap
- Themis.sagaverifier Readme
- Themis.sagaverifier Roadmap
- Themis.usbadmintool Readme
- Themis.usbadmintool Roadmap
- CI Readme
- CI Roadmap
- Compiler Diagnostics Readme
- Compiler Diagnostics Roadmap
- Completion Readme
- Copilot Ollama Router Readme
- Copilot Ollama Router Roadmap
- Gnn Readme
- Gnn Roadmap
- Rope Visualizer Readme
- Rope Visualizer Roadmap
- Tco Calculator Readme
- Tco Calculator Roadmap
- Tests Readme
- Tests Roadmap
- Themis Config Wx Readme
- Themis Docs Builder Readme
- Wikipedia Ingestion Readme