Search before asking
Feature Description (功能描述)
Description
Currently, auth endpoints in the Python client use absolute paths (/auth/users, /auth/groups, etc.) with @router.http decorators. This approach works in HugeGraph 1.7.0 only because a temporary PathFilter compatibility layer whitelists these paths and passes them through.
However, PathFilter is a temporary measure that will be removed in future HugeGraph versions. Once removed, these absolute paths will break because they don't use proper graphspace-scoped routing.
Problem
- Auth endpoints currently rely on PathFilter (temporary compatibility layer)
- PathFilter will be removed in future versions, breaking these endpoints
- Server expects graphspace-scoped paths for most auth endpoints in HugeGraph 1.7.0+
Solution
Implement a dual-path strategy (similar to the Java Client's AuthAPI.java):
Graphspace-scoped endpoints (HugeGraph 1.7.0+):
graphspaces/{graphspace}/auth/users
graphspaces/{graphspace}/auth/accesses
graphspaces/{graphspace}/auth/belongs
graphspaces/{graphspace}/auth/targets
Server-level endpoints (always):
/auth/groups (server-level exception)
Implementation Notes
The router framework currently uses decorators evaluated at class definition time, which prevents dynamic path construction. A refactoring is needed to support runtime path resolution for auth endpoints, separate from graph-data endpoint routing (which use graphspaces/{graphspace}/graphs/{graph}/...).
Related
Are you willing to submit a PR?
Code of Conduct
Search before asking
Feature Description (功能描述)
Description
Currently, auth endpoints in the Python client use absolute paths (
/auth/users,/auth/groups, etc.) with@router.httpdecorators. This approach works in HugeGraph 1.7.0 only because a temporaryPathFiltercompatibility layer whitelists these paths and passes them through.However, PathFilter is a temporary measure that will be removed in future HugeGraph versions. Once removed, these absolute paths will break because they don't use proper graphspace-scoped routing.
Problem
Solution
Implement a dual-path strategy (similar to the Java Client's
AuthAPI.java):Graphspace-scoped endpoints (HugeGraph 1.7.0+):
graphspaces/{graphspace}/auth/usersgraphspaces/{graphspace}/auth/accessesgraphspaces/{graphspace}/auth/belongsgraphspaces/{graphspace}/auth/targetsServer-level endpoints (always):
/auth/groups(server-level exception)Implementation Notes
The router framework currently uses decorators evaluated at class definition time, which prevents dynamic path construction. A refactoring is needed to support runtime path resolution for auth endpoints, separate from graph-data endpoint routing (which use
graphspaces/{graphspace}/graphs/{graph}/...).Related
AuthAPI.javadual-path strategyAre you willing to submit a PR?
Code of Conduct