Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
689ceda
refactor: 删除 db/single-main 旧库迁移工具
AlianBlank Nov 6, 2026
5d30f91
refactor: 应用 C406 统一改名脚本(后端全量机械去 Tenant)
AlianBlank Nov 6, 2026
74e897f
feat(core): 删除租户读动作分类器与错误响应租户分支
AlianBlank Nov 6, 2026
53bf358
refactor(vue): 清除租户与应用作用域语义
AlianBlank Nov 6, 2026
ff9d956
test(vue): 清理租户应用旧端到端夹具
AlianBlank Nov 6, 2026
f939bd0
docs(readme): 仓根 README 与 AGENTS 改写为单游戏后台定位
AlianBlank Nov 6, 2026
63078fd
refactor: D3 业务归属与物理表名收口并修复改名后编译
AlianBlank Nov 6, 2026
4d57c7c
docs(readme): 后端 README 五语清除租户语义与迁移工具说明
AlianBlank Nov 6, 2026
e69de1a
docs(readme): 前端 README 五语删除应用作用域与租户残留
AlianBlank Nov 6, 2026
d2aedb0
chore(compose): 凭证加密密钥改名并删除租户库注释
AlianBlank Nov 6, 2026
9ad7565
chore(samples): 删除依赖已退场租户中间件的 Tapd 示例
AlianBlank Nov 6, 2026
2561cc4
feat(core): 删除租户管理错误码并注销号段
AlianBlank Nov 6, 2026
ea7e411
feat(core): 清理已退场机制的死错误码成员
AlianBlank Nov 6, 2026
4fe31c0
refactor(core): 删除零引用的租户与机构缓存键
AlianBlank Nov 6, 2026
035399f
docs(gm-center): 租户管理员注释改为管理员角色
AlianBlank Nov 6, 2026
9b913f3
refactor: D5 删除菜单 AppScope 列与 D10 日志 TenantId 字段
AlianBlank Nov 6, 2026
6beae9d
feat(core): 旧库拒绝启动守卫
AlianBlank Nov 6, 2026
701e830
test(auth): 平台 JWT 签发 claim 集合精确断言
AlianBlank Nov 6, 2026
b764ddf
refactor: 收敛回调与游戏服线缆语义
AlianBlank Nov 6, 2026
56c0390
feat: 重导 openapi 并重新生成 Vue API 客户端(C406 改名后)
AlianBlank Nov 6, 2026
86a7283
test: 修复 C406 改名与 D3/D5/D10 后的守护测试
AlianBlank Nov 6, 2026
5d3c0f5
fix: 恢复游戏登录身份覆盖拦截
AlianBlank Nov 6, 2026
4b271ef
fix: 收紧旧回调路径负向测试
AlianBlank Nov 6, 2026
67a5615
test: 标注旧字段负向断言
AlianBlank Nov 6, 2026
0f43d7a
test: 标注宿主安全负向样本
AlianBlank Nov 6, 2026
8435081
refactor: 以改名脚本 v2 修正 v1 泛化词损伤(R1)
AlianBlank Nov 6, 2026
ed0072c
refactor: P0 处置生产 residue(tenantDb 局部变量消歧与边界文案)
AlianBlank Nov 6, 2026
a7a5999
test: 修正回调测试引用
AlianBlank Nov 6, 2026
aaf7274
test: 完善游戏登录线缆断言
AlianBlank Nov 6, 2026
8a930cc
fix: 说明身份字段拦截原因
AlianBlank Nov 6, 2026
0cea583
chore(core): 旧库守卫旧表名行加 c406-keep 标注
AlianBlank Nov 6, 2026
1b593e3
fix(hub): 消除签名测试旧应用查询键
AlianBlank Nov 6, 2026
8c9d3b7
refactor: 应用 C406 统一改名脚本
AlianBlank Nov 6, 2026
8b9dcc9
refactor(h): 应用 C406 统一改名脚本
AlianBlank Nov 6, 2026
f3a9e65
Merge branch 'feature/GFX-1232' into feature/GFX-1232-core
AlianBlank Nov 6, 2026
d7daa62
refactor: 迁移 R4 目录遗留至 Business 命名空间落点
AlianBlank Nov 6, 2026
88addcb
refactor(vue): 应用 C406 统一改名脚本
AlianBlank Nov 6, 2026
289fca6
Merge branch 'feature/GFX-1232' into feature/GFX-1232-vue
AlianBlank Nov 6, 2026
6b45021
Merge branch 'feature/GFX-1232' into feature/GFX-1232-hosts
AlianBlank Nov 6, 2026
2b1b414
feat(entity): D11 改写已删除概念的中文文案
AlianBlank Nov 6, 2026
68d6f9e
refactor(tests): 消歧 residue 移交清单中的 C 名下条目
AlianBlank Nov 6, 2026
fe78633
feat(application): D11 补齐 Application/Web.Api/Core.SqlSugar 中文文案
AlianBlank Nov 6, 2026
26a5917
docs(seed): 修正游戏运营配置种子注释的旧 AppId 描述
AlianBlank Nov 6, 2026
da18749
fix(vue): 收口 C406 合并后检查项
AlianBlank Nov 6, 2026
79863eb
fix(hosts): 清理宿主测试租户语义
AlianBlank Nov 6, 2026
44afff7
test: 测试基建 TenantDb 统一为 MainDb
AlianBlank Nov 6, 2026
bfd831b
refactor(hosts): 清理宿主目录租户遗留
AlianBlank Nov 6, 2026
452cbe4
fix(hosts): 消除测试宿主租户泛化残留
AlianBlank Nov 6, 2026
d348270
fix(hosts): 修正主库处罚测试默认区服
AlianBlank Nov 6, 2026
1b00d15
chore(merge): 合入 C406 H 宿主与线缆语义
AlianBlank Nov 6, 2026
92a17cc
chore(merge): 合入 C406 C 核心语义
AlianBlank Nov 6, 2026
ebc5568
chore(merge): 合入 C406 V Vue 语义与改名
AlianBlank Nov 6, 2026
4aa1d9c
chore(merge): 合入 C406 D 文档与部署
AlianBlank Nov 6, 2026
7d0622f
fix(tests): 清理合并后残留的旧命名与死参数夹具
AlianBlank Nov 6, 2026
3156891
fix: 消歧事务运行器变量名并修正灰度公式注释
AlianBlank Nov 6, 2026
64cecc7
feat(tests): 落地 C406 D13 残留阻断测试
AlianBlank Nov 6, 2026
766bc84
build(vue): 重导 openapi 并重新生成 API 客户端
AlianBlank Nov 6, 2026
0185cd1
fix(vue): 补齐错误码 overlay 翻译并全量同步五语
AlianBlank Nov 6, 2026
6153048
doc(hosts): 改写宿主侧残留的租户中文注释
AlianBlank Nov 6, 2026
00c6e03
fix(db): init.sql 停止创建第二个业务库
AlianBlank Nov 6, 2026
97d78cc
fix(e2e): 菜单授权夹具适配改名后的只读例外字段
AlianBlank Nov 6, 2026
144c941
fix(open-access): 接口范围选项对齐 Hub 路由前缀
AlianBlank Nov 6, 2026
9dd33b8
test(e2e): 新增 C406 专项断言与新协议关联用例
AlianBlank Nov 6, 2026
cef9887
test(e2e): 全叶巡查用例放宽超时
AlianBlank Nov 6, 2026
137d9d2
test(e2e): 修正专项断言选择器与巡查策略
AlianBlank Nov 6, 2026
813eabb
test(e2e): 桩与向导支持容器栈回连宿主
AlianBlank Nov 6, 2026
c7d7777
test(e2e): 下拉填充等待懒加载选项可见
AlianBlank Nov 6, 2026
c8dac36
doc(agents): 同步 e2e 用例文件与条目说明
AlianBlank Nov 6, 2026
9dfffc3
test(e2e): 专项断言修正隐藏页查询与支付弹窗填充
AlianBlank Nov 6, 2026
30cbf14
test(e2e): 专项断言改用统一路由拦截与全局区服选择
AlianBlank Nov 6, 2026
09303e2
feat(entity): 广告回调配置与奖励记录绑定分包 Id
AlianBlank Nov 6, 2026
0c68243
feat(admin): 广告回调配置按分包校验与查过滤
AlianBlank Nov 6, 2026
d7e5897
feat(bootstrap): C406 F3 新装首个业务管理员种子引导
AlianBlank Nov 6, 2026
ab744a5
docs(deploy): C406 F3 compose/env 模板与 README 增加首个业务管理员引导变量
AlianBlank Nov 6, 2026
eaf1f6c
feat(clientapi): 广告回调按路由分包精确命中验签配置
AlianBlank Nov 6, 2026
506e76c
feat(hosts): Client 与 Hub 启动接入旧库守卫
AlianBlank Nov 6, 2026
7726b53
docs(notes): C406 F3 notes-core 新增首个管理员种子引导一节并登记 AsTenant 白名单
AlianBlank Nov 6, 2026
fb25b13
test(errors): 广告回调配置错误码枚举加入非前端枚举豁免
AlianBlank Nov 6, 2026
b9f90e2
feat(vue): 广告回调配置页分包选择器与列表分包维度
AlianBlank Nov 6, 2026
37ff529
chore(merge): 合入 C406 F2 宿主回调分包绑定
AlianBlank Nov 6, 2026
938ecf9
chore(merge): 合入 C406 F3 首个管理员种子引导
AlianBlank Nov 6, 2026
b57e73d
fix(tests): 白名单收窄支付目录并登记 e2e 负向断言
AlianBlank Nov 6, 2026
0bd8d21
fix(vue): 改写渠道与仪表盘注释的租户措辞
AlianBlank Nov 6, 2026
db53f1a
test(e2e): 管理员授权改走种子引导并界面创建复核人
AlianBlank Nov 6, 2026
060d375
test(e2e): 专项断言去未用导入并新增 h/i/j 用例
AlianBlank Nov 6, 2026
e54545e
build(vue): i18n 文案基线增补广告配置分包条目
AlianBlank Nov 6, 2026
cdc8809
docs(readme): 四语补首个业务管理员引导变量
AlianBlank Nov 6, 2026
5b96e1e
fix(clientapi): 广告回调缺 provider 时失败关闭
AlianBlank Nov 6, 2026
0570e82
fix(bootstrap): 补授语义注释与日志按实际行为改正
AlianBlank Nov 6, 2026
b695ada
fix(tests): 白名单补微信返回码与四语协议镜像登记
AlianBlank Nov 6, 2026
12618b1
fix(repo): 移除误提交到仓根的 F3 notes
AlianBlank Nov 6, 2026
a1339f5
fix(vue): 广告回调配置编辑回显已选分包
AlianBlank Nov 6, 2026
c8e6dea
test(e2e): 广告与开服夹具断言按隔离栈实况修正
AlianBlank Nov 6, 2026
cb7988f
docs(readme): 五语补平台密码策略默认状态与建议强度
AlianBlank Nov 6, 2026
4dd0afe
doc(agents): 同步 e2e 夹具与集成断言描述
AlianBlank Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# GFX_MAIN_DB_CONNECTION_STRING=Host=postgres;Port=5432;Database=gameframex_admin;Username=gameframex;Password=...

# ── 运行凭证加密(留空 = 明文降级模式;设置后三 host 同值且不可再变更)──
# GFX_TENANT_SECRET_ENC_KEY=
# GAMEFRAMEX_SECRET_ENCRYPTION_KEY=


# ── Hub API JWT 验签密钥 ──
Expand All @@ -28,6 +28,12 @@
# ── 前端运行时 API 地址(entrypoint 写入 config/config.js;远端部署时改浏览器可达地址)──
# WEB_VUE_API_URL=http://127.0.0.1:20802

# ── 新装首个业务管理员种子引导(C406 / F3;成对设置才生效)──
# 仅当主库中还没有任何业务管理员账号时,web-api 启动期会创建该账号并绑定 sys_admin 角色
# (授权全部非超管菜单)。账号已存在则忽略并告警;密码须满足平台密码强度策略,否则启动失败。
# GAMEFRAMEX_ADMIN_INITIAL_ACCOUNT=admin
# GAMEFRAMEX_ADMIN_INITIAL_PASSWORD=<初始密码,请自行设置>

# ── Grafana Cloud OpenTelemetry(三者齐全才启用;凭证见 Grafana Cloud Portal)──
# OTEL_ENDPOINT=https://otlp-gateway-prod-<region>.grafana.net/otlp
# OTEL_USER=<Stack Instance ID>
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Build / run / 前端脚本见 `gfx-doc/agent-handbook/INDEX.md` 的 Build & Run;
- Root `gfx-doc/` is the only code-side document system.
- Keep `AGENTS.md`, `CLAUDE.md`, and `gfx-doc` as root-level entry points only.
- Use SqlSugar patterns in backend work; do not introduce Entity Framework.
- Preserve tenant boundaries: `全局配置` is SuperAdmin-only; tenant features belong under tenant-visible business menus.
- `全局配置` is SuperAdmin-only; admin-facing business features belong under admin-visible business menus. `ServerId` is the only operational scope.
- Prefer existing local patterns and generated API clients before adding new abstractions.
- Any change affecting user-visible behavior MUST be verified by real browser end-to-end (see **Verification Standard** below). Compile-only or API-only (curl/fetch) verification is NOT acceptable as the sole evidence for such changes.

Expand All @@ -37,7 +37,7 @@ Any change a user can see or click must be verified in a real browser before rep

**What counts as real-browser verification:**
- Drive the actual Vue app (default dev server `http://127.0.0.1:20800`, hash router) with the e2e suite under `GameFrameX.Admin.Unified.Vue/e2e/` (Playwright, `channel: 'msedge'` launches system Edge — no manual CDP/browser step; run `pnpm run test:e2e` from the Vue root).
- Perform real interactions (form login with the right tenant, navigate by real menu), prove the page's real API fired (route recorder), then assert the DOM renders the expected data (account, tenant, the row/field under test).
- Perform real interactions (form login, navigate by real menu), prove the page's real API fired (route recorder), then assert the DOM renders the expected data (account, server selection, the row/field under test).
- Evidence lands automatically under `GameFrameX.Admin.Unified.Vue/e2e/.e2e/`: per-test artifacts in `results/<test>/` (explicit `shot(page, 'label')` screenshots + trace.zip on failure), plus `report.json` and the HTML report in `report/` (`pnpm run test:e2e:report`). Use the `shot()` helper from `e2e/tests/helpers.ts` for explicit proof shots.

**What is NOT sufficient on its own:**
Expand All @@ -47,7 +47,7 @@ Any change a user can see or click must be verified in a real browser before rep
These are allowed as supplementary checks, but a user-visible change still requires the browser-level assertion above. Backend-only/internal-path changes (no UI surface) may stop at compile + API/DB checks.

**Existing harness:**
- `GameFrameX.Admin.Unified.Vue/e2e/` — Playwright regression suite using system Edge. The app has one shell: ordinary admin sees nine roots (总览、区服、内容运营、在线运维、玩家、商业化、C 端交付、审计、系统); superadmin sees only 总览 and 系统, including protected system groups. `auth.setup.e2e.ts` / `superadmin.setup.e2e.ts` create separate storage states through real form login; `admin-menu-fixture.ts` explicitly grants every non-superadmin menu, including new roots, then logs admin in again. This fixture is the authorized exception for active menu/role API calls. Page navigation uses rendered sidebar DOM and real clicks through `helpers.ts` `navigateByMenu`; login lands on 运营首页 (`/dashboard/home`). `modules/single-shell.e2e.ts` has one case per root/session (11 total), with `actions: true` (C404: 区服组计数含开服/合服两个向导流程页,通用 CRUD 探针经 `skipLeaves` 跳过,写路径由 `game-area-provision.e2e.ts` / `game-area-merge.e2e.ts` 专属用例覆盖); `modules/menu-inventory.e2e.ts` asserts the exact nine/two root sets. `module-coverage.ts` records page requests and sweeps every leaf: search/reset payloads, real Select/AutoComplete choices, details, edit echo, delete confirmation/cancel, and add-dialog validation. Per-leaf coverage is written to annotations. `scheduler-retention.e2e.ts` covers 任务调度内置作业可见/手动执行运行态、超期日志留存消失与定时任务 admin 增删改(C404)。 `crud-roundtrips.e2e.ts` has 20 entity roundtrips (create → edit-submit/echo → delete), with exceptions documented in its header and fields filled in control order. `server-selector.e2e.ts` covers global/local server selection, request payload and DOM, reload persistence, and delayed-response isolation. Other files cover login failure, landing/logout, appearance, log pages/search/export, and both directions of the admin/superadmin visibility boundary. The retired app-secret Client.Api correlation suite has been removed. Run `pnpm run test:e2e tests/<file>.e2e.ts`, optionally `-g "<组名>"`; update the CRUD matrix for new CRUD pages and the module/inventory expectations for new menus. Independent static checks are `pnpm exec tsc --noEmit -p e2e/tsconfig.json` and `pnpm exec eslint -c e2e/eslint.config.mjs e2e/tests`.
- `GameFrameX.Admin.Unified.Vue/e2e/` — Playwright regression suite using system Edge. The app has one shell: ordinary admin sees nine roots (总览、区服、内容运营、在线运维、玩家、商业化、C 端交付、审计、系统); superadmin sees only 总览 and 系统, including protected system groups. `auth.setup.e2e.ts` / `superadmin.setup.e2e.ts` create separate storage states through real form login; `admin-stack.ts` holds the isolated-stack guard and response-envelope readers; the admin account and its `sys_admin` non-superadmin menu grants now come from the first-install seed bootstrap (`GAMEFRAMEX_ADMIN_INITIAL_ACCOUNT`/`_PASSWORD`), so no active role/grant API call is made by the suite. The merge reviewer account is created through the real 账号管理 UI and its password reset through the row action menu. Page navigation uses rendered sidebar DOM and real clicks through `helpers.ts` `navigateByMenu`; login lands on 运营首页 (`/dashboard/home`). `modules/single-shell.e2e.ts` has one case per root/session (11 total), with `actions: true` (C404: 区服组计数含开服/合服两个向导流程页,通用 CRUD 探针经 `skipLeaves` 跳过,写路径由 `game-area-provision.e2e.ts` / `game-area-merge.e2e.ts` 专属用例覆盖); `modules/menu-inventory.e2e.ts` asserts the exact nine/two root sets. `module-coverage.ts` records page requests and sweeps every leaf: search/reset payloads, real Select/AutoComplete choices, details, edit echo, delete confirmation/cancel, and add-dialog validation. Per-leaf coverage is written to annotations. `scheduler-retention.e2e.ts` covers 任务调度内置作业可见/手动执行运行态、超期日志留存消失与定时任务 admin 增删改(C404)。 `crud-roundtrips.e2e.ts` has 20 entity roundtrips (create → edit-submit/echo → delete) plus the F2 ad-callback package-binding closure, with exceptions documented in its header and fields filled in control order. `server-selector.e2e.ts` covers global/local server selection, request payload and DOM, reload persistence, and delayed-response isolation. Other files cover login failure, landing/logout, appearance, log pages/search/export, and both directions of the admin/superadmin visibility boundary. `client-api-protocol.e2e.ts` proves the C406 single-game Client.Api protocol (X-Proto-Ver 200 / missing 400 / legacy headers ignored); `e2e-integration-checks.e2e.ts` carries the C406 acceptance assertions (login form fields, renamed pages + renamed APIs, wire hygiene across pages, log columns without TenantId, single-packageId callback URL shape, Hub machine-channel HMAC with legacy headers ignored, bootstrapped-admin first login with nine roots, ad-callback package selection/echo with the single-{packageId} URL form, and cross-package key rejection with missing-packageId 404). Run `pnpm run test:e2e tests/<file>.e2e.ts`, optionally `-g "<组名>"`; update the CRUD matrix for new CRUD pages and the module/inventory expectations for new menus. Independent static checks are `pnpm exec tsc --noEmit -p e2e/tsconfig.json` and `pnpm exec eslint -c e2e/eslint.config.mjs e2e/tests`.
- `GameFrameX.Admin.Unified.Vue/src/**/*.test.ts` — unit / component suite (Vitest 3 + jsdom + @vue/test-utils, since 2026-10-20; covers pure-logic utilities like `cursorPager` / `commandForm` / `notifyUrl` / `pageServer` / `http/shared.resolveResponseMessage`, plus a component convention reference at `src/components/form-label/index.test.ts`). Run via `pnpm run test:unit` (CI) / `test:unit:watch` (dev watch) / `test:unit:coverage` (v8 coverage). New pure-logic helpers: write a colocated `*.test.ts` next to the source; new Vue components: mirror `form-label/index.test.ts` (`mount` + `injected provider` + slot text).
When a user-visible change is reported done without browser evidence, treat the report as incomplete and run the browser check before claiming success.

Expand Down
6 changes: 2 additions & 4 deletions GameFrameX.Admin.Unified.Api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ GameFrameX.Client.Api/Google/*.json
error-codes.json

# 本地零配置 SQLite 数据目录(DataSource=./db/...,仓根执行 dotnet run 时生成)
# db/* 而非 db/:db/ 会整目录排除导致 !db/tenant-isolation/ 反排除失效(git 不进入被排除目录)
db/*
!db/tenant-isolation/
!db/single-main/
# db/ 本地 SQLite 运行目录整体排除
db/
*.db
.sonarqube
postgres-data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System.Collections.Concurrent;
using System.Text.Json.Nodes;
using GameFrameX.Core.Service.Tenant;
using GameFrameX.Core.Service.Business;

namespace GameFrameX.Advertisement.Abstract;

/// <summary>
/// 广告回调配置 ConfigJson 敏感字段级加解密收口(C371 / GFX-838,对齐 C370 TenantObjectStorageConfigCrypto):
/// 广告回调配置 ConfigJson 敏感字段级加解密收口(C371 / GFX-838,对齐 C370 ObjectStorageConfigCrypto):
/// 写入侧在 NormalizeConfigJson 规范化之后、落库之前调用 <see cref="EncryptConfigJson"/>;
/// 读取侧在构建回调验签上下文之前调用 <see cref="DecryptConfigJson"/>。
/// <para>敏感字段集合由 Provider Schema 的 <c>Sensitive</c> 标记或 <c>Type == "secret"</c> 驱动(与表单脱敏 / 必填校验同源判定),
/// 非敏感字段(callbackUrl 等)保持明文可读;字段值为密文形态(<c>enc:sec:v1:</c> 前缀)时幂等跳过。</para>
/// <para>性能约束:底层 PBKDF2 派生单次数百毫秒级——<see cref="DecryptConfigJson"/> 按「密文原文 → 明文 JSON」做进程级缓存,
/// 同一密文只解密一次;任何配置写入都会产生新密文(每次加密随机 Salt + Nonce),缓存 key 随之失效。</para>
/// <para>ponytail: 缓存字典无淘汰上限(key 为整段密文 JSON);广告回调配置行数极少(每租户个位数),增长天花板可忽略。
/// <para>ponytail: 缓存字典无淘汰上限(key 为整段密文 JSON);广告回调配置行数极少(每作用域个位数),增长天花板可忽略。
/// 升级路径:按配置行 Id 失效或换 LRU。</para>
/// </summary>
public static class AdvertisementCallbackConfigCrypto
Expand Down Expand Up @@ -40,7 +40,7 @@ public static string EncryptConfigJson(string provider, string configJson)
return configJson;
}

return TransformSensitiveFields(configJson, sensitiveKeys, TenantSecretCrypto.Encrypt);
return TransformSensitiveFields(configJson, sensitiveKeys, SecretCrypto.Encrypt);
}

/// <summary>
Expand All @@ -52,7 +52,7 @@ public static string EncryptConfigJson(string provider, string configJson)
/// <returns>敏感字段为明文的 ConfigJson</returns>
public static string DecryptConfigJson(string provider, string configJson)
{
if (string.IsNullOrWhiteSpace(configJson) || !configJson.Contains(TenantSecretCrypto.EncryptedPrefix, StringComparison.Ordinal))
if (string.IsNullOrWhiteSpace(configJson) || !configJson.Contains(SecretCrypto.EncryptedPrefix, StringComparison.Ordinal))
{
return configJson;
}
Expand All @@ -70,7 +70,7 @@ private static string DecryptCore(string provider, string configJson)
return configJson;
}

return TransformSensitiveFields(configJson, sensitiveKeys, TenantSecretCrypto.Decrypt);
return TransformSensitiveFields(configJson, sensitiveKeys, SecretCrypto.Decrypt);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GameFrameX.Core.SqlSugar;
using GameFrameX.Entity.Tenant.Game;
using GameFrameX.Entity.Business.Game;
using GameFrameX.Foundation.Json;
using GameFrameX.Foundation.Logger;
using Microsoft.AspNetCore.Http;
Expand All @@ -11,17 +11,17 @@ namespace GameFrameX.Advertisement.Abstract;
/// </summary>
public abstract class AdvertisementCallbackHandlerBase
{
protected readonly Repository<TenantGameRoleEntity> RoleRepository;
protected readonly Repository<GameRoleEntity> RoleRepository;

protected AdvertisementCallbackHandlerBase(Repository<TenantGameRoleEntity> roleRepository)
protected AdvertisementCallbackHandlerBase(Repository<GameRoleEntity> roleRepository)
{
RoleRepository = roleRepository;
}

/// <summary>
/// 反序列化 ConfigJson 为强类型 Option;校验 Provider 绑定与类型匹配。
/// </summary>
protected static TOption? DeserializeOption<TOption>(TenantAdvertisementCallbackOptions advertisementOptions) where TOption : class, IAdvertisementCallbackOptionSetting
protected static TOption? DeserializeOption<TOption>(AdvertisementCallbackOptions advertisementOptions) where TOption : class, IAdvertisementCallbackOptionSetting
{
if (string.IsNullOrWhiteSpace(advertisementOptions?.ConfigJson))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace GameFrameX.Advertisement.Abstract;

/// <summary>
/// 租户广告回调配置快照。null 引用表示该作用域未配置广告回调材料。
/// 广告回调配置快照。null 引用表示该作用域未配置广告回调材料。
/// </summary>
public sealed class TenantAdvertisementCallbackOptions
public sealed class AdvertisementCallbackOptions
{
/// <summary>
/// 广告回调验签配置绑定的游戏应用分包 Id。
/// </summary>
public long PackageId { get; init; }

/// <summary>
/// 广告平台 Provider。
/// </summary>
Expand Down Expand Up @@ -49,4 +54,4 @@ public sealed class TenantAdvertisementCallbackOptions
/// AdMob 回调验签的 key_id → base64 key 映射(解析自 <see cref="VerificationKeys"/>)。
/// </summary>
public IReadOnlyDictionary<string, string> AdMobKeys { get; init; } = new Dictionary<string, string>(StringComparer.Ordinal);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface IAdvertisementCallbackHandler
string ProviderName { get; }

/// <summary>schema 取参 + 按平台算法验签。</summary>
OptionVerification Verify(TenantAdvertisementCallbackOptions advertisementOptions, IQueryCollection query);
OptionVerification Verify(AdvertisementCallbackOptions advertisementOptions, IQueryCollection query);

/// <summary>从已验签 Option + query 解析角色 + 用户。</summary>
Task<RoleResolution?> ResolveRoleAsync(object option, IQueryCollection query);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Entity.Tenant.Game;
using GameFrameX.Entity.Business.Game;

namespace GameFrameX.Advertisement.Abstract;

Expand All @@ -7,6 +7,6 @@ namespace GameFrameX.Advertisement.Abstract;
/// </summary>
public sealed class RoleResolution
{
public TenantGameRoleEntity Role { get; set; } = null!;
public GameRoleEntity Role { get; set; } = null!;
public long UserId { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using GameFrameX.Foundation.Json;
using GameFrameX.Foundation.Logger;
using GameFrameX.Core.SqlSugar;
using GameFrameX.Entity.Tenant.Game;
using GameFrameX.Entity.Business.Game;
using Microsoft.AspNetCore.Http;
using GameFrameX.Core.SignatureAuth;

Expand All @@ -19,11 +19,11 @@ public string ProviderName
get { return "GoogleAdMob"; }
}

public AdMobAdvertisementCallbackHandler(Repository<TenantGameRoleEntity> roleRepository) : base(roleRepository)
public AdMobAdvertisementCallbackHandler(Repository<GameRoleEntity> roleRepository) : base(roleRepository)
{
}

public OptionVerification Verify(TenantAdvertisementCallbackOptions advertisementOptions, IQueryCollection query)
public OptionVerification Verify(AdvertisementCallbackOptions advertisementOptions, IQueryCollection query)
{
var option = DeserializeOption<GoogleAdMobAdvertisementCallbackOption>(advertisementOptions);
if (option == null || string.IsNullOrWhiteSpace(option.verificationKeys))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using GameFrameX.Advertisement.Abstract;
using GameFrameX.Core.SqlSugar;
using GameFrameX.Entity.Tenant.Game;
using GameFrameX.Entity.Business.Game;
using GameFrameX.Foundation.Hash;
using Microsoft.AspNetCore.Http;

namespace GameFrameX.Advertisement.Pangle;

/// <summary>
/// Pangle 广告回调处理器(SHA256(SecurityKey:TransId) 验签,密钥取租户配置 <see cref="TenantAdvertisementCallbackOptions.PangleSecurityKey"/>)。
/// Pangle 广告回调处理器(SHA256(SecurityKey:TransId) 验签,密钥取数据库配置行 <see cref="AdvertisementCallbackOptions.PangleSecurityKey"/>)。
/// <para>与 TopOn / AdMob / UnityAds 不同:不进发奖链路,仅由宿主 Controller 调用 <see cref="Verify"/> 验签,保持既有 HTTP 响应行为。</para>
/// </summary>
public sealed class PangleAdvertisementCallbackHandler : AdvertisementCallbackHandlerBase, IAdvertisementCallbackHandler
Expand All @@ -17,11 +17,11 @@ public string ProviderName
get { return "Pangle"; }
}

public PangleAdvertisementCallbackHandler(Repository<TenantGameRoleEntity> roleRepository) : base(roleRepository)
public PangleAdvertisementCallbackHandler(Repository<GameRoleEntity> roleRepository) : base(roleRepository)
{
}

public OptionVerification Verify(TenantAdvertisementCallbackOptions advertisementOptions, IQueryCollection query)
public OptionVerification Verify(AdvertisementCallbackOptions advertisementOptions, IQueryCollection query)
{
if (advertisementOptions == null || string.IsNullOrWhiteSpace(advertisementOptions.PangleSecurityKey))
{
Expand Down
Loading
Loading