feat(eda): sources own signing, with UUIDv7 paths and approved unsigned option
A source is the capture endpoint: a UUIDv7 path by default or a unique URL-safe custom path, signed by default with an Archie-generated secret (encrypted via the bindings cipher), or unsigned after an approval. Intake verifies X-Hub-Signature-256/X-Signature-256 against the source secret before redaction; an unauthenticated event on a signed source is captured but never dispatched, an event on an approved unsigned source dispatches and is marked unsigned. The binding secret is retired; migration 0006 derives sources from existing binding and capture source strings, moving each binding's secret onto its source. SourceStore crosses the State Store gRPC contract. The dashboard gains a sources panel and flags unsigned in the capture inspector, binding list and task timeline.
This commit is contained in:
1 parent
5009288729
commit
6adbdc55a9
59 files changed
+3741
-1660
No files matched your search
@@ -3,7 +3,9 @@ import { useMediaQuery } from "@vueuse/core";
|
||||
import { computed, ref, watch } from "vue";
|
||||
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { ago } from "@/lib/format";
|
||||
import { captureSignature } from "./capture-signature";
|
||||
import CapturePayload from "./CapturePayload.vue";
|
||||
import { selected } from "./state";
|
||||
|
||||
@@ -36,6 +38,8 @@ const stacked = useMediaQuery("(max-width: 1099px)");
|
||||
|
||||
const cap = computed(() => (stacked.value || !props.maxHeight ? undefined : `${props.maxHeight}px`));
|
||||
|
||||
const signature = computed(() => (selected.value ? captureSignature(selected.value) : null));
|
||||
|
||||
const meta = computed(() => {
|
||||
const capture = selected.value;
|
||||
if (!capture) return "";
|
||||
@@ -54,7 +58,10 @@ watch(selected, () => {
|
||||
<div v-if="selected" ref="pane" class="min-w-0">
|
||||
<Card class="flex flex-col" :style="cap ? { maxHeight: cap } : undefined">
|
||||
<CardHeader>
|
||||
<CardTitle class="font-mono">{{ selected.source || "Unknown source" }}</CardTitle>
|
||||
<CardTitle class="flex items-center gap-2 font-mono">
|
||||
{{ selected.source || "Unknown source" }}
|
||||
<Badge v-if="signature" :variant="signature.kind">{{ signature.label }}</Badge>
|
||||
</CardTitle>
|
||||
<CardDescription>{{ meta }}</CardDescription>
|
||||
</CardHeader>
|
||||
<!-- Stacked there is no sibling to be bound by, so the panel caps itself
|
||||
|
||||
@@ -5,6 +5,7 @@ import { computed } from "vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { ago } from "@/lib/format";
|
||||
import { captureSignature } from "./capture-signature";
|
||||
import { selected, type Capture } from "./state";
|
||||
|
||||
/**
|
||||
@@ -15,6 +16,7 @@ import { selected, type Capture } from "./state";
|
||||
*/
|
||||
const props = defineProps<{ capture: Capture }>();
|
||||
|
||||
const signature = computed(() => captureSignature(props.capture));
|
||||
const isSelected = computed(() => selected.value?.id === props.capture.id);
|
||||
|
||||
// The name is set here because role="button" makes the cells presentational:
|
||||
@@ -43,7 +45,12 @@ function open(): void {
|
||||
<!-- A stored capture carries no claim from a binding, so this reads Unbound
|
||||
for every row: the column is where a claim would appear, not a state a
|
||||
reader can act on today. -->
|
||||
<TableCell><Badge variant="idle">Unbound</Badge></TableCell>
|
||||
<TableCell>
|
||||
<div class="flex items-center gap-1">
|
||||
<Badge variant="idle">Unbound</Badge>
|
||||
<Badge :variant="signature.kind">{{ signature.label }}</Badge>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell class="font-mono">{{ props.capture.content_type || "—" }}</TableCell>
|
||||
<TableCell class="text-right">
|
||||
<ChevronRight class="size-4 text-fg-subtle" />
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* How a capture may dispatch: signed by its source's secret, taken on a
|
||||
* source approved for unsigned events, or neither -- in which case nothing
|
||||
* starts from it.
|
||||
*/
|
||||
export interface CaptureSignature {
|
||||
label: "Signed" | "Unsigned" | "Unverified";
|
||||
kind: "ok" | "warn" | "idle";
|
||||
}
|
||||
|
||||
export function captureSignature(capture: { authenticated?: boolean; unsigned?: boolean }): CaptureSignature {
|
||||
if (capture.unsigned) return { label: "Unsigned", kind: "warn" };
|
||||
if (capture.authenticated) return { label: "Signed", kind: "ok" };
|
||||
return { label: "Unverified", kind: "idle" };
|
||||
}
|
||||
@@ -25,6 +25,7 @@ export interface Capture {
|
||||
headers?: string;
|
||||
body?: string;
|
||||
authenticated?: boolean;
|
||||
unsigned?: boolean;
|
||||
}
|
||||
|
||||
interface CapturesResponse {
|
||||
|
||||
Reference in new issue
Block a user