feat(hermes): 域与域下 IDP 落库,域密钥入 t_key,应用仅能添加域下 IDP#34
Merged
heliannuuthus merged 8 commits intomainfrom Mar 16, 2026
Merged
Conversation
Owner
heliannuuthus
commented
Mar 10, 2026
- 新增 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 同步
- 新增 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.