Summary#
[SealRecipient(Label = Name)] on a string member says: this member holds a public key that a value may be sealed
for, and Name is what the sealed text is bound to as its host. It is the only way to name a recipient of a server
seal — the to: of Secret.X.SealFor and Http.PostSealedFor is a row of such an entity, never a key.
| what it is | |
|---|---|
| the member | a string (or string?) holding the recipient's P-256 public key, as base64 SPKI or PEM |
Label = Member | a string member of the same entity; its text is the fcs1 host the sealed text opens as |
| one per entity | a row is one recipient |
Signature#
[SealRecipient(Label = Name)] string? SealingKey;Description#
Declaring a recipient#
entity BuildHost {
[MaxLength(200)] string Name;
/// The host's P-256 public key, as the host reported it.
[SealRecipient(Label = Name)] string? SealingKey;
security { allow read when IsAuthenticated; }
}Sealing for it#
A stored keyed value is sealed with Secret.X.SealFor — the id's value leaves the platform only as fcs1 text for the
row's stored key, the fcs1 name is the id, and the secret's MayUse(id) is asked as the caller — see declaring secrets (app.Secrets):
string sealedKey = Secret.ModelKeys.SealFor(key.Id.ToString(), to: host, kind: "anthropic", why: "approved on the host page");A value an answer issues is sealed with Http.PostSealedFor: it posts, and the field of the answer it names leaves
the platform only as fcs1 text sealed for the row's stored key — see Http.* (#post-sealed-for):
var r = Http.PostSealedFor("https://api.github.com/app/installations/" + installation + "/access_tokens", "",
"application/json", headers, field: "token", to: host, kind: "github", name: "GH_TOKEN", why: "a build on " + host.Name);What the platform holds you to#
- The row as stored. The key and the label are read from the database through a fresh read as the caller — an edit the code made to the row in memory is not what is sealed for, and a row the caller cannot read is refused.
- No key, no seal. A row whose key member is empty, or whose key is not a P-256 public key, is refused before
anything is sealed — and, for
Http.PostSealedFor, before anything is sent, so a provider never issues a value nobody can receive. - Labels. The label,
kind:andname:may not be empty or contain|(it separates the parts the sealed text is bound to). - Recorded. Every seal for a recipient — and every refused one — is recorded with the row, its label, the SHA-256
fingerprint of its key, the kind, who ran it, why and how it ended, and committed before the sealed text is handed back.
The record never holds the value or the sealed text. A keyed secret's seals are read with
Secret.X.UsesFor(id). - Shape. Not on a
class(no rows), one per entity, on astring, andLabelnames anotherstringmember — each a compile error naming the fix.
See also#
- Http.* —
Http.PostSealedFor, andHttp.PostToSecretsfor a credential meant for your own app - Crypto.SealToHost — seal a page input to a host's public key — the same fcs1 format, sealed in the browser from a password input
- declaring secrets (app.Secrets) — keyed secrets: one stored value per id