Skip to content

Auth sessions

Users with hashed credentials and the sessions they opened, with tokens, IPs and user agents.

related volume small PeopleEventsIdentifiersRelationships
Languages
eng
Formats
jsonl

Recipe

recipe.gbddl
gbddl 1
language eng

table users rows 6 (
  id            uuid primarykey uuid()
  email         text unique email()
  password_hash text hash(algorithm: "sha256", sourceField: "email")
  mfa_enabled   boolean boolean(trueRate: 40%)
)

table sessions rows 14 per(users, 1, 4) (
  id         uuid primarykey uuid()
  user_id    uuid fk(users.id)
  token      text jwt()
  ip         text ip()
  user_agent text userAgent()
  started_at timestamp datetime(min: "2024-01-01 00:00:00", max: "2024-06-30 23:59:59")
)

output jsonl

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

Auth sessions

A recipe for testing sign-in and session handling: users with hashed credentials and the sessions they opened, written as JSON Lines.

What it demonstrates

  • Identifiers: uuid() primary keys and foreign keys between users and sessions.
  • Security values: hash(algorithm: "sha256", ...) produces digests, so no plaintext password column exists; jwt() produces session tokens.
  • Request fields: ip() and userAgent() describe where each session came from.
  • Row distribution: per(users, 1, 4) gives each user 1 to 4 sessions.

Run it

Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it into Chef, to generate the data. The repository's local runner (run by task test) also generates it and verifies its output.

The recipe outputs JSON Lines (jsonl) files for the users and sessions tables, one object per line.

Guarantees

Every primary key is unique, e-mails are unique and every session names an existing user. Tokens and digests are synthetic and grant no access.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

uuidemailhashbooleanjwtipuserAgentdatetimeuniquefkperprimary-key