MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / CreatedKeyReveal

Function CreatedKeyReveal

packages/react/src/pages/api-keys.tsx:118–151  ·  view source on GitHub ↗

The one-time reveal of a freshly minted key's value + Bearer header.

(props: {
  readonly value: string;
  readonly onCopy: (kind: "value" | "bearer_header") => void;
})

Source from the content-addressed store, hash-verified

116
117/** The one-time reveal of a freshly minted key's value + Bearer header. */
118function CreatedKeyReveal(props: {
119 readonly value: string;
120 readonly onCopy: (kind: "value" | "bearer_header") => void;
121}) {
122 return (
123 <div className="grid gap-4 py-3">
124 <div className="grid gap-1.5">
125 <Label className="text-sm font-medium text-foreground">New key</Label>
126 <div className="flex items-center gap-2">
127 <Input value={props.value} readOnly className="font-mono text-xs" data-ph-mask />
128 <CopyButton value={props.value} onCopy={() => props.onCopy("value")} />
129 </div>
130 </div>
131 <div className="grid gap-1.5">
132 <Label className="text-sm font-medium text-foreground">Bearer header</Label>
133 <div className="flex items-center gap-2">
134 <Input
135 value={`Authorization: Bearer ${props.value}`}
136 readOnly
137 className="font-mono text-xs"
138 data-ph-mask
139 />
140 <CopyButton
141 value={`Authorization: Bearer ${props.value}`}
142 onCopy={() => props.onCopy("bearer_header")}
143 />
144 </div>
145 </div>
146 <p className="text-sm leading-6 text-muted-foreground">
147 Send this value as a Bearer token. It is only shown once.
148 </p>
149 </div>
150 );
151}
152
153/**
154 * The create dialog's state-bearing body, shared by both key kinds. Remounted

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected