Skip to content

reverb256/astral-key

Repository files navigation

Astral Key

NixOS Rust License

Production-ready microservice for Web3, FIDO2, and Passkey authentication with Vaultwarden backend


✅ PRODUCTION STATUS: FULLY IMPLEMENTED (~95% Complete)

Astral Key is a production-ready authentication microservice with complete Web3 SIWE and FIDO2/WebAuthn implementations.

What Works:

  • ✅ Full Web3 authentication with real Ethereum signature verification (ethers-rs)
  • ✅ FIDO2/Passkey authentication flow with database storage
  • ✅ JWT token generation, validation, and rotation
  • ✅ Session management with Redis-backed token blacklist
  • ✅ Protected routes with JWT middleware
  • ✅ Database integration (PostgreSQL with SQLx)
  • ✅ Redis cache integration
  • ✅ Production Docker deployment
  • ✅ NixOS module for declarative deployment
  • ✅ CI/CD pipeline with GitHub Actions
  • ✅ Comprehensive testing infrastructure

What's Optional:

  • ⚠️ Full WebAuthn attestation verification (webauthn-rs integration optional)

Current Progress: See STATUS.md for detailed implementation status. Testing Guide: See TESTING.md for comprehensive testing instructions.


Overview

Astral Key is a next-generation authentication microservice designed for Web3, FIDO2, and Passkey authentication. Built on NixOS with cutting-edge Nix features, it provides a secure, declarative, and reproducible authentication infrastructure backed by Vaultwarden for credential management.

Overview

Astral Key is a next-generation authentication microservice designed for Web3, FIDO2, and Passkey authentication. Built on NixOS with cutting-edge Nix features, it provides a secure, declarative, and reproducible authentication infrastructure backed by Vaultwarden for credential management.

Features

  • Web3 Authentication: Sign-In with Ethereum (SIWE), multi-chain support (Ethereum, Polygon, Arbitrum, Optimism, Solana)
  • FIDO2/Passkey: Full WebAuthn implementation with platform and roaming authenticator support
  • Vaultwarden Integration: Secure credential storage and management
  • High Performance: Built with Rust and Axum for maximum throughput
  • NixOS Native: Declarative configuration, reproducible builds, seamless deployment

Quick Start

Start the complete authentication microservice:

Prerequisites:

  • Docker and Docker Compose (for infrastructure)
  • Nix with flakes (recommended) or Rust 1.82+

Option 1: Using Rust directly (Current)

# Clone the repository
git clone https://github.com/reverb256/astral-key.git
cd astral-key

# Start development server
cargo run

# Server starts on http://localhost:8080
# Health check: curl http://localhost:8080/health
# (Note: Auth endpoints will return errors)

Option 2: Using Nix (Not Yet Available)

# Enter development shell
nix develop

# Start database services (when docker-compose.yml exists)
just db-up

# Run migrations (when migrations are created)
just migrate

# Start development server
just dev

Recommendation: For now, use cargo run to explore the API structure. Database infrastructure and authentication features will be implemented following the ROADMAP.md.

Architecture

See ARCHITECTURE.md for detailed system design and implementation details.

API Documentation

API documentation is available at /docs when running the server, or see docs/api.md.

Development

Current Status

See STATUS.md for detailed implementation progress and ROADMAP.md for the implementation plan.

Prerequisites

  • Rust 1.75+ (for current development)
  • Nix with flakes enabled (when flake.nix exists - coming soon)
  • direnv (optional but recommended)

Setup

# Clone the repository
git clone https://github.com/reverb256/astral-key.git
cd astral-key

# Run the server (current state)
cargo run

# Test health endpoint
curl http://localhost:8080/health

Planned Commands (When Infrastructure is Ready)

Command Description Status
just dev Start development server with hot reload 🔨 Planned
just test Run all tests 🔨 Planned
just db-up Start PostgreSQL and Redis services 🔨 Planned
just migrate Run database migrations 🔨 Planned
just fmt Format code ✅ Works (cargo fmt)
just lint Run clippy and other linters ✅ Works (cargo clippy)
just build Build production binary ✅ Works (cargo build)
just container Build container image 🔨 Planned

See CONTRIBUTING.md for detailed development guidelines.

Deployment

⚠️ Deployment is not yet ready. The following are planned features:

NixOS Module (Planned)

The NixOS module described in ARCHITECTURE.md is not yet implemented.

Container (Planned)

Container image build is documented but not yet available.

Prerequisites for Deployment

  • Complete Phase 1-2 of roadmap (Foundation, Database, Cache)
  • Complete Phase 3-4 (FIDO2, Web3 authentication)
  • Complete Phase 7 (Testing)
  • Security audit passed

See ROADMAP.md for the complete implementation timeline.

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

About

Microservice for Web3, FIDO, and Passkey authentication with Vaultwarden backend

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors