@broberg/sso 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -540,7 +540,7 @@ const tickets = createTicketVerifier({
540
540
 
541
541
  try {
542
542
  const who = await tickets.verify(bearer, { scope: "discovery:read-fleet" });
543
- // { principal: "svc-trail", type: "service", clientId, org, act, scopes, exp, jti }
543
+ // { principal: "svc-trail", type: "service", clientId, org, act, version, cnf, scopes, exp, jti }
544
544
  } catch (e) {
545
545
  if (e instanceof JwksUnavailableError) return c.text("try again", 503); // could not ask BID
546
546
  if (e instanceof SsoError) return c.text("forbidden", 401); // the ticket is not acceptable
@@ -553,6 +553,12 @@ try {
553
553
  - **BID briefly down:** a key already in the cache still verifies, with no network call. An unknown key while BID is down throws `JwksUnavailableError` — answer 503, do not reject the caller.
554
554
  - Not a login client: a service that only receives tickets needs no `client_id`, no redirect and no session.
555
555
 
556
+ **Since 0.15.0 (F084.156, broberg-id-F087.15) — read for the future, never shortened:**
557
+
558
+ - `act` is the **whole delegation chain** (RFC 8693): agent-b acting for agent-a acting for user-1 is `{ sub: "agent-a", act: { sub: "user-1" } }`. `act.sub` is the same as before. A chain deeper than 5 links, or a link without a string `sub`, is **rejected** — 0.14.x kept only the first link and read a malformed `act` as "no delegation", both in the direction where the caller looks like it acts for fewer people.
559
+ - `version` is the ticket format (`ver`): 0 for a ticket from before BID set one, 1 today. A `ver` newer than this package understands is **rejected by name** ("upgrade @broberg/sso"), never read with today's rules.
560
+ - `cnf` is `{ jkt }` for a DPoP-bound ticket, else `null`. **It is not checked here**: until your service verifies a DPoP proof against it (F087.16), a bound ticket is accepted exactly like a bearer ticket, and a stolen one works. Do not treat `cnf` as protection yet.
561
+
556
562
  ## Getting a ticket — `fetchTicket` (since 0.14.1 — 0.14.0 was tagged but never reached npm)
557
563
 
558
564
  The sending half: a workload on **Fly** or in **GitHub Actions** gets a Broberg ID ticket with no key at all. It proves who it is with the identity its platform already gives it, and BID exchanges that (RFC 8693). Nothing secret is stored anywhere.