Skip to content

feat(security): IAM hardening tranche 1 — consent auth gates, admin bootstrap, password policy - #141

Merged
voidvec merged 10 commits into
masterfrom
feat/iam-core-hardening-tranche1
Aug 30, 2026
Merged

voidvec merged 10 commits into
masterfrom
feat/iam-core-hardening-tranche1

Conversation

@voidvec

@voidvec voidvec commented Aug 30, 2026

Copy link
Copy Markdown
Owner

背景

IAM Core 加固计划首批(M2.1 + M1.3):先修最高 severity 的协议缺口。实施于独立 worktree(../authforge-hardening),方案与计划经双子代理深度评审(抓到 2 个阻断级事实错误:authorize 下发的 user_id 是 internal id 而非 public sub;deny 分支 validateClient 空 secret 会误杀 CONFIDENTIAL 客户端)后修订落地。

1. consent 认证四道门(F1,Critical)

现状(代码核实):POST /oauth2/consent 路由无 filter、handler 信任表单 user_id——知道 user_id 的匿名请求可代批/代拒授权;deny 分支 302 到未校验的 redirect_uri(开放重定向)。

修复(全部 fail-closed,在 plugin 调用前):

  1. 会话门:无登录会话 → 401 AUTH_SESSION_REQUIRED(新码 4007)——OIDC Core §3.1.2.1;
  2. 身份绑定门:user_id 必须 = 会话身份(authorize 下发的 internal id)→ 403 AUTHZ_ACCESS_DENIED;
  3. CSRF 门:authorize→consent 重定向时服务端生成随机 nonce 存 session 并附在 consent URL,POST 必须回传(一次性 + TTL 600s)。刻意不用客户端可控的 state——空/可猜 state 会让门空转(Safari 无 Lax 默认);
  4. deny 分支:redirect_uri 经 validateRedirectUri 校验(与 approve 对称,修开放重定向;不调 validateClient——空 secret 会误拒 CONFIDENTIAL 客户端,评审抓到的坑)。

配套:SPA ConsentPage 回传 consent_csrf;删孤儿 consent.csp;openapi consent 补 400/401/403。

2. bootstrap 管理员(#103)

首启时若无 admin 角色用户 → 创建 admin(PBKDF2-SHA256 310k,与生产哈希同格式):密码取 FULLA_BOOTSTRAP_ADMIN_PASSWORD,未设则随机生成并日志打印一次。幂等(角色存在性检测 + 用户名唯一约束);dev seed 使其在 dev/test/bench 全部 no-op;空库 + auto-migrate 竞态以延迟探测软失败、下次重启重试。

3. 密码策略 + 遗留哈希门(#103)

  • /api/register 补服务端最小长度(auth.min_password_length,默认 8);改密/重置既有 8 位硬编码统一读同一配置;短密码新码 VALIDATION_PASSWORD_TOO_SHORT(3014,替换 VALIDATION_FORMAT_ERROR)。
  • 遗留无盐 SHA256 路径加配置门 auth.allow_legacy_hash(默认 true=迁移窗口;rehash-on-login 既有,评审核实)——确认全量迁移后可关。
  • README ×2/部署指南:删公开凭证表格与 sha256sum 造管理员的步骤,改 bootstrap 流程描述。

4. 已知限制与登记项(评审发现,本批不修)

  • 自注册用户无 oauth2_subject_mappings 行 → 走 authorize→consent 会 500(存量 bug,与四门正交);
  • consent 签发的 code 绑 internal id,login/MFA 签发的绑 public sub——oauth2_codes.user_id 双形态语义;
  • consent 单槽 nonce(多 tab 并发 authorize 只有最后一个可提交);首登强制改密。

测试证据

  • 新增 ConsentAuthGateHttpTest(进程内真实 HTTP):无会话 401 / 错 user 403 / 缺 nonce 400 / deny 未注册 URI / authorize 造 nonce → approve 302 带 code → nonce 重放 400;
  • 后端 full_test 8/8 PASS(353 ctest 含新测试 + 59 OAuth2 端点 + 55 admin 端点,config 变更无回归);
  • 前端:user e2e 107 passed + admin 180 passed;构建/lint 全绿;
  • 顺带修复:PostgresConsentRepository 把中文"已经存在"的 duplicate-key 误判为失败(本地化消息字符串匹配缺陷)。

openapi / SDK / 文档 / 版本

  • openapi:加性变更(consent 新 4xx 响应、register password minLength)——无破坏性变更;C++ 端点文档注册同步;
  • 错误码五处同步完成:ErrorCatalog、openapi、C++ 注册、前端 zh-CN ×2、api-reference(ErrorCatalogDocTest 本地绿);
  • SDK:Python consent 生成物已再生成,Go 无 diff;spec 治理门本地绿(routes=86/docs=84/yaml=82);
  • 版本号:不变更(加性变更,随下一 hardening 批次合并发 v1.0.1)。

…word policy (IAM hardening tranche 1)

Consent authentication closure (F1, highest-severity protocol gap):
POST /oauth2/consent previously accepted anonymous submissions that
trusted the form's user_id — anyone knowing a user id could approve or
deny authorizations on their behalf, and the deny branch 302'd to an
unvalidated redirect_uri (open redirect). Four fail-closed gates now run
before any plugin call:

  1. authenticated session required (new AUTH_SESSION_REQUIRED, 4007)
  2. user_id must equal the session identity (internal id; reuses
     AUTHZ_ACCESS_DENIED 5001)
  3. server-minted one-shot CSRF nonce (consent_csrf, TTL 600s) —
     deliberately NOT the client-chosen state, which is attacker-known;
     authorize mints it into the session and the consent URL
  4. deny redirect_uri validated like approve (RFC 6749 §3.1.2.2;
     validateRedirectUri only — validateClient with an empty secret
     false-rejects CONFIDENTIAL clients)

SPA ConsentPage echoes consent_csrf; orphan consent.csp removed;
openapi consent gains 400/401/403.

Admin bootstrap (#103): on first start, when no user holds the admin
role, create 'admin' with a PBKDF2-SHA256 password from
FULLA_BOOTSTRAP_ADMIN_PASSWORD or randomly generated and printed to the
log exactly once. Idempotent (role-existence check + username unique
constraint); dev seeds make it a no-op. README/deployment docs stop
publishing admin/admin and the sha256sum admin-creation recipe.

Password policy (#103): /api/register gains a server-side minimum
length (auth.min_password_length, default 8; change/reset already
hardcoded 8 and now read the same setting), with new
VALIDATION_PASSWORD_TOO_SHORT (3014) replacing VALIDATION_FORMAT_ERROR
for short passwords. Legacy unsalted-SHA256 verification gains a
configuration gate (auth.allow_legacy_hash, default true = migration
window; rehash-on-login already existed). Frontend hints 6 -> 8.

Tests: new ConsentAuthGateHttpTest (no-session 401, wrong-user 403,
missing-nonce 400, deny-unregistered-uri, authorize-mints-nonce
happy path + one-shot replay). Localized duplicate-key consent insert
treated as success. full_test 8/8 PASS; user/admin e2e green
(107/180); spec governance green.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…legacy gate); oasdiff errata for register password minLength

- api-diff: RuleSet.h static policy and AuthService.h setter/member are
  pure additive declarations — baseline updated per policy.
- oasdiff: register password minLength 0->8 is an intentional security
  tightening (#103, NIST SP 800-63B floor); only caller is this repo's
  SPA (updated in the same PR), SDKs regenerated. Errata entry added
  with justification per the ignore-file policy.
DROGON_TEST names now carry the required scope/priority segments
(Integration_P1_Consent_*). oasdiff errata backticks unescaped so the
gate's text matcher can actually hit the entry.
…ntion)

The three new settings (bootstrap_admin.enabled, allow_legacy_hash,
min_password_length) were initially written to a root-level auth block.
All product knobs in this repo live under custom_config.* — the code
reads them via app().getCustomConfig(), and custom_config.auth is the
established home (require_pkce_for_public, rate_limit, ...). The
root-level block was therefore dead config: parseable JSON whose values
the server never read (defaults masked it in tests).
@voidvec

voidvec commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

代码评审(三视角:完整性 / 正确性 / 影响面,已逐条对照代码核实)

范围:2eabbb8d..3cf7d00b(5 commits,41 files,+863/−157)。所有行号基于 PR head 3cf7d00b。

总体:四道门主体、AdminBootstrapper、密码策略均真实落地且规则合规(Mapper+Criteria+async callback、独立 try-catch、失败均回调)。以下按严重度列出核实后的发现。


🔴 严重问题(MUST FIX)

1. 新必填参数 consent_csrf 未写入 OpenAPI 契约,按 spec/SDK 生成的调用方对 consent 端点 100% 失败

  • apps/server/openapi.yaml:consent_csrf 仅出现在 400 响应的 description 文案(L2679),parameters 中没有声明;
  • libs/drogon/src/controllers/SessionController.cc L374 附近的运行时文档注册同样仍是原参数集;
  • 已核实 clients/python、clients/go 生成物中均无 consent_csrf。

Gate 3(SessionController.cc L1039-1064)无条件要求该参数,缺失即 400——任何严格按 spec/SDK 构造的请求必然失败。这是 oasdiff 检测不到的隐性破坏性变更(oasdiff-breaking-ignore.md 只登记了 register minLength)。另外 401 响应声明了 AUTH_SESSION_REQUIRED,但 spec 未说明该端点需携带会话。

修复:在 openapi.yaml 与服务端文档注册中补参数并重新生成 SDK:

- description: Server-minted one-shot CSRF nonce from the authorize->consent redirect (required)
  in: query
  name: consent_csrf
  required: true
  schema:
    type: string

若坚持不暴露给 SDK,需在 oasdiff 勘误中显式登记该破坏性变更并说明端点为仅浏览器交互。


🟠 警告(SHOULD FIX)

2. consent nonce 一次性消费非原子:并发双提交可同时通过

SessionController.cc L1039-1064:Gate 3 的「find → get → 比较 → erase」是四个各自独立加锁的 Session 操作。多 IO 线程下同一会话的两个并发 POST /oauth2/consent 可同时读到同一 pending_consent_csrf、双双通过比较,各自继续 generateAuthorizationCode——一次同意签发两个授权码,"one-shot" 只在串行场景成立。

修复方向:按 session id 加互斥锁包住 Gate 3 全块;或将 nonce 落库,用 DELETE FROM ... WHERE nonce=$1 RETURNING ... 原子消费(受影响行数 0 即拒绝,属 raw SQL 豁免形式)。

3. 域服务层异步回调捕获 [this],违反 .claude/rules/db-operations.md 规则 4

libs/identity/src/AuthService.cc L183:onFound = [this, sharedCb, ...],L201 在异步回调中读 this->allowLegacyHash_。规则明确禁止 libs/identity 域服务在异步回调中捕获 [this],且 AuthService.h 未继承 enable_shared_from_this。当前唯一实例是进程级 static shared_ptr 所以暂不悬垂,但安全性被绑定在"实例永不销毁"这一未编码假设上。

修复(配置在启动时一次性写入,值捕获语义等价):

const bool allowLegacy = allowLegacyHash_;
auto onFound = [allowLegacy, sharedCb, crypto, clock, userRepo, password](std::optional<UserData> found) { ... };

4. AdminBootstrapper 部分失败状态永久卡死,重启不自愈

apps/server/src/bootstrap/AdminBootstrapper.cc:

  • 场景 A:createAdmin 成功但 assignAdminRole 瞬时失败(L132-138 仅 finish(false))→ admin 用户存在但无角色。此后每次启动:run() 查 user_roles 为空 → 再 createAdmin → users_username_key 冲突 → 永久报错(L186-192),无任何路径补授角色;
  • 场景 B:用户+角色成功但 insertSubjectMapping 失败 → 上报 created=true("mapping deferred",L101-113)。后续启动见角色已存在直接成功返回(L227-231),永不补建 mapping;而 mapping 缺失会使 consent 的 getInternalUserId 返回 500(ConsentAuthGateHttpTest.cc L169-171 注释自证)。

修复方向:run() 改为"按缺失环节补齐"——检测到 admin 用户已存在时复用其 id 继续补角色/补 mapping;仅 user+role+mapping 三者齐备才 no-op;mapping 失败不应计 created=true。

5. 密码最小长度策略未覆盖管理员建号 API

auth.min_password_length 已接入注册(RuleSet)、改密(UserSelfServiceController)、重置(PasswordResetService)三入口,但已核实 libs/drogon/src/admin/UserAdminService.cc L640 只有 password.empty() 检查,无最小长度校验。管理端 SPA 仅有客户端硬编码 8 位检查(见 #14),直接调 API 即可创建 1 位密码账号——管理端成为策略旁路。

修复:建号路径加同一校验,短密码返回 VALIDATION_PASSWORD_TOO_SHORT。

6. 新集成测试两个用例覆盖与声称不符,且一用例依赖测试执行顺序

tests/integration/oidc/ConsentAuthGateHttpTest.cc:

  • Integration_P1_Consent_MissingNonce_Returns400(L84-100):名字声称 400,实际以 user_id=1 提交并断言 403——成立前提是"seeded admin 内部 id ≠ 1"。全新库上 dev_admin_user.sql 首条插入使 admin.id = 1:Gate 2 通过、Gate 3 返回 400,CHECK(403) 失败;结果取决于 ctest 执行顺序与库状态。注释自认"缺 nonce 400 由重放用例覆盖",但重放测的是已消费槽位,与"有会话+正确用户+缺 nonce"不是同一输入——Gate 3 缺失分支实际零覆盖;
  • Integration_P1_Consent_DenyUnregisteredUri_Gated(L102-116):匿名 POST 只断言 401,完全没有执行门 4;注释称由 happy-path 覆盖,但 happy-path(L118-201)只测了 approve。已核实 tests/ 下无其他 consent 测试覆盖已认证会话下"已认证 + deny + 未注册 redirect_uri → 400"这条修开放重定向的核心路径。

修复:补三个用例——①持有效会话、走 authorize 拿 user_id、不回传 consent_csrf → 400;②action=deny + 未注册 redirect_uri → 400 且无 Location;③action=deny + 注册 redirect_uri → 302 且 Location 含 error=access_denied。

7. deployment.md 与 bootstrap 行为存在残留矛盾

docs/operate/deployment.md:bootstrap 指引已加入("Preferred: let the server bootstrap the admin..."),但:

  • 开头仍写 "no seed data is created automatically — you must manually create the admin user",与首启自动建 admin 直接矛盾;
  • ADMIN_SALT=$(openssl rand -hex 16) 残留并被写入 users.salt 列——该列只对遗留 SHA-256 校验有意义,AuthService 解析 $pbkdf2-sha256$ 时忽略它,手工回退指南内部自相矛盾。

修复:修正开头表述(admin 由 bootstrap 自动创建,OAuth2 client 仍需手工),删除或注明 ADMIN_SALT 对 PBKDF2 哈希无效。

8. 错误码文档漂移:website i18n 镜像未同步 3014/4007

已核实 docs/domains/api-reference.md 已补 3014/4007,但 website/i18n/zh-CN/docusaurus-plugin-content-docs/current/domains/api-reference.md 的错误码表(已含 4004/4006,证明随码维护)未同步。官网发布后两份"权威"错误码表不一致——"五处同步"实际是六处。

修复:镜像表格补入 VALIDATION_PASSWORD_TOO_SHORT (3014) 与 AUTH_SESSION_REQUIRED (4007)。

9. Admin bootstrap 依赖固定 2 秒延迟探测,慢迁移场景静默失效

apps/server/src/main.cc L342-350:sleep_for(2000ms) 后探测,迁移超过 2 秒(大库/冷盘首启)时走失败分支且仅 LOG_DEBUG 记录(生产日志级别下不可见),admin 要到下次重启才重试——运维表现为"首启后没有 admin、日志无线索"。多副本同时首启还会各自打印随机密码、仅一个插入成功。

修复:改为探测失败后按退避重试若干次,或挂到迁移完成信号之后触发;失败分支至少提升到 LOG_WARN 并携带原因。


🟡 建议(CONSIDER)

10. 单槽 pending_consent_csrf:并发 authorize 使先发起的同意书作废

AuthorizationEndpointController.cc L650 单键 insert 直接覆盖。同会话先对客户端 A 走到同意页(nonce₁)、再对客户端 B 发起 authorize(nonce₂ 覆盖 nonce₁),回到 A 同意页提交将 400 卡死(改动前两条流都能成功)。PR 描述已登记为"本批不修"的已知限制,此处仅确认影响面评审同样命中;长期建议以 client_id/flow id 为键改为多槽。

11. Gate 4 注释与事实不符:approve 分支从未校验 redirect_uri

SessionController.cc L1083-1088 注释称 deny 校验 "exactly like the approve branch",但已核实 approve 分支(L1130 起)直接透传 redirectUri 到签发,无 validateRedirectUri。因 Gate 2 存在不构成越权,但注释误导。建议修正注释或给 approve 加同样校验。

12. AdminBootstrapper 在确认插入成功之前打印随机密码

AdminBootstrapper.cc L162-168 在 userMapper.insert(L181)之前就宣告 "created administrator with password: …"。若插入失败,日志声称已创建而实际没有,且浪费一次性密码。建议把打印移入 insert 成功回调。

13. duplicate-key 判定仍依赖本地化文案,建议改用 SQLSTATE

libs/storage-postgres/src/PostgresConsentRepository.cc L87-88:新增 已经存在 匹配仅覆盖中文 lc_messages 实例,其它语言环境仍会误报失败;反向地,含该子串的非唯一键错误也会被吞成成功。建议用 SqlError::sqlState() == "23505" 做主判定,文案匹配留作兜底。

14. 管理端前端把密码下限硬编码为 8,与服务端可配置项脱钩

frontends/admin/src/pages/users/UsersPage.vue L101:password.length < 8 写死。服务端已改为 auth.min_password_length 可配置,配置调整后会出现客户端/服务端策略漂移。建议由服务端错误码裁决或下发最小长度。

15. CHANGELOG 出现两个 ## [Unreleased] 段

CHANGELOG.md L11 与 L26 各有一个 ## [Unreleased],违反 Keep a Changelog 格式,cliff 汇总会错乱。建议并入已有段落、删除重复标题。

16. 入库生成物 apps/server/docs/api/openapi.json 未随 openapi.yaml 再生成

已核实该文件中 register password 无 minLength,consent 端点未反映新响应码。它被 swagger-initializer.js 直接消费,仅当以仓库根为 CWD 启动时才会被覆写,容器等环境继续展示陈旧契约。建议重新生成并提交。

17. apps/server/AGENTS.md 仍把已删除的 consent.csp 列为现存视图

apps/server/AGENTS.md L140:本 PR 删除了该模板,视图清单应同步删除条目。

18. 仅过第一因素的会话被四道门视为"已认证"(提示性,非本 diff 引入)

登录成功即在 MFA 校验前写入 sub/userId,RequireMfa 暂停期间 authorize→consent 链路(含 Gate 1)放行,可拿到 amr="pwd" 的授权码。此为 authorize 既有行为,四道门只是与之对齐;既然以"已认证会话"为门槛承诺,建议后续批次评估识别 MFA-pending 会话并拒绝。


变更摘要(核实结论)


评审由完整性/正确性/影响面三视角并行执行,全部发现已逐条对照代码核实(含行号)。

…loor, bootstrap self-heal, review cleanups

Address PR #141 review (1 must-fix, 8 should-fix, quick considers):

- #1 consent_csrf declared as a required query parameter in openapi.yaml
  and the C++ endpoint doc registration; apps/server/docs/api/openapi.json
  regenerated from a live server run; Python/Go clients regenerated.
- #2 nonce one-shot is now atomic: the find/verify/erase sequence is
  serialized by a process-wide mutex (consent traffic is tiny; in-process
  session storage).
- #3 identity AuthService no longer captures this in the async validateUser
  callback — the legacy-hash policy flag is value-captured
  (db-operations rule 4).
- #4/#12 AdminBootstrapper reworked as ensure-* steps: an existing admin
  user row is reused and role/mapping completed (partial failures self-heal
  on restart); the random password is printed only after the insert
  succeeded; a mapping failure no longer reports created=true.
- #5 POST /api/admin/users enforces auth.min_password_length
  (VALIDATION_PASSWORD_TOO_SHORT) — closing the admin bypass.
- #6 consent integration tests reworked: missing-nonce now drives the real
  authorize-minted slot (400), deny-to-unregistered-uri (400, no Location)
  and deny-to-registered-uri (302 access_denied) branches are covered.
- #7/#8 deployment.md: auto-bootstrap wording fixed, bogus ADMIN_SALT
  removed (PBKDF2 keeps salt empty); website i18n error table mirrored
  (3014/4007).
- #9 main.cc bootstrap probes with backoff (5 attempts) and LOG_WARN on
  failure instead of a single silent 2s probe.
- #13 unique-violation detection layered (SqlError 23505 -> constraint
  name -> english/zh localized text), mirroring the
  PostgresSocialAccountRepository pattern.
- #11 gate-4 comment corrected; #15 CHANGELOG duplicate Unreleased merged;
  #17 AGENTS.md consent.csp entry removed.

Considered-but-not-taken: #10 multi-slot nonces (tracked follow-up), #14
admin UI hardcode (server now enforces; hint stays), #18 MFA-pending
session through consent (pre-existing authorize behavior, tracked).
@voidvec

voidvec commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

评审意见逐条处置

评审已全部核实并修复(1ddc2d0)。逐条结论:

MUST-FIX

SHOULD-FIX

CONSIDER

测试

本地复跑:OAuth2Tests(含重构后的 consent 用例)全绿;后端构建零警告错误;门预演(治理门/命名/bool-check)通过。CI 运行中。

@voidvec
voidvec merged commit 3865e60 into master Aug 30, 2026
16 checks passed
voidvec added a commit that referenced this pull request Aug 30, 2026
…loor, bootstrap self-heal, review cleanups

Address PR #141 review (1 must-fix, 8 should-fix, quick considers):

- #1 consent_csrf declared as a required query parameter in openapi.yaml
  and the C++ endpoint doc registration; apps/server/docs/api/openapi.json
  regenerated from a live server run; Python/Go clients regenerated.
- #2 nonce one-shot is now atomic: the find/verify/erase sequence is
  serialized by a process-wide mutex (consent traffic is tiny; in-process
  session storage).
- #3 identity AuthService no longer captures this in the async validateUser
  callback — the legacy-hash policy flag is value-captured
  (db-operations rule 4).
- #4/#12 AdminBootstrapper reworked as ensure-* steps: an existing admin
  user row is reused and role/mapping completed (partial failures self-heal
  on restart); the random password is printed only after the insert
  succeeded; a mapping failure no longer reports created=true.
- #5 POST /api/admin/users enforces auth.min_password_length
  (VALIDATION_PASSWORD_TOO_SHORT) — closing the admin bypass.
- #6 consent integration tests reworked: missing-nonce now drives the real
  authorize-minted slot (400), deny-to-unregistered-uri (400, no Location)
  and deny-to-registered-uri (302 access_denied) branches are covered.
- #7/#8 deployment.md: auto-bootstrap wording fixed, bogus ADMIN_SALT
  removed (PBKDF2 keeps salt empty); website i18n error table mirrored
  (3014/4007).
- #9 main.cc bootstrap probes with backoff (5 attempts) and LOG_WARN on
  failure instead of a single silent 2s probe.
- #13 unique-violation detection layered (SqlError 23505 -> constraint
  name -> english/zh localized text), mirroring the
  PostgresSocialAccountRepository pattern.
- #11 gate-4 comment corrected; #15 CHANGELOG duplicate Unreleased merged;
  #17 AGENTS.md consent.csp entry removed.

Considered-but-not-taken: #10 multi-slot nonces (tracked follow-up), #14
admin UI hardcode (server now enforces; hint stays), #18 MFA-pending
session through consent (pre-existing authorize behavior, tracked).
voidvec added a commit that referenced this pull request Aug 30, 2026
- Version sync across all six points (Version.cmake, CMakeLists.txt,
  conanfile.py, frontends package.json x2, openapi.yaml, pyproject.toml).
- LICENSE: GNU Affero General Public License v3.0 for this and future
  versions; v1.0.0 remains MIT. Open-core: enterprise features ship in a
  separate commercial distribution.
- CLA.md framework added (individual + entity terms, dual-license grant).
- CHANGELOG: v1.0.1 section with the consent/bootstrap/password-policy
  security fixes from PR #141 and the license-change statement.
- README x2 badges/footer, website footer, pyproject license field updated.
- .gitignore: deliverables/ local ignore.
voidvec added a commit that referenced this pull request Aug 30, 2026
- Version sync across all six points (Version.cmake, CMakeLists.txt,
  conanfile.py, frontends package.json x2, openapi.yaml, pyproject.toml).
- LICENSE: GNU Affero General Public License v3.0 for this and future
  versions; v1.0.0 remains MIT. Open-core: enterprise features ship in a
  separate commercial distribution.
- CLA.md framework added (individual + entity terms, dual-license grant).
- CHANGELOG: v1.0.1 section with the consent/bootstrap/password-policy
  security fixes from PR #141 and the license-change statement.
- README x2 badges/footer, website footer, pyproject license field updated.
- .gitignore: deliverables/ local ignore.
@voidvec
voidvec deleted the feat/iam-core-hardening-tranche1 branch September 2, 2026 05:27
wangrh0909 pushed a commit that referenced this pull request Sep 10, 2026
… and hooks

Consolidates the recurring lessons from the 2026-08/09 engineering sessions
(previously only in AI-session memory) into versioned, tool-agnostic assets:

- skills: ci-gate-sync (sync-point policies for error codes/endpoints/
  migrations/headers), ci-failure-triage (cross-compiler WERROR blind spots,
  flake taxonomy), release-engineering (six-point + ~15 version carriers,
  tag recovery, PyPI first publish), pr-workflow (rebase-merge repair,
  rebase value-loss audit, PAT permission boundary), local-env-runbook
  (Windows/WSL/Docker/Mimosa/multi-session rules), test-methodology (two
  test layers, mock injection seam, Playwright pitfalls), and
  benchmark-methodology (wrk Lua model, A/B discipline, measurement-artifact
  taxonomy).
- rules (path-scoped): sync-points (8-point error-code and 5-point endpoint
  hard checklists), frontend-contract (verified frontend/backend contract
  facts), async-cpp-gotchas (traps beyond db-operations: Session::insert
  no-overwrite, callback double-move, ::drogon:: shadowing).
- commands: /preflight (local gate sweep before pushing), /ci-triage
  (failure classification workflow).
- hooks: local-gates.sh (wired to the git-commit PreToolUse hook, replacing
  the broken full-ctest gate), port-guard.sh, redis-watchdog.ps1.

Provenance (source retrospectives): ci-gate-sync/rules.sync-points from PR
#115/#141/#149/#157/#179/#180 CI post-mortems; release-engineering from the
v1.0.0-v1.1.0 release runs; test-methodology from the coverage push
(48.5%->57.2%) and PR #140/#156 e2e work; benchmark-methodology from the
four-product comparison campaign; local-env-runbook from environment
incident records. AGENTS.md indexes the new rules and skills.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants