Tribork

Documentation

Tribork

Self-hosted authentication and session tokens.

Tribork issues signed session tokens for your applications and verifies them over a small HTTP API. Access tokens are short-lived and paired with refresh tokens, so a leaked token expires quickly.

Sessions can be revoked individually or per user. Verification consults a live revocation list, so a sign-out takes effect immediately across every service.

#Installation

Tribork ships as one static binary. Place it on your host and start it:

# download and start
$ curl -sSL get.vl.stas.me/install | sh
$ tribork serve --data /var/lib/tribork
→ listening on :3200 · api ready
By default Tribork binds to 127.0.0.1:3200. Put it behind your own reverse proxy to expose it over TLS.

#Quickstart

# issue a token
$ curl -X POST :3200/v1/tokens \
    -d '{"user":"alice"}'
→ {"token":"eyJ..."}

# verify it
$ curl :3200/v1/verify \
    -H 'authorization: Bearer eyJ...'
{"user":"alice","valid":true}

#Configuration

Configure with flags, environment variables, or a small YAML file. Flags take precedence.

# tribork.yaml
data:    /var/lib/tribork
listen:  127.0.0.1:3200
log:     info
tokens:
  access_ttl: 15m
  refresh_ttl: 720h

#API reference

Every route lives under /v1. Requests without a valid token return 401.

Method & pathDescription
POST /v1/tokensIssue a session token.
GET /v1/verifyVerify a token from the Authorization header.
POST /v1/tokens/refreshExchange a refresh token for a new one.
DELETE /v1/sessions/{id}Revoke a session.
GET /healthLiveness probe. Returns 200 when ready.

#CLI

The tribork binary is both the server and the client.

CommandDescription
tribork serveStart the server.
tribork issue <user>Issue a token.
tribork revoke <session>Revoke a session.
tribork statusShow active session counts.