feat(server): adapt Hubble 2.0 frontend APIs and implement default graph/role management#3008
Draft
Yeaury wants to merge 5 commits intoapache:masterfrom
Draft
feat(server): adapt Hubble 2.0 frontend APIs and implement default graph/role management#3008Yeaury wants to merge 5 commits intoapache:masterfrom
Yeaury wants to merge 5 commits intoapache:masterfrom
Conversation
- 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()
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.
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 defaultGET /graphspaces/{graphspace}/graphs/{name}/undefault— Unset a graph as defaultGET /graphspaces/{graphspace}/graphs/default— Get current user's default graph listPUT /graphspaces/{graphspace}/graphs/{name}— Graph management operations (currently supportsupdateaction for nickname updates)POST /graphspaces/{graphspace}/graphs(form-urlencoded) — Hubble frontend form-based graph creation compatibilitybackend=hstore,serializer=binary,store={name}) during graph creation, and map frontendschemafield toschema.init_template2. 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 roleDELETE /graphspaces/{graphspace}/role— Delete default rolelistProfileendpoint@JsonIgnoreProperties(ignoreUnknown = true)to tolerate unknown fields from the frontend3. ManagerAPI — Role Query (
ManagerAPI.java)GET /auth/manager/default— New endpoint for Hubble frontend to query if the current user has a specified default role4. SchemaTemplateAPI — Schema Template CRUD (New File)
GET /graphspaces/{graphspace}/schematemplates— List all schema templatesGET /graphspaces/{graphspace}/schematemplates/{name}— Get a specific templatePOST /graphspaces/{graphspace}/schematemplates— Create templatePUT /graphspaces/{graphspace}/schematemplates/{name}— Update templateDELETE /graphspaces/{graphspace}/schematemplates/{name}— Delete template5. Authentication & Authorization Layer (
AuthManager.java,StandardAuthManager.java,StandardAuthManagerV2.java,HugeGraphAuthProxy.java)AuthManagerinterface:setDefaultGraph/unsetDefaultGraph/getDefaultGraphandcreateDefaultRole/createSpaceDefaultRole/isDefaultRole/deleteDefaultRole, etc.StandardAuthManagerandStandardAuthManagerV2implement the above interfaces using existingHugeGroup/HugeBelong/HugeRolemetadata mechanismsHugeGraphAuthProxy.AuthManagerProxyadds corresponding delegate methods to properly forward calls to the underlying authManager6. 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 methodsVerifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need