Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Document the admin real-time channel (POST /_/realtime) and X-CWA-Client-Id

未关闭
#294 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
67/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

Start in the bundle's content/4.api/ documentation and identify the endpoint and writer sections to update; check the linked bundle issue and PR for implementation details. Then find the template deployment guidance for Nelmio allow_headers and Mercure history settings. Done when the docs cover the endpoint behavior, payload, limits, writer echo, configuration, and deployment settings listed in this issue.

由索引模型根据 Issue 内容生成。

描述

The bundle is adding an admin real-time channel (api-components-bundle#559, PR #560). Please document the following.

Bundle (content/4.api/)

  • Endpoint: POST /_/realtime (/_api/_/realtime under the template).
    • ROLE_ADMIN.
    • Body: {clientId, event, iri?, data?}, 16 KB at most.
    • Responds 202, and stores nothing.
  • Content types:
    • JSON accepts any event.
    • text/plain (navigator.sendBeacon) is accepted only for event: "presence" with data.state: "left".
    • Anything else is 415.
    • A cross-site request (Sec-Fetch-Site) is 403.
  • Payload, published privately on one site-wide topic that only admins' subscriber cookies grant:
    {"@type": "CwaRealtimeEvent", "v": 1, clientId, user: {id, name}, event, iri, data, sentAt, expiresAt}
  • Rate limits:
    • 20 burst / 10 a second per user and clientId.
    • 60 burst / 30 a second per user across all their clients.
    • Above either: 429 with Retry-After.
    • The limiter pool silverback.api_components.realtime.rate_limiter_cache uses cache.app by default, so the limits apply per pod. Point it at a shared adapter in framework.cache.pools to make them exact.
  • Publishing: bounded at 1 s. A failed or timed-out publish is logged and still answers 202.
  • Config: silverback_api_components.realtime.enabled (default true). When false, the endpoint is a 404 and no cookie grants the topic.
  • Writer echo: a write carrying X-CWA-Client-Id gets _metadata.lastWrite: {clientId, userId, at} in the writer's response and in the private ?draft=1 update.
    • at is server time, RFC 3339 with milliseconds.
    • Use at, not modifiedAt, to order draft updates.

Deployment

  • The front end must be allowed to send X-CWA-Client-Id. In the template, add it to nelmio's allow_headers. The bundle has no Flex recipe yet (#259).
  • Presence events stay in the Mercure hub's replay history, so mention the hub's history size and retention settings.
主要语言
TypeScript
星标
0
派生
0
平均合并
1 小时 20 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

components-web-app/docs 的其他 Issue

查看 components-web-app/docs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。