3sln.me components profile v1 — provisional draft

Profile identifier: https://3sln.me/artefacts/profiles/components/v1

Status: provisional draft, 2026-10-14, revision 2 (after independent review; review). Nothing in this profile is implemented, routed or production-verified. Publication of this text does not imply that any provider, including 3sln.me, conforms to it. The identifier resolves to the machine-readable descriptor components-profile-v1.json, registered as a provisional manifest profile in the contract registry. Registration is not sign-off and implies no conformance. Decision record and rationale: components profile decision note.

This profile is published by 3sln.me. It is not part of the Bindle specification. Bindle defines interop and no user interface. This profile defines what a Bindle provider must implement so that the @3sln/bindle custom elements (or any other embedder library that implements the element side of this profile) can embed provider-operated components ("islands") in an application page. It covers the wire contract between the embedder's elements and the provider's islands, and the security properties a provider must guarantee when it claims support. How a provider draws its islands, and how its islands talk to its own server, are provider matters except where §9 names a credential-binding mechanism.

Providers that do not declare this profile still work with the elements: the elements then use only core Bindle features (protocol §2) and render their own, simpler UI from app-granted data.

MUST, SHOULD and MAY express requirements of this draft. "Provider" means the Bindle issuer that declares the profile. "Element" means embedder-side code that implements this profile. "Island" means a provider document loaded in an iframe on the embed origin. "Embedder" means the application page and all script in it.

1. Relationship to core Bindle

2. Declaration

"profiles": {
  "https://3sln.me/artefacts/profiles/components/v1": {
    "embed_origin": "https://embed.example.org",
    "protocol": [1],
    "parts": {
      "avatar": {"versions": [1]},
      "account-switcher": {"versions": [1], "fedcm": true},
      "sign-in": {"versions": [1], "fedcm": true}
    },
    "theme_tokens": ["surface", "surface-raised", "text", "text-muted", "accent", "on-accent", "border", "focus", "danger", "radius"],
    "credential_binding": ["key-binding.v1"],
    "manage_url": "https://example.org/console/apps"
  }
}
Member Required Type and validation If absent or invalid
embed_origin Yes ASCII serialization of an HTTPS origin: new URL(v).origin === v, no path, query, fragment, userinfo or IP literal. MUST differ from the issuer origin and from the embedder's own origin. The whole profile declaration is ignored.
protocol Yes Array of 1–8 distinct positive integers: channel protocol versions (§5). Profile ignored. No common version with the element: profile ignored.
parts Yes Object of at most 16 members. Keys match ^[a-z][a-z-]{0,31}$. Each value is an object with versions (array of 1–8 distinct positive integers) and optional fedcm (boolean, default false). Unknown members of a part object are ignored. Unknown part names are ignored. A part with no version the element implements is treated as absent.
theme_tokens No Array of token names from §7; unknown names ignored. []: islands use provider defaults and the element sends no tokens.
credential_binding No Array of binding identifiers (§9). Defined: key-binding.v1. Unknown identifiers ignored. []. Identity-bearing parts (avatar, account-switcher) are then treated as absent (§2.1).
manage_url No HTTPS URL on the issuer origin, no userinfo or fragment. Target of the elements' "Manage" link. Elements link to the issuer origin root.

Unknown members are ignored. The serialized declaration is bounded by the core profiles limit (8 KiB).

2.1 Cross-checks

An element applies these after member validation; each failure removes only the named capability:

2.2 Embed origin rules (provider)

3. Shell

GET <embed_origin>/embed?client=<percent-encoded client_id>#<part>.v<version>

3.1 Iframe the element creates

<iframe src="<embed_origin>/embed?client=<client_id>#<part>"
        name="bindle-island;v=1;n=<nonce>;l=<lang>;cs=<light|dark>"
        title="<localized part title>" referrerpolicy="no-referrer" loading="eager"
        allow="identity-credentials-get <'src' only when §2.1 allows, else 'none'>; storage-access 'none'; browsing-topics 'none'; attribution-reporting 'none'; shared-storage 'none'; join-ad-interest-group 'none'; run-ad-auction 'none'; private-aggregation 'none'; sync-xhr 'none'"></iframe>

4. Theme, locale and scheme before the handshake

The l and cs values in name let the island render static, account-independent UI before the handshake. The island MUST NOT open storage, use keys or make credentialed requests before it has sent ready (§5.1).

5. Channel

5.1 Handshake

  1. On the iframe's first load, the element posts exactly one window message to iframe.contentWindow with targetOrigin equal to the declared embed_origin (never '*'), transferring one MessagePort:

    {"v":1, "type":"bindle-island-init", "nonce":"…", "part":"sign-in", "version":1,
     "theme":{"seq":0, "tokens":{}}, "locale":"en", "colorScheme":"light", "props":{"seq":0}}
    
  2. The island accepts only the first message where event.source === window.parent, event.origin is an allowed parent origin for the client, the key set is exact, part and version equal its fragment, the nonce equals the one from name (constant-time comparison), exactly one port is transferred and every field validates. It then stops listening to window messages.

  3. The island replies on the port, before any storage access, leader election or credentialed request:

    {"v":1, "type":"ready", "part":"sign-in", "version":1, "protocol":[1], "issuer":"https://example.org"}
    

    issuer is the issuer this embed origin serves. ready is identical in every account state.

  4. The element MUST tear the island down and render its fallback (and treat that part as degraded for the issuer for the rest of the document's life) if ready does not arrive within 3 seconds of load (on timeout the element first drains one macrotask and accepts a ready whose event.timeStamp falls within the window, so an embedder long task does not cause a spurious degradation), if part or version differs, if protocol has no version in common, or if issuer is not exactly the issuer whose manifest declared this embed origin. An issuer mismatch disables every part of that declaration for the document.

5.2 Message rules (both directions)

5.3 Inbound (element → island)

type Parts Fields Rules
bindle-island-init all v, nonce, part, version, theme, locale, colorScheme, props Window message, §5.1.
theme all v, seq (uint32, increasing), tokens (≤16 entries) §7.
locale all v, lang (BCP 47, ≤35 chars) Resolved against the island's catalogues, falling back to en; dir follows the locale.
scheme all v, colorScheme (light|dark) The element MUST send it on every change of its resolved scheme, including prefers-color-scheme media changes and embedder color-scheme changes it detects.
props all v, seq, part-specific fields (§6) Enums and keys into the provider's own catalogue only. No embedder free text ever reaches an island.
session all v, subject (HTTPS URL ≤2048 on the issuer origin) or null The app's current subject at this issuer. No reply and no network or crypto work in the island.
prepare sign-in, account-switcher v, redirectUri, challenge (base64url S256, 43 chars), state (43 chars), requests (bounded as the core entry schema), optional loginHint (≤320), uiLocales (≤4 tags), colorScheme, dpopJkt (RFC 7638 thumbprint of the app's DPoP key) Public flow inputs only. Stored, never acted on, and never rendered: loginHint is embedder-supplied text that islands pass only to the provider's entry endpoint as an untrusted hint. The intent always comes from the control the user activates in the island. The element sends a fresh prepare after every flow end.
forget all v, optional subject The only state-reducing inbound message: the island deletes this client's local component credentials in its partition (only for subject if given). It cannot add, approve, select, open a window or reveal anything.

No inbound message makes an island start a flow, open a window, select an account, move focus, navigate or write to the network (except forget ending component sessions). Every action requires a trusted user activation inside the island.

5.4 Outbound (island → element), per part — the events contract

Part type Fields When the island sends it What the element may rely on
all ready v, part, version, protocol, issuer Once, after a valid init (§5.1). The island is live. Nothing about account state.
sign-in, account-switcher flow v, phase (started|ended), outcome? (completed|canceled|popup-blocked|unavailable) started when a user-activated flow begins in the island; ended exactly once per started. Intents: the sign-in control and the switcher's "Use another account" use login (no hint; the provider shows its full account chooser). Generic outcome only. unavailable means "use your own path" (sandboxed, opener lost, storage blocked) and is never more specific. completed is followed by code before ended.
sign-in, account-switcher code v, code (≤2048), state, iss After a completed island flow, only if the parent origin verified at init equals the origin of the prepare.redirectUri used for that flow. An authorization code for the app's own PKCE exchange. The element validates it exactly as callback parameters against its pending record (state, issuer, single use) and exchanges it with its verifier.
account-switcher select v, subject The user picked another account in the switcher, for a subject whose component binding was created by a flow that delivered a code to this client_id. A subject the app may already hold a session for. The element acts on it only if it holds a live app session for exactly that (issuer, subject).
account-switcher escape v Escape pressed in the island, or a close request handled by the island. Close the container.
account-switcher dismiss v The island's own close control, or a provider tab opened from the island. Close the container.
avatar — — Sends nothing after ready. —

Island-side entitlement invariant (provider MUST). Embedder script can read the raw port, so every outbound field MUST be something the app is entitled to before it leaves the island. Islands MUST NOT send, by any message or observable side effect they control: sizes, row counts, which bindings exist, labels, avatar or load status, focus position or arrow-key edges, leader status, restore results or error reasons.

6. Parts (v1)

General sizing contract: the element or embedder chooses each iframe's size from attributes, CSS and the viewport only. The island lays out within that box, never reports a size and never scrolls an embedder-owned scroller.

Part Version Interactive Element sizing (range the island MUST support) props Outbound
avatar 1 No. The element sets aria-hidden="true", tabindex="-1" and pointer-events:none. Square or rectangular, 16–512 CSS px per side. The picture is centered and as large as fits. {} none after ready
account-switcher 1 Yes 280–480 px inline × 200–480 px block; v1 element defaults 320 × 320 (regular) or 320 × 248 (compact). {density: 'regular'|'compact', actions: subset of ['use-another','manage','remove']} flow, code, select, escape, dismiss
sign-in 1 Yes Block 44–56 px (element default 44, or 48 with a coarse pointer); inline ≥200 px. {label: 'continue'|'sign-in'|'sign-up', variant: 'filled'|'outline'} flow, code

New parts and new part versions may be added to v1 declarations without a new profile identifier; elements ignore what they do not implement.

7. Theme tokens (v1 allowlist)

Token Grammar
surface, surface-raised, text, text-muted, accent, on-accent, border, focus, danger ^#[0-9a-f]{6}$ (opaque, canonical lowercase)
radius integer 0–16 (CSS px)

8. Island-initiated flows and code delivery

  1. The element sends prepare with fresh PKCE and state for the issuer of that island, and keeps its pending record (verifier, state, issuer, endpoints) exactly as for an app-started flow.
  2. On a trusted activation of a flow control, the island creates the authorization entry at the core authorization-entry.v1 endpoint itself, with the prepare inputs, the intent of the activated control, and any members its credential binding defines (§9). It MUST NOT accept an entry identifier, URL or key thumbprint from the element.
  3. The island opens the provider's authorization page in a popup or uses FedCM inside the island. Every approval happens in a top-level provider document or the browser's FedCM dialog, never inside the island.
  4. On completion the island sends code{code, state, iss} only if the parent origin verified at init equals the origin of the flow's redirectUri, and the provider re-checks that redirectUri is registered for client_id. The code is bound to the app's PKCE challenge, state, issuer and redirectUri at exchange.
  5. If the island cannot complete (popup blocked, opener lost, sandboxed), it sends flow{ended, outcome} and the element MAY continue on its own path (app-opened popup or redirect), which yields app credentials only. A popup opened by the island that loses its opener completes to the app's registered callback as an ordinary authorization.

9. Component credentials and credential binding

Requirements for every provider that declares this profile with an identity-bearing part:

credential_binding names the mechanism that meets C2–C5. Elements recognize only identifiers listed here.

9.1 key-binding.v1

Normative for providers that declare it. Rationale and attack analysis: adaptive app sign-in §6–§8, §11.

Paths and lifetimes of the provider's embed API are provider-internal.

10. Requirements summary

Provider (P):

  1. Dedicated, cookieless embed origin serving exactly one issuer; ready.issuer is that issuer (§2.2, §5.1).
  2. Shell rules of §3, including frame-ancestors from registered redirect-URI origins and no third-party script.
  3. No action from inbound messages; every action needs a trusted activation inside the island; every approval in a top-level provider document or the FedCM dialog (§5.3, §8).
  4. Outbound messages only as §5.4, with the entitlement invariant.
  5. Constant messages, sizes and pre-ready work in every account state.
  6. Component credentials per §9.
  7. Theme validation per §7.
  8. Islands never navigate any browsing context other than their own popup, never call requestStorageAccess(), never open modal dialogs (alert, confirm, prompt, print) or start downloads, contain no text inputs, never trap keyboard focus (Tab always leaves the island), and never draw content imitating the embedding app.
  9. Islands never postMessage to window.parent, window.top or any embedder window after the handshake; all traffic uses the port.
  10. Component data filtered by (issuer, client_id) (§2.2); the sign-in island performs no storage access and no network request after loading the shell until a user activates it.

Element (E):

  1. Use declaration values only from the manifest of the issuer the operation is bound to; never combine members from different issuers (§11).
  2. Exact targetOrigin from the validated declaration; never '*'.
  3. Validate every port message (§5.2) and translate it; never forward raw island data to app event detail.
  4. Send session, prepare and forget only to islands of the issuer they concern. Never send a subject, state or challenge of one issuer to another issuer's islands.
  5. Tear down on timeout, violation, ready mismatch, attribute mutation or second load, and degrade that part for the document (§5.1).
  6. Mount islands of an issuer other than the app's current session issuer or configured default provider only after the user chose that provider.
  7. Install no window message listener for islands beyond what the handshake needs (none: the element posts init and listens only on the port).
  8. Keep pending authorization records keyed by state; records for island flows live in memory; accept code only on the port that received the matching prepare, only between that island's flow{started} and flow{ended}.
  9. Before an island started from an unverified embed-origin hint is verified against the issuer's declaration, send it only bindle-island-init (no session, prepare or forget).
  10. Close the container when focus leaves the island and the panel (focus traps are a provider violation the element cannot prevent).

11. Declaration processing (elements)

12. Versioning

The semantics at this identifier are immutable once signed off. Additive changes within v1: new part names, new part versions, new optional declaration members and new credential_binding identifiers, all ignored by elements that do not implement them. Any change to existing message shapes, handshake, requirements or validation that an existing element or provider could misread requires a new channel protocol version or a new profile identifier.

13. Conformance checks

Providers: shell headers and inert responses for unknown clients and parts; frame-ancestors under registered, unregistered and nested parents; ready constant and first; ready.issuer correct; no outbound message types beyond §5.4 under fuzzed inbound traffic; no action from inbound messages; code delivered only to the redirect origin; component credential refused at token, revocation and RPC endpoints; key-binding attestation refused with another key, without an opener, and for app-created entries; identical sizes, load events and message sequences for 0 and many bindings.

Elements: targetOrigin equals the declaration; handshake timeout and mismatch teardown; cross-issuer isolation of session/prepare; code validation identical to callbacks; translation without raw payloads; degradation scoped per issuer and document.

Appendix A. Monogram (shared fallback picture)

Elements render this as their last-resort avatar. Islands in v1 draw no fallback (§6), but any island that draws an identity fallback or colour MUST use this derivation so standard and enhanced compositions match.

Input: the subject URL string s (1–2048 UTF-16 code units). fnv(text, seed) is 32-bit FNV-1a over UTF-16 code units with initial value seed (default 0x811c9dc5) and prime 0x01000193. Let a = fnv(s) and b = fnv(s, a XOR 0x9e3779b9). For row r and column c in 0–4, let k = r*3 + (c < 3 ? c : 4 - c) (0–14); the cell is on when bit k of a is 1 (15 bits of a are used). If no cell is on, the center cell is on. The cell pattern is the one monogramPattern in @3sln/bindle computes.

Colour (shared with the elements' initials and monogram). index = b mod 24 (independent of the pattern bits), hue = index × 15 + 7.5. The tile background and the on-cells use these OKLCH tones for the scheme received in scheme (or cs before the handshake): light background oklch(0.93 0.03 hue), cells oklch(0.40 0.065 hue); dark background oklch(0.36 0.06 hue), cells oklch(0.93 0.03 hue) (all inside the sRGB gamut for the 24 hues). Foreground on background is at least 4.5:1 for every hue in both schemes. Under forced-colors: active the tile uses Canvas, CanvasText and a CanvasText border. These values are provisional until the shared contrast test fixes them; islands and elements MUST use the same table.