ReviewOS

also looking at this

loghqorg/loghq

A read-scoped project key, so a Stacks dashboard can read logs without a person's credentials

#15
Merged glennmichael123 wants to merge feat/read-scoped-project-key into main
9 files +537 -17

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

resources/views/settings.stxmodified+6-6
Changes to resources/views/settings.stx
@@ -257,8 +257,8 @@ const keyMask = maskKey(keyFull)
257257// it is issued and never again (#14). Only whether one exists, and when it was
258258// last used, so somebody can tell a live key from a forgotten one before
259259// revoking it.
260const hasReadKey = !!(__activeRow && __activeRow.read_key)
261const readKeyUsed = __activeRow && __activeRow.read_key_last_used_at ? String(__activeRow.read_key_last_used_at) : ''
260const hasReadKeyInitial = !!(__activeRow && __activeRow.read_key)
261const readKeyUsedInitial = __activeRow && __activeRow.read_key_last_used_at ? String(__activeRow.read_key_last_used_at) : ''
262262
263263// Framework-specific install snippet, keyed off the project's platform. Key-only
264264// (Flare-style): the ingest key alone identifies the project — no project id, no DSN.
@@ -545,8 +545,8 @@ defineClientPayload({
545545 codeText: guide.code,
546546 initialKeyFull: keyFull,
547547 initialKeyMask: keyMask,
548 initialHasReadKey: hasReadKey,
549 initialReadKeyUsed: readKeyUsed,
548 hasReadKeyInitial,
549 readKeyUsedInitial,
550550})
551551
552552useSeoMeta({
@@ -841,8 +841,8 @@ async function rotateKey(): Promise<void> {
841841// signal only for as long as the page that issued it is open: it is never
842842// rendered from the server and nothing stores it, so closing the page is the
843843// end of the only copy the browser ever had.
844const hasReadKey = state(initialHasReadKey)
845const readKeyUsed = state(initialReadKeyUsed)
844const hasReadKey = state(hasReadKeyInitial)
845const readKeyUsed = state(readKeyUsedInitial)
846846const readKeyOnce = state('')
847847const readKeyBusy = state(false)
848848const readKeyNote = state('')