Skip to content

feat(server): adapt Hubble 2.0 frontend APIs and implement default graph/role management#3008

Draft
Yeaury wants to merge 5 commits intoapache:masterfrom
Yeaury:feat/hubble-api-compatibility
Draft

feat(server): adapt Hubble 2.0 frontend APIs and implement default graph/role management#3008
Yeaury wants to merge 5 commits intoapache:masterfrom
Yeaury:feat/hubble-api-compatibility

Conversation

@Yeaury
Copy link
Copy Markdown

@Yeaury Yeaury commented Apr 24, 2026

Purpose of the PR

Adapt API endpoints required by the Hubble 2.0 frontend to achieve feature parity with the internal version. The community edition of HugeGraph Server currently lacks several critical APIs that the Hubble frontend depends on (graph profile listing, default graph management, default role management, schema templates, etc.), preventing the Hubble frontend from properly using core graph and role management features. This PR adds the missing APIs to enable full integration between the Hubble 2.0 frontend and the community edition Server.

Main Changes

1. GraphsAPI — Graph Management Endpoint Enhancements (GraphsAPI.java)

  • GET /graphspaces/{graphspace}/graphs/profile — New graph profile listing endpoint with prefix filtering, default-graph-first sorting, and full config info (nickname, create_time, default status, etc.)
  • GET /graphspaces/{graphspace}/graphs/{name}/default — Set a graph as default
  • GET /graphspaces/{graphspace}/graphs/{name}/undefault — Unset a graph as default
  • GET /graphspaces/{graphspace}/graphs/default — Get current user's default graph list
  • PUT /graphspaces/{graphspace}/graphs/{name} — Graph management operations (currently supports update action for nickname updates)
  • POST /graphspaces/{graphspace}/graphs (form-urlencoded) — Hubble frontend form-based graph creation compatibility
  • Auto-fill HStore/PD mode defaults (backend=hstore, serializer=binary, store={name}) during graph creation, and map frontend schema field to schema.init_template

2. GraphSpaceAPI — Default Role Management (GraphSpaceAPI.java)

  • POST /graphspaces/{graphspace}/role — Create default role (supports SPACE/ANALYST/OBSERVER)
  • GET /graphspaces/{graphspace}/role — Check if a user/group has a specified default role
  • DELETE /graphspaces/{graphspace}/role — Delete default role
  • Remove unnecessary PD mode restriction from listProfile endpoint
  • Add @JsonIgnoreProperties(ignoreUnknown = true) to tolerate unknown fields from the frontend

3. ManagerAPI — Role Query (ManagerAPI.java)

  • GET /auth/manager/default — New endpoint for Hubble frontend to query if the current user has a specified default role

4. SchemaTemplateAPI — Schema Template CRUD (New File)

  • GET /graphspaces/{graphspace}/schematemplates — List all schema templates
  • GET /graphspaces/{graphspace}/schematemplates/{name} — Get a specific template
  • POST /graphspaces/{graphspace}/schematemplates — Create template
  • PUT /graphspaces/{graphspace}/schematemplates/{name} — Update template
  • DELETE /graphspaces/{graphspace}/schematemplates/{name} — Delete template

5. Authentication & Authorization Layer (AuthManager.java, StandardAuthManager.java, StandardAuthManagerV2.java, HugeGraphAuthProxy.java)

  • Added 10 new methods to AuthManager interface: setDefaultGraph/unsetDefaultGraph/getDefaultGraph and createDefaultRole/createSpaceDefaultRole/isDefaultRole/deleteDefaultRole, etc.
  • StandardAuthManager and StandardAuthManagerV2 implement the above interfaces using existing HugeGroup/HugeBelong/HugeRole metadata mechanisms
  • HugeGraphAuthProxy.AuthManagerProxy adds corresponding delegate methods to properly forward calls to the underlying authManager

6. Utilities (ConfigUtil.java, GraphManager.java)

  • ConfigUtil.writeConfigToString() — New utility method to serialize graph configuration to string (used by the listProfile endpoint)
  • GraphManager — Added graph management helper methods

Verifying these changes

  • Need tests and can be verified as follows:
    • Verify the full graph management flow via Hubble frontend (create graph, list, profile query)
    • Verify default graph set/unset/query via Hubble frontend
    • Verify Schema template CRUD operations
    • Verify default role (SPACE/ANALYST/OBSERVER) creation, query, and deletion
    • Directly test all new endpoints via REST API

Does this PR potentially affect the following parts?

  • Dependencies (add/update license info & regenerate_known_dependencies.sh)
  • Modify configurations
  • The public API
  • Other affects (typed here)
  • Nope

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

Yeaury added 5 commits April 24, 2026 10:53
- Add listProfile endpoint with default graph sorting and prefix filtering
- Add setDefault/unsetDefault/getDefault endpoints for default graph management
- Add manage(PUT) endpoint for graph nickname update
- Add createByForm for form-urlencoded graph creation compatibility
- Auto-fill HStore/PD defaults (backend/serializer/store) during graph creation
- Add setDefaultRole/checkDefaultRole/deleteDefaultRole in GraphSpaceAPI
- Add checkDefaultRole endpoint in ManagerAPI
- Add default role interfaces in AuthManager
- Implement default role CRUD in StandardAuthManager and StandardAuthManagerV2
- Add stub proxy methods in HugeGraphAuthProxy
- Add new SchemaTemplateAPI with list/get/create/update/delete operations
- Fix package path from api.profile to api.space
- Use HugeGraphAuthProxy.username() instead of authManager.username()
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