Files
ad/molodetz/docs_api/join.py
T
retoor 9fb4d65787 Member invites, gallery resync, content and operator docs
- Invite flow: admin issue/revoke on join requests, public single-use
  claim links (hash-only tokens, 7-day expiry, no state reveal), claim
  creates the Member account and marks the request accepted
- Gallery: admin status page plus resync endpoint; sync refreshes
  thumbnails whose content changed; tools/gallery contract and checker
- Docs: public content page, admin-only operator runbook, api.md
  invite/gallery sections, all routes in the live API docs, docs
  reachability gate test
- Screenshots cover the new pages; version 1.0.18
2026-10-06 02:56:08 +02:00

52 lines
2.4 KiB
Python

# retoor <retoor@molodetz.nl>
from molodetz.docs_api.registry import endpoint, field
GROUP = {
"slug": "join",
"title": "Join",
"description": "Sign up to write along. Stored for administrators, never public.",
"endpoints": [
endpoint("GET", "/join", "Join form", sample={"submitted": False}),
endpoint(
"POST",
"/join",
"I'm in",
"Stores a join request: name, contact and an optional repo link.",
fields=[
field("name", required=True, example="Ada"),
field("contact", required=True, example="ada@example.com"),
field("repo_url", example="https://git.example.com/ada"),
field("message", example="I write about finishing things."),
],
sample={"ok": True, "redirect": "/join?ok=1", "data": {"uid": "0190..."}},
probe_body={"name": "Probe", "contact": "probe@example.com"},
),
endpoint(
"GET",
"/invite/{token}",
"Invite claim form",
"Shows the claim form for a live invite; unknown, used and expired links answer 404 with the same message.",
fields=[field("token", required=True, location="path", example="unknown-token")],
sample={"valid": True, "username": "ada", "email": "ada@example.com", "email_locked": True},
probe_path="/invite/unknown-token",
),
endpoint(
"POST",
"/invite/{token}",
"Claim invite",
"Creates the Member account, logs in and marks the join request accepted. Single use.",
fields=[
field("token", required=True, location="path", example="unknown-token"),
field("username", required=True, example="ada"),
field("email", required=True, example="ada@example.com"),
field("password", required=True, example="correct horse battery staple"),
field("password_confirm", required=True, example="correct horse battery staple"),
field("terms", required=True, type="boolean", example=True),
],
sample={"ok": True, "redirect": "/", "data": {"username": "ada"}},
probe_path="/invite/unknown-token",
probe_body={"username": "Probe", "email": "probe@example.com", "password": "probe-pass-1", "password_confirm": "probe-pass-1", "terms": True},
),
],
}