BusConsultas (qry)

qry.identity.browserSession

Cookie de navegador → principal + access token del BFF (dec-0118 §2.1).

ImplementadoSin versión del tren todavía· generada desde packages/api-contracts/src/bus/nats.ts

Página generada desde packages/api-contracts/src/bus/nats.ts + packages/api-contracts/src/bus/routes.ts. No se edita a mano: bun run docs:gen la regenera y bun run docs:check falla si difiere.

qry.identity.browserSession · v2

Cookie de navegador → principal + access token del BFF (dec-0118 §2.1). Revocation-aware y con la rotación periódica de la credencial.

CampoValor
Familiaqry
Versión2
Tope del payload16384 bytes
ContratoIdentityBrowserSession en packages/api-contracts/src/bus/nats.ts

Rutas (BUS_ROUTES)

Deny-by-default: un emisor fuera de la allowlist se deniega y se audita (dec-0119 §4).

AtiendeTransporteEmisores admitidosRate (por emisor)
identity-svcnatsweb, styx-ops300/s, ráfaga 600

Petición

{
  "type": "object",
  "required": [
    "credential"
  ],
  "properties": {
    "credential": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "clientIp": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    }
  }
}

Respuesta

{
  "anyOf": [
    {
      "type": "object",
      "required": [
        "ok",
        "data"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "data": {
          "type": "object",
          "required": [
            "principal",
            "accessToken",
            "csrfToken"
          ],
          "properties": {
            "principal": {
              "type": "object",
              "required": [
                "actorId",
                "sessionId",
                "role",
                "authTime",
                "expiresAt"
              ],
              "properties": {
                "actorId": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "role": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "restricted"
                    },
                    {
                      "type": "string",
                      "const": "member"
                    },
                    {
                      "type": "string",
                      "const": "admin"
                    },
                    {
                      "type": "string",
                      "const": "owner"
                    }
                  ]
                },
                "authTime": {
                  "type": "integer"
                },
                "expiresAt": {
                  "type": "integer"
                },
                "displayName": {
                  "type": "string"
                },
                "cred": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "browser"
                    },
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "pat"
                    }
                  ]
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64
                  },
                  "maxItems": 64
                }
              }
            },
            "accessToken": {
              "type": "string"
            },
            "csrfToken": {
              "type": "string"
            },
            "rotated": {
              "type": "object",
              "required": [
                "credential",
                "maxAgeS"
              ],
              "properties": {
                "credential": {
                  "type": "string",
                  "maxLength": 256
                },
                "maxAgeS": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "ok",
        "error"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "object",
          "required": [
            "code",
            "message",
            "category",
            "retryable"
          ],
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "category": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "transient"
                },
                {
                  "type": "string",
                  "const": "permanent"
                },
                {
                  "type": "string",
                  "const": "recoverable"
                }
              ]
            },
            "retryable": {
              "type": "boolean"
            },
            "suggestedAction": {
              "type": "string"
            },
            "details": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {}
                },
                {
                  "type": "array",
                  "items": {}
                }
              ]
            },
            "causedBy": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {}
                  },
                  {
                    "type": "array",
                    "items": {}
                  }
                ]
              }
            }
          }
        }
      }
    }
  ]
}