ypsdf1
1b7b5a2205
15m44z 第三部分: GitHub App bot 匿名工单 + 匿名/实名开关 + 归属派发
【匿名工单主体】
- App 鉴权: gh_api.php 新增 ghAppJwt(PEM签RS256 JWT)+ghAppInstallationToken(换1h
installation token, 缓存到 /plugin/gh_app_token_cache.json 55min)+ghAppBotReady。
- 匿名代发: 用 installation token(g hs_前缀)建 issue 归属 bot(caoyuan-server[bot]),
不暴露提单人 GitHub 账号; 提单人信息写 issue 正文「玩家:xxx」+ PHP 后台保留。
- loadImgJson 解析 repo.imgrepo."github app"(appid/安装id/私钥路径/匿名模式)。
【匿名/实名开关(用户定调: 共存, 做成开关)】
- json「匿名模式」字段(github app 段): true=gh模式支持匿名(前端出开关); false=gh模式
一律实名授权(即使 appbot 配了也不给匿名选项)。
- 前端: gh_anon_available=true(匿名模式开+appbot可用)才显示「匿名工单」开关;
开关开→提交带 anon=1(bot代发), 关→走玩家OAuth建单; 模式留空(PHP内置工单)不给匿名。
- 建单: anon=1 且匿名模式开→appbot token; 否则玩家 OAuth token。
【归属派发(用户定调: 按工单所有人)】
- ghSyncCreate 建 issue 后回写 gh_issue_owner(bot/realname, 按 token 前缀 ghs_/gho_)。
- 撤单/完结/回复按 ghTicketTokenByTicket 归属: bot建的单→机器人代发撤/完结/评论;
实名单→玩家 OAuth token(保持现有逻辑)。
实测: App JWT→installation token→建issue#24(归属caoyuan-server[bot])全链路通;
线上 gh_cfg 返回 gh_anon_available=true。6件PHP+img.json模板+真值img.json+私钥全MATCH。
2026-11-26 10:02:09 +08:00
..
2026-10-26 21:49:50 +08:00
2026-11-21 23:57:12 +08:00
2026-06-26 21:25:40 +08:00
2026-07-07 22:43:51 +08:00
2026-10-21 15:10:47 +08:00
2026-11-08 15:27:00 +08:00
2026-11-24 20:25:30 +08:00
2026-09-30 15:56:16 +08:00
2026-11-26 10:02:09 +08:00
2026-11-25 14:29:35 +08:00
2026-11-25 20:40:38 +08:00
2026-11-25 20:40:38 +08:00
2026-11-25 21:44:07 +08:00
2026-11-25 12:16:37 +08:00
2026-11-24 21:57:56 +08:00
2026-10-14 18:08:43 +08:00
2026-10-27 11:26:45 +08:00
2026-11-25 20:40:38 +08:00
2026-11-24 19:33:41 +08:00
2026-10-07 23:54:42 +08:00
2026-11-25 20:40:38 +08:00
2026-10-09 18:16:56 +08:00
2026-10-07 21:03:35 +08:00
2026-10-25 18:40:35 +08:00
2026-07-09 17:09:35 +08:00
2026-11-11 18:22:20 +08:00
2026-09-30 17:32:08 +08:00
2026-11-24 20:25:30 +08:00
2026-11-26 10:02:09 +08:00
2026-10-22 23:24:32 +08:00
2026-11-25 20:40:38 +08:00