Skip to content

Navigation Menu

Sign in
Sign up
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: samananias/printerService
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
Loading
...
head repository: samananias/printerService
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: auth-security
Choose a head ref
Loading
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 16 files changed
  • 1 contributor

Commits on Sep 4, 2026

  1. auth: PIN login gate - one-time login issues in-memory session tokens

    - app/services/sessions.py: module-level token set (secrets.token_urlsafe),
     no persistence - a restart invalidates every token, and since config
     loads once at startup a PIN change is a restart, so one rule covers both
     re-prompt triggers
    - require_pin additively accepts a valid token in X-Session-Token; the
     raw X-API-PIN header path is unchanged
    - new GET /auth/status (always 200; pin_required + session_valid
     true/false/null) and POST /auth/login (401 wrong PIN, 400 when no PIN
     is configured); router mounted in app/main.py
    - web: shared gate overlay (GATE_HTML) on both pages styled as a third
     notebook page, Remember checkbox picks localStorage vs sessionStorage,
     the old per-action id="pin" field and its JS read sites are gone in
     favor of one authHeaders() helper, 401 mid-action re-raises the gate,
     and checkGate() rides the 30 s health poll for restart re-prompt
    - docs: LOGIN_PLAN.md decision record (review + as-built), WEBDESIGN_PLAN
     §12 addendum, SOURCE_OF_TRUTH §8/§11, README/.env.example API_PIN text
    - tests: new unit (sessions, token path of require_pin), API
     (/auth/status, /auth/login, token-unlocks-route integration) and web
     gate tests plus an autouse fresh_sessions fixture; suite 316 -> 378,
     coverage 95.75 %, ruff clean
    SamAnaniasCases committed Sep 4, 2026
    Configuration menu
    Copy the full SHA
    317508c View commit details
    Browse the repository at this point in the history
Loading

AltStyle によって変換されたページ (->オリジナル) /