Skip to content

Latest commit

 

History

145 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OathMesh Logo

OathMesh

🔐 Every machine call gets a short-lived, signed identity.

OathMesh in action

Stop leaking API keys. Replace static secrets with cryptographically verified tokens that expire in 5 minutes or less.

⚠️ Pre-production: OathMesh has not yet received an independent security audit, but it is currently structurally ready for Early Adopter/MVP deployments.

CI Status npm version pypi version GitHub Release License Stars Contributors


✨ Features

  • 🔑 Zero API Keys — No more long-lived secrets in environment variables
  • ⏱️ Short-Lived Tokens — Maximum 300 seconds TTL, auto-expiring credentials
  • 🛡️ Zero-Trust Security — Every request must prove its identity
  • 🔒 Ed25519 Signatures — Modern elliptic curve cryptography (KMS-backed via SignFunc abstraction)
  • 📋 14-Step Verification — Func-slice pipeline with step-annotated errors for instant diagnosis
  • 🌐 Polyglot SDKs — Go, Node.js (TypeScript), and Python supported
  • 📊 Full Audit Trail — Every allow and deny logged via composable FanOutAuditSink
  • 🔄 Policy-Driven — Apple Pkl-based rules, hot-reload, default deny
  • 🌐 Gateway Integrations — Native Envoy ext_authz and Kong Go PDK plugins
  • ⚡ Performance Proven — Sub-millisecond p99 latency overhead mathematically verified
  • 🛠️ CLI Native — Terminal-driven management for robust GitOps integration
  • 🛑 Stateful Revocation — Redis-backed O(1) revocation lists directly synced
  • 🤖 CI Native Auto-Sign — Built-in OIDC exchange mappings for GitHub Actions and GitLab CI
  • ⚡ Circuit-Breaker Replay Defense — Redis failover to in-process cache (never fails open)
  • 🚀 JWKS Pre-Warming — Eliminate cold-start latency with JWKSCache.PreWarm(ctx)

📚 SDKs

Language Package Frameworks
Go github.com/oathmesh/oathmesh chi, stdlib net/http
Node.js @oathmesh/sdk Express, Next.js (App, Pages, Edge)
Python oathmesh FastAPI, Flask, Django

SDK Feature Comparison

Feature Go SDK Node.js SDK Python SDK
Token verification ✅ Full 14-step ✅ Full 14-step (Go-aligned semantics) ✅ Full 14-step (Go-aligned semantics)
alg:none rejection ✅ ✅ ✅
Exact audience match ✅ ✅ ✅
Subject format validation ✅ ✅ ✅
rqh binding ✅ ✅ ✅
Binding-required mode (rqh) ✅ ✅ ✅
Future iat rejection ✅ ✅ ✅
Replay cache ✅ Built-in ✅ Built-in (InMemoryReplayCache) ✅ Built-in (InMemoryReplayCache)
Revocation list (step 13.5) ✅ Conformance-covered ✅ Conformance-covered (InMemory/Redis) ✅ Conformance-covered (InMemory/Redis)
Fail-closed Caching ✅ ✅ ✅
Policy evaluation ✅ Built-in (Pkl) ✅ Built-in (JSON) ✅ Built-in (JSON)

Conformance note: Node.js and Python verifiers were tightened toward the canonical Go step semantics (for example: alg=none rejection, subject format validation, required request binding semantics, future-iat rejection, and fail-closed cache behaviors). This establishes exact behavioral parity.


🚦 Start Here

Use this canonical developer entry flow:

  1. Step 1 (commands): QUICKSTART.md
  2. Step 2 (guided onboarding): docs/GETTING_STARTED.md
  3. Step 3 (full docs index): docs/INDEX.md

Step 1 is the canonical runnable path for local verification (issuer http://localhost:4000, protected chi-api at http://localhost:8081).

✅ Local quality checks (before a PR)

Run the minimal local quality workflow:

make quality-local

If make is not available (for example on some Windows setups), run the same flow manually:

go test ./...
golangci-lint run ./...  # if installed
govulncheck ./...        # if installed

📦 Installation

Go

go install github.com/oathmesh/oathmesh/cmd/oathmesh@latest

Node.js / TypeScript

npm install @oathmesh/sdk
# or
yarn add @oathmesh/sdk
# or
pnpm add @oathmesh/sdk

Python

pip install oathmesh
# or
poetry add oathmesh

Docker

docker pull oathmesh/oathmesh:latest

💻 Usage Examples

Go Middleware

r.Use(middleware.OathMeshMiddleware(cfg))
caller := middleware.CallerFrom(r.Context())
// caller.Principal.Subject, caller.Action, caller.TokenID

Express (TypeScript)

import { verifyToken } from '@oathmesh/sdk';

app.use(verifyToken({ audience, trustedIssuers }));
// req.oathmeshContext is fully typed

Next.js (App Router)

import { withOathMesh } from '@oathmesh/sdk/next';

const oathmesh = withOathMesh({ audience, trustedIssuers });

export async function GET(request: NextRequest) {
  const { caller, error } = await oathmesh(request);
  if (error) return error;
  return NextResponse.json({ subject: caller.principal.subject });
}

FastAPI (Python)

from oathmesh import verify_token, VerifierConfig

caller = verify_token(request.headers["authorization"], config)
# caller.principal.subject, caller.action, caller.token_id

⚖️ Comparison

Feature API Keys Traditional JWT OathMesh
Lifetime Infinite (leaked = compromised) Hours to days ≤ 300 seconds
Cryptography None (just strings) HS256, RS256 common Ed25519 only
Replay Protection ❌ ❌ ✅ Unique jti per token
Policy Engine ❌ ❌ ✅ Pkl-based rules
Audit Logging ❌ Optional ✅ Every allow/deny
Scoped Actions ❌ Optional ✅ act claim required

🏗️ Architecture

┌──────────┐    ┌─────────┐    ┌─────────────────────┐
│ Caller   │───▶│ Issuer  │───▶│ Signs Oath Token    │
│ (bot, CI,│    │         │    │ (Ed25519, ≤300s TTL)│
│  service)│    └─────────┘    └─────────────────────┘
└──────────┘                         │
                     ┌────────────────┴────────────┐
                     ▼                             ▼
              ┌──────────────┐              ┌──────────────┐
              │   Receiver   │              │   Gateway    │
              │  (your API)  │              │ (proxy mode) │
              └──────────────┘              └──────────────┘
                     │                             │
              ┌──────┴──────┐               ┌───────┴───────┐
              │ 14-step     │               │ Injects       │
              │ verification│               │ X-OathMesh-*  │
              │ pipeline    │               │ headers       │
              └─────────────┘               └───────────────┘

Gateway Mode (oathmesh serve --gateway): A reverse proxy that verifies tokens and injects security context headers into your existing upstream services.


🗺️ Roadmap

  • 🔜 Rust SDK — Coming soon
  • 🔜 Java SDK — Coming soon
  • 🗓️ Policy UI — Visual policy editor
  • 🗓️ Audit Dashboard — Web-based log viewer

🤝 Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/YOUR_USERNAME/oathmesh.git
  3. Create a branch: git checkout -b feature/your-feature-name
  4. Make your changes and add tests
  5. Run tests: make test (Go) / npm test (Node) / pytest (Python)
  6. Submit a PR — We'll review and merge!

See CONTRIBUTING.md for detailed guidelines.


⭐ Show Your Support

If OathMesh helps you build safer systems, please:

  • Star this repository ⭐
  • Share it with your team
  • Open an issue if you find a bug or have a feature request
  • Contribute — We need SDKs for more languages!

Star this repo


📖 Documentation

Quickstarts

Tutorials

Deployment

Protocol & Security

Policy

Integrations

Performance

Documentation Hub


🔒 Security

For security vulnerabilities, please see SECURITY.md. Do NOT open a public issue for security vulnerabilities.


📄 License

MIT


Built with ❤️ by the OathMesh team

About

Short-lived signed identity for every machine call. Replace API keys with scoped, auditable Oath Tokens. Go + TypeScript + Python SDKs.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages