also looking at this
A read-scoped project key, so a Stacks dashboard can read logs without a person's credentials
#15
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.
| @@ -257,8 +257,8 @@ const keyMask = maskKey(keyFull) | ||
| 257 | 257 | // it is issued and never again (#14). Only whether one exists, and when it was |
| 258 | 258 | // last used, so somebody can tell a live key from a forgotten one before |
| 259 | 259 | // revoking it. |
| 260 | const hasReadKey = !!(__activeRow && __activeRow.read_key) | |
| 261 | const readKeyUsed = __activeRow && __activeRow.read_key_last_used_at ? String(__activeRow.read_key_last_used_at) : '' | |
| 260 | const hasReadKeyInitial = !!(__activeRow && __activeRow.read_key) | |
| 261 | const readKeyUsedInitial = __activeRow && __activeRow.read_key_last_used_at ? String(__activeRow.read_key_last_used_at) : '' | |
| 262 | 262 | |
| 263 | 263 | // Framework-specific install snippet, keyed off the project's platform. Key-only |
| 264 | 264 | // (Flare-style): the ingest key alone identifies the project — no project id, no DSN. |
| @@ -545,8 +545,8 @@ defineClientPayload({ | ||
| 545 | 545 | codeText: guide.code, |
| 546 | 546 | initialKeyFull: keyFull, |
| 547 | 547 | initialKeyMask: keyMask, |
| 548 | initialHasReadKey: hasReadKey, | |
| 549 | initialReadKeyUsed: readKeyUsed, | |
| 548 | hasReadKeyInitial, | |
| 549 | readKeyUsedInitial, | |
| 550 | 550 | }) |
| 551 | 551 | |
| 552 | 552 | useSeoMeta({ |
| @@ -841,8 +841,8 @@ async function rotateKey(): Promise<void> { | ||
| 841 | 841 | // signal only for as long as the page that issued it is open: it is never |
| 842 | 842 | // rendered from the server and nothing stores it, so closing the page is the |
| 843 | 843 | // end of the only copy the browser ever had. |
| 844 | const hasReadKey = state(initialHasReadKey) | |
| 845 | const readKeyUsed = state(initialReadKeyUsed) | |
| 844 | const hasReadKey = state(hasReadKeyInitial) | |
| 845 | const readKeyUsed = state(readKeyUsedInitial) | |
| 846 | 846 | const readKeyOnce = state('') |
| 847 | 847 | const readKeyBusy = state(false) |
| 848 | 848 | const readKeyNote = state('') |