Overview
Null Pass is an internal authentication and service management API that provides secure user authentication, two-factor authentication, session management, and service entitlements for DROP, MAILS, VAULT, and DB services. This documentation covers the internal architecture, API endpoints, database schema, security features, and operational procedures.Quick Start
Get up and running with Null Pass in minutes. Learn how to authenticate users and integrate our API.
Authentication
Understand how authentication works, including JWT tokens, 2FA, and session management.
API Reference
Complete API reference with examples for all endpoints and request/response formats.
Services
Learn about service entitlements and how to manage access to DROP, MAILS, VAULT, and DB services.
System Architecture
Authentication System
Authentication System
Technology Stack:
- JWT tokens with configurable expiration (default: 7 days)
- bcrypt password hashing (10 rounds)
- TOTP-based 2FA using speakeasy
- Session management with encrypted IP storage
- Token generation and verification (
lib/auth.ts) - Session expiration handling (
lib/session.ts) - IP encryption/decryption (
lib/ip-utils.ts)
Service Management
Service Management
Supported Services:
- DROP: File storage and sharing service
- MAILS: Email management service
- VAULT: Secure credential storage
- DB: Database service access
- User-service entitlements stored in
UserServiceEntitlementtable - Tier-based access (free, premium, custom)
- Custom storage and API key limits
- Polar subscription integration
Database Schema
Database Schema
Core Models:
User: User accounts with 2FA supportSession: Active user sessions with encrypted IPsUserServiceEntitlement: Service access permissionsAuditLog: Complete audit trail of all actions
Security Features
Security Features
Protection Layers:
- Arcjet integration (rate limiting, bot detection, shield)
- CORS handling with origin validation
- Encrypted IP address storage (user-specific encryption)
- Audit logging for all critical actions
- Account ban and disable functionality
Base URL
Development:http://localhost:3000/apiProduction:
https://api.nullpass.xyz/api
Environment Variables
Secret key for signing JWT tokens. Must be set in production.
Token expiration time. Format:
{number}{s|m|h|d} (e.g., “7d”, “24h”, “30m”)PostgreSQL connection string for Prisma
Arcjet API key for rate limiting and bot protection
Internal secret key required for Null Pass API access. This secret is used for internal authentication and authorization.
Authentication Flow
Most endpoints require authentication using a JWT token:- Contains
userIdandemail - Expires after 7 days (configurable via
JWT_EXPIRES_IN) - Stored in
Sessiontable with encrypted IP address
Quick Links
API Endpoints
Complete API reference for all endpoints
Database Schema
Prisma schema and database structure
Security & Audit
Security features and audit logging
Service Management
Service entitlements and access control
Development
Quickstart Guide
Set up local development environment