ReviewOS

also looking at this

stacks/analyticshq

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

#68
Merged glennmichael123 wants to merge feat/read-scoped-site-key into main
7 files +550 -11
app/Models/Site.tsmodified+15-0
Changes to app/Models/Site.ts
@@ -37,6 +37,21 @@ export default defineModel({
3737 validation: { rule: schema.string().required().max(255) },
3838 },
3939
40 // Secret read key: a machine presents it as `Authorization: Bearer` to read
41 // this site's analytics without a person's credentials (#67). Not fillable
42 // and with no factory — issued on demand from site settings, revoked by
43 // setting it back to null. See app/Support/read-key.ts.
44 read_key: {
45 fillable: false,
46 hidden: true,
47 validation: { rule: schema.string() },
48 },
49
50 read_key_last_used_at: {
51 fillable: false,
52 validation: { rule: schema.string() },
53 },
54
4055 domains: {
4156 fillable: true,
4257 validation: { rule: schema.string().optional() },