{"id":42427943,"url":"https://github.com/inferadb/common","last_synced_at":"2026-06-14T05:01:37.736Z","repository":{"id":333384698,"uuid":"1137106082","full_name":"inferadb/common","owner":"inferadb","description":"InferaDB common — shared Rust utilities, crates, and foundational libraries","archived":false,"fork":false,"pushed_at":"2026-06-07T03:17:24.000Z","size":1327,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T05:19:38.637Z","etag":null,"topics":["access-control","authorization","crates","fine-grained-access-control","inferadb","permissions","rebac","rust","shared-library","utilities","zanzibar"],"latest_commit_sha":null,"homepage":"https://inferadb.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inferadb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-18T23:09:44.000Z","updated_at":"2026-04-07T06:42:34.000Z","dependencies_parsed_at":"2026-03-09T05:08:26.333Z","dependency_job_id":null,"html_url":"https://github.com/inferadb/common","commit_stats":null,"previous_names":["inferadb/common"],"tags_count":180,"template":false,"template_full_name":null,"purl":"pkg:github/inferadb/common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferadb%2Fcommon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferadb%2Fcommon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferadb%2Fcommon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferadb%2Fcommon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inferadb","download_url":"https://codeload.github.com/inferadb/common/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferadb%2Fcommon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34309655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access-control","authorization","crates","fine-grained-access-control","inferadb","permissions","rebac","rust","shared-library","utilities","zanzibar"],"created_at":"2026-01-28T03:30:32.297Z","updated_at":"2026-06-14T05:01:37.706Z","avatar_url":"https://github.com/inferadb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cp\u003e\u003ca href=\"https://inferadb.com\"\u003e\u003cimg src=\".github/inferadb.png\" width=\"100\" alt=\"InferaDB Logo\" /\u003e\u003c/a\u003e\u003c/p\u003e\n    \u003ch1\u003eInferaDB Common\u003c/h1\u003e\n    \u003cp\u003e\n        \u003ca href=\"https://discord.gg/inferadb\"\u003e\u003cimg src=\"https://img.shields.io/badge/Discord-Join%20us-5865F2?logo=discord\u0026logoColor=white\" alt=\"Discord\" /\u003e\u003c/a\u003e\n        \u003ca href=\"#license\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg\" alt=\"License\" /\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/inferadb/common/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/inferadb/common/ci.yml?branch=main\" alt=\"CI\" /\u003e\u003c/a\u003e\n        \u003ca href=\"https://crates.io/crates/inferadb-common-storage\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/inferadb-common-storage.svg\" alt=\"crates.io\" /\u003e\u003c/a\u003e\n    \u003c/p\u003e\n    \u003cp\u003e\u003cb\u003eShared storage abstractions and authentication for InferaDB services.\u003c/b\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n\u003e [!IMPORTANT]\n\u003e Under active development. Not production-ready.\n\n**InferaDB Common provides the storage abstraction layer, JWT authentication, and rate limiting used by [InferaDB Engine](https://github.com/inferadb/engine) and [InferaDB Control](https://github.com/inferadb/control).** It defines a pluggable `StorageBackend` trait for persistent storage, a hardened EdDSA-only JWT validator with three-tier key caching, and a distributed fixed-window rate limiter.\n\n- [Crates](#crates)\n- [Quick Start](#quick-start)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [Community](#community)\n- [License](#license)\n\n## Crates\n\n| Crate                                                     | Description                                                                                           |\n| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |\n| [`inferadb-common-storage`](crates/storage)               | Storage backend trait, in-memory implementation, batch writer, metrics, rate limiting, size limits    |\n| [`inferadb-common-storage-ledger`](crates/storage-ledger) | [Ledger](https://github.com/inferadb/ledger)-backed storage with retry, timeout, circuit breaker, CAS |\n| [`inferadb-common-authn`](crates/authn)                   | JWT validation, signing key cache, replay detection, audit logging                                    |\n| [`inferadb-common-ratelimit`](crates/ratelimit)           | Distributed fixed-window rate limiter backed by any `StorageBackend`                                  |\n\n## Quick Start\n\n```bash\ngit clone https://github.com/inferadb/common.git\ncd common\nmise trust \u0026\u0026 mise install\njust build\njust test\n```\n\n## Usage\n\n### In-Memory Backend (Testing)\n\n```rust\nuse inferadb_common_storage::{MemoryBackend, StorageBackend, to_storage_range};\n\nlet backend = MemoryBackend::new();\n\nbackend.set(b\"key\".to_vec(), b\"value\".to_vec()).await?;\nlet value = backend.get(b\"key\").await?;\nbackend.delete(b\"key\").await?;\n\nlet entries = backend\n    .get_range(to_storage_range(b\"prefix:\".to_vec()..b\"prefix:\\xff\".to_vec()))\n    .await?;\n```\n\n### Ledger Backend (Production)\n\n```rust\nuse inferadb_common_storage_ledger::{\n    ClientConfig, LedgerBackend, LedgerBackendConfig, ServerSource,\n};\n\nlet client = ClientConfig::builder()\n    .servers(ServerSource::from_static([\"http://ledger.example.com:50051\"]))\n    .client_id(\"my-service\")\n    .build()?;\n\nlet config = LedgerBackendConfig::builder()\n    .client(client)\n    .caller(1)\n    .organization(1)\n    .build()?;\n\nlet backend = LedgerBackend::new(config).await?;\n```\n\n### JWT Validation\n\n```rust\nuse std::sync::Arc;\nuse std::time::Duration;\nuse inferadb_common_authn::{SigningKeyCache, jwt::verify_with_signing_key_cache};\nuse inferadb_common_storage::auth::MemorySigningKeyStore;\n\nlet store = Arc::new(MemorySigningKeyStore::new());\nlet cache = SigningKeyCache::new(store, Duration::from_secs(300));\n\nlet claims = verify_with_signing_key_cache(token, \u0026cache).await?;\nprintln!(\"org: {}\", claims.org.unwrap_or_default());\n```\n\n### Rate Limiting\n\n```rust\nuse inferadb_common_storage::MemoryBackend;\nuse inferadb_common_ratelimit::{AppRateLimiter, RateLimitPolicy, RateLimitOutcome};\n\nlet limiter = AppRateLimiter::new(MemoryBackend::new());\n\nlet policy = RateLimitPolicy::per_hour(100)?;\nlet outcome = limiter.check(\"login_ip\", \"192.168.1.1\", \u0026policy).await?;\nif let RateLimitOutcome::Allowed { remaining, .. } = outcome {\n    println!(\"{remaining} requests remaining\");\n}\n```\n\n## Contributing\n\n### Prerequisites\n\n- Rust 1.92+ and nightly\n- [mise](https://mise.jdx.dev/) for synchronized development tooling\n- [just](https://github.com/casey/just) for development commands\n\n### Build and Test\n\n```bash\njust build\njust test\njust check   # build + clippy + test + format\n```\n\n### Additional Test Suites\n\n```bash\njust test-failpoints    # deterministic fault injection\njust test-stress        # concurrency stress tests\njust test-integration   # requires a running Ledger server\njust fuzz               # JWT parsing fuzz targets (requires cargo-fuzz)\n```\n\nSee the [Contributing Guide](../CLAUDE.md) for commit conventions and PR process.\n\n## Community\n\nJoin us on [Discord](https://discord.gg/inferadb) for questions and discussions.\n\n## License\n\nDual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finferadb%2Fcommon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finferadb%2Fcommon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finferadb%2Fcommon/lists"}