XRAPH/Work/API keys
Go · since 2026

Keysmith

API key lifecycle: create, validate, rotate with a grace window, revoke, suspend, and record per-request usage for analytics. The raw key is returned once at creation and never stored, since only its SHA-256 hash is kept, so a leaked database dump does not hand over live credentials.

Language
Go
Category
API keys
Since
2026
Stars
0
Repository Docs
01

Highlights

3 claims
H.01
Once
The raw key is returned

Creation hands back the key and keeps only its SHA-256 hash. A lost key is rotated, because there is nothing left to recover it from.

H.02
Zerodowntime
Rotation with a grace window

The old key stays valid for a configured period while clients move, so rotating does not mean a coordinated deploy.

H.03
Perkey
Attached to the key

Rate limits, IP allowlists, origin restrictions, lifetime constraints and quotas attach to the key itself.

02

What it does

6 entries

API keys with a lifecycle, so revoking one takes a single call.

02.1
Lifecycle

Create through revoke

Create, validate, rotate, revoke, suspend and reactivate. The raw key is returned once at creation and only its SHA-256 hash is stored, so the service cannot leak what it does not hold.

SHA-256
02.2
Scopes

Hierarchical permissions

A key carries scopes, and validating it against the scopes a route requires happens before the handler runs.

Hierarchical
02.3
Policy

Attached to the key

Rate limits, IP allowlists, origin restrictions, lifetime constraints and usage quotas are properties of the key itself.

Per-key
02.4
Rotation

A grace window while clients move

The previous key keeps working for a configured period while clients migrate, which turns rotation into something you can do on a Tuesday.

Zero downtime
02.5
Tenancy

Scoped to app and tenant

Every operation carries both on the context, so cross-tenant access is impossible at the store layer.

Context-scoped
02.6
Plugins

Opt-in lifecycle hooks

Audit trails, metrics and authorisation sync attach to creation, validation and rotation without the core knowing they exist.

Hooks
03

Anatomy

3 modules
01

Issue

Keys minted with scope and expiry at creation.

02

Verify

Constant-time checks against a hashed store.

03

Rotate

Overlapping validity so rotation is not an outage.

04

Why it exists

Design notes

#What it is

Keysmith handles the full lifecycle of API keys: generation, hashing, storage, validation, rotation, revocation and usage analytics.

#The one rule

Raw keys are returned exactly once, at creation, and never persisted. Only SHA-256 hashes are stored. A database dump therefore contains no usable credentials, and there is no "show me the key again" API to be socially engineered.

This is not novel. It is worth stating because the alternative keeps reappearing in codebases whose authors know better, usually because a support workflow asked for it.

#What it does

  • Create, validate, rotate, revoke, suspend and reactivate.
  • Hierarchical permission scopes assigned per key.
  • A policy engine covering rate limits, IP and origin allowlists, key lifetime constraints and quotas.
  • Per-request usage recording with daily and monthly aggregation.
  • Rotation with configurable grace windows, so both the old and new key validate during a cutover.
  • Opt-in plugin hooks for audit trails, metrics and authorization sync.
  • A Forge extension with DI, REST routes and automatic migration.

#Rotation, specifically

Zero-downtime rotation is the feature that determines whether anyone rotates at all. A grace window where both keys are valid means a customer can deploy the new key on their own schedule, and the old key expires on a date you both agreed rather than the moment someone clicked a button.

05

Signals

GitHub
Stars
0
Language
Go
Since
2026
Adopters
00

Shipping something on Keysmith? Nobody is listed here yet. Tell me what you built and you will be the first.

Get listed