Skip to content

feat(hermes): 域与域下 IDP 落库,域密钥入 t_key,应用仅能添加域下 IDP#34

Merged
heliannuuthus merged 8 commits intomainfrom
feat/domain-idp-persistence
Mar 16, 2026
Merged

feat(hermes): 域与域下 IDP 落库,域密钥入 t_key,应用仅能添加域下 IDP#34
heliannuuthus merged 8 commits intomainfrom
feat/domain-idp-persistence

Conversation

@heliannuuthus
Copy link
Owner

  • 新增 t_domain、t_domain_idp 表,域元数据与允许的 IDP 从 DB 读
  • 域签名密钥写入 t_key(owner_type=domain),GetDomainWithKey 优先读 DB 再回退配置
  • Hermes 暴露 GET/POST/PATCH/DELETE 应用 IDP 配置,创建时校验 idp 在域 allowed_idps 内
  • API 返回域时带 allowed_idps;Aegis 注册校验改为用 cache 中 domain.AllowedIDPs
  • initialize-hermes.py 生成 t_domain、t_domain_idp、域密钥 INSERT;init.sql 同步

heliannuuthus and others added 8 commits March 10, 2026 23:55
- 新增 t_domain、t_domain_idp 表,域元数据与允许的 IDP 从 DB 读
- 域签名密钥写入 t_key(owner_type=domain),GetDomainWithKey 优先读 DB 再回退配置
- Hermes 暴露 GET/POST/PATCH/DELETE 应用 IDP 配置,创建时校验 idp 在域 allowed_idps 内
- API 返回域时带 allowed_idps;Aegis 注册校验改为用 cache 中 domain.AllowedIDPs
- initialize-hermes.py 生成 t_domain、t_domain_idp、域密钥 INSERT;init.sql 同步
- hermes/service.go, types.go, sql/hermes/init.sql
- GET /auth/logout with return_to, client_id
- ResolveLogoutRedirect: only allowed_logout_uris, 400 when not configured
- allowed_redirect_uris, allowed_origins, allowed_logout_uris
- Logout handler refactor, revokeAndClearSSO
Introduce a generic `pkg/filter` package that parses a compact
`filter=col<op>val` query string format (e.g. `name~=my,service_id=abc`)
and applies WHERE clauses to GORM queries. Each resource declares a
whitelist of allowed columns and operators.

Unify all list endpoints to use a single `ListRequest` struct with
cursor pagination and the filter parameter, replacing per-resource
list request types and hand-written if-chains in service methods.
Rewrite the query design doc to reflect the symbol-based filter format
(filter=col<op>val), whitelist mechanism, backend Checklist updates,
and the frontend filter builder API from @atlas/shared.
Code review fixes:
- Escape LIKE wildcards (% _) in prefix match to prevent pattern injection
- Rewrite parseExpression to extract column name first, then match
  operator at the boundary, eliminating ambiguity when values contain
  operator characters
- Add filter length limit (500 chars) to bound CPU cost
- Cap IN operator values at 50 to prevent oversized SQL
- Filter empty elements from IN value splits
- Restrict column names to lowercase + digits + underscore only
- Add FindRelationships for direct DB query in aegis CheckRelations,
  replacing filter string concatenation that was limited to 100 rows
  and vulnerable to special character parsing issues
@heliannuuthus heliannuuthus merged commit 7f3fbf8 into main Mar 16, 2026
5 checks passed
@heliannuuthus heliannuuthus deleted the feat/domain-idp-persistence branch March 16, 2026 02:13
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.

1 participant