Skip to content

docs(auth): mark group paths as the GraphSpace-format exception - #500

Merged
imbajin merged 8 commits into
apache:masterfrom
Adarsh-Me:fix-3019-auth-groups-paths
Sep 26, 2026
Merged

imbajin merged 8 commits into
apache:masterfrom
Adarsh-Me:fix-3019-auth-groups-paths

Conversation

@Adarsh-Me

Copy link
Copy Markdown
Contributor

What

content/{en,cn}/docs/clients/restful-api/auth.md claim "1.7.0+: Auth API paths use GraphSpace format" and then document the group endpoints as /graphspaces/DEFAULT/auth/groups. That spelling is wrong for the group API on 1.7.0 — which is exactly what apache/hugegraph#3019 reports as a 404.

Verified against source, not folklore:

tag 1.7.0 master
UserAPI/TargetAPI/BelongAPI/AccessAPI/ManagerAPI/ProjectAPI @Path("graphspaces/{graphspace}/auth/…") same
GroupAPI @Path("/auth/groups") same
GraphSpaceGroupAPI file does not exist @Path("graphspaces/{graphspace}/auth/groups")

GraphSpaceGroupAPI arrived in apache/hugegraph#3096 (2026-07-21), and ApplicationConfig.java:72 mounts it via packages("org.apache.hugegraph.api"), so on master both spellings are live but on 1.7.0 only /auth/groups is. The page also already contradicts itself: quickstart/client/hugegraph-client-python.md says "groups stay at the server-level /auth/groups".

The change adds the exception to the version notice and a note at the head of the group section, in both languages. Group URLs themselves are left as-is, since this page documents the development version where the prefixed route does exist.

Checklist (from contribution.md)

  • Strict production build — not run here: no hugo installed, Go is 1.26 vs the pinned 1.27.0, and scripts/hugo.sh additionally needs Python, which this host does not have. CI is the build verification for this change.
  • content/en/ and content/cn/ both updated
  • No visual or navigation change, so no screenshots
  • Routes under /docs/... and /cn/docs/... unchanged (markdown content only)
  • Related issue linked

Question for maintainers

release-1.7.0 carries the same prefixed group URLs, and that branch is what the archived 1.7 version on the site serves — so a 1.7.0 user gets the wrong spelling from the version they are actually running. Want a backport of this note to release-1.7.0?

AI use

Authored with an AI assistant (Qoder); every claim above was read out of the referenced source files at the stated refs rather than inferred.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Update or clarify the group API examples to match GraphSpace-scoped IDs and behavior.

Review effort: Lite
Findings: None

What changed in this PR

This PR clarifies the version-specific group authentication paths in the English and Chinese REST API documentation.

Changes:

  • Documents /auth/groups as the HugeGraph 1.7.0 exception.
  • Adds GraphSpace API context to both language versions.
File Summary
content/​en/​docs/​clients/​restful-api/​auth.md Adds English routing clarification.
content/​cn/​docs/​clients/​restful-api/​auth.md Adds Chinese routing clarification.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: no. Summary: The versioned route distinction is correct, but the new 404 statement is unconditional and the later GraphSpace examples use legacy group IDs. Evidence: 1.7.0 AuthenticationFilter runs @PreMatching before route matching; GraphSpaceGroupAPI generates scoped group names.

Comment thread content/en/docs/clients/restful-api/auth.md Outdated
Comment thread content/en/docs/clients/restful-api/auth.md
Adarsh-Me added a commit to Adarsh-Me/hugegraph-doc that referenced this pull request Sep 25, 2026
imbajin's review on apache#500 flagged two things and both are right.

1. The notice said the prefixed group path "returns 404" on 1.7.0. That
   route is unregistered there, but 404 is not unconditional:
   AuthenticationFilter is @Provider @PreMatching @priority(AUTHENTICATION),
   so it runs before route matching. Inside authenticate() a missing
   Authorization header throws NotAuthorizedException (401) and an IP
   outside the white list throws ForbiddenException (403); only when
   manager.requireAuthentication() is false does the filter return
   User.ANONYMOUS and leave routing to produce 404. Same code at 1.7.0 and
   at master, so the notice now says unregistered and names the condition.

2. The GraphSpace group examples still carried 1.5.x ids. JsonGroup
   build(graphSpace) persists scopedPrefix(graphSpace) + a dashless UUID,
   where scopedPrefix is "~hubble_role:v1:" + base64url(graphspace) + ":",
   and StandardAuthManagerV2.createGroup assigns id =
   IdGenerator.of(group.name()). A DEFAULT-space group is therefore
   addressed as ~hubble_role:v1:REVGQVVMVA:<32 hex>, and the request's
   group_name is only a client label: build() ignores it while checkCreate()
   requires it non-null. The five group examples now use the generated id,
   and the PUT body drops group_name because build(HugeGroup) rejects any
   other value with "The name of group can't be updated". Mirrored in
   Chinese, as the guide requires.

Left alone deliberately: 10.5 and 10.6 embed the same legacy -69: group id
inside belong/access ids. That is a second pass over two more sections and
is worth its own change rather than being bundled here.

Verified from source through the contents API at ref 1.7.0 and master:
AuthenticationFilter.java, GraphSpaceGroupAPI.java, GroupAPI.java,
StandardAuthManagerV2.java (SCOPED_GROUP_PREFIX, scopedGroupPrefix,
isScopedGroup, createGroup) and HugeGroup.java. base64url("DEFAULT") =
REVGQVVMVA computed rather than guessed, and the example hex is 32 chars to
match isScopedGroup()'s [0-9a-f]{32}.

Executed locally, the one CI step that needs no hugo: python3 -m unittest
discover -s scripts -p 'test_*.py' = 166 tests with 8 failures + 14 errors,
identical failing-name sets at this commit and at pristine HEAD, so this
change is regression-neutral; those 22 are Windows path-separator asserts in
the suite, not this text. dist/validate-links.sh is not trustworthy on this
host (it flags 275 links, including ./auth from graphspace.md, as resolving
outside content/), so the diff was checked differently: it adds and removes
no markdown link syntax at all. Staged blobs re-checked at 0 CR bytes.

Not verified: no hugo build, no Java and no Docker on this host, so no
request was ever issued against a 1.7.0 or master server. The 401/403/404
ordering and the id shape are read from source, not observed.

Refs: apache/hugegraph#3019
@imbajin
imbajin requested a lite review from Copilot September 26, 2026 00:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Clarify authenticated 404 behavior and the GraphSpace group ID/name exceptions in both language versions.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)

Comment thread content/cn/docs/clients/restful-api/auth.md Outdated
Comment thread content/en/docs/clients/restful-api/auth.md Outdated
GroupAPI is mounted at /auth/groups on every version, and the
/graphspaces/{graphspace}/auth/groups form only exists from
apache/hugegraph#3096 onward, so on the 1.7.0 release the prefixed group
URL 404s while the page presents it as the 1.7.0+ spelling. Adds the
exception to the version notice and to the group section, in both
languages.

Refs: apache/hugegraph#3019
The previous note said GroupAPI is mounted at /auth/groups "in every
version". That is wrong and it contradicts the 1.5.x line directly above
it: at tags 1.2.0, 1.3.0 and 1.5.0 the class is @path("graphs/{graph}/auth/
groups"), i.e. prefixed with the graph name like the other auth APIs, and
the unprefixed /auth/groups only appears at 1.7.0. GraphSpaceGroupAPI.java
is absent at all of those refs, so no 1.5.x build serves the unprefixed
form either. A reader on 1.5.x sent to /auth/groups by this page would hit
a 404 - the same defect this PR exists to fix.

Verified from source at each ref via the contents API, not inference:
GroupAPI.java @path at 1.2.0/1.3.0/1.5.0 = graphs/{graph}/auth/groups,
at 1.7.0/master = /auth/groups; GraphSpaceGroupAPI.java only at master.
Tag 1.0.0 has no api/auth directory at that path, so the wording now names
1.5.x and 1.7.0 rather than generalising over every release.

Not verified: no hugo build here (no hugo, Go 1.26 vs pinned 1.27.0, and
scripts/hugo.sh needs python), so CI is the build check for this text.
imbajin's review on apache#500 flagged two things and both are right.

1. The notice said the prefixed group path "returns 404" on 1.7.0. That
   route is unregistered there, but 404 is not unconditional:
   AuthenticationFilter is @Provider @PreMatching @priority(AUTHENTICATION),
   so it runs before route matching. Inside authenticate() a missing
   Authorization header throws NotAuthorizedException (401) and an IP
   outside the white list throws ForbiddenException (403); only when
   manager.requireAuthentication() is false does the filter return
   User.ANONYMOUS and leave routing to produce 404. Same code at 1.7.0 and
   at master, so the notice now says unregistered and names the condition.

2. The GraphSpace group examples still carried 1.5.x ids. JsonGroup
   build(graphSpace) persists scopedPrefix(graphSpace) + a dashless UUID,
   where scopedPrefix is "~hubble_role:v1:" + base64url(graphspace) + ":",
   and StandardAuthManagerV2.createGroup assigns id =
   IdGenerator.of(group.name()). A DEFAULT-space group is therefore
   addressed as ~hubble_role:v1:REVGQVVMVA:<32 hex>, and the request's
   group_name is only a client label: build() ignores it while checkCreate()
   requires it non-null. The five group examples now use the generated id,
   and the PUT body drops group_name because build(HugeGroup) rejects any
   other value with "The name of group can't be updated". Mirrored in
   Chinese, as the guide requires.

Left alone deliberately: 10.5 and 10.6 embed the same legacy -69: group id
inside belong/access ids. That is a second pass over two more sections and
is worth its own change rather than being bundled here.

Verified from source through the contents API at ref 1.7.0 and master:
AuthenticationFilter.java, GraphSpaceGroupAPI.java, GroupAPI.java,
StandardAuthManagerV2.java (SCOPED_GROUP_PREFIX, scopedGroupPrefix,
isScopedGroup, createGroup) and HugeGroup.java. base64url("DEFAULT") =
REVGQVVMVA computed rather than guessed, and the example hex is 32 chars to
match isScopedGroup()'s [0-9a-f]{32}.

Executed locally, the one CI step that needs no hugo: python3 -m unittest
discover -s scripts -p 'test_*.py' = 166 tests with 8 failures + 14 errors,
identical failing-name sets at this commit and at pristine HEAD, so this
change is regression-neutral; those 22 are Windows path-separator asserts in
the suite, not this text. dist/validate-links.sh is not trustworthy on this
host (it flags 275 links, including ./auth from graphspace.md, as resolving
outside content/), so the diff was checked differently: it adds and removes
no markdown link syntax at all. Staged blobs re-checked at 0 CR bytes.

Not verified: no hugo build, no Java and no Docker on this host, so no
request was ever issued against a 1.7.0 or master server. The 401/403/404
ordering and the id shape are read from source, not observed.

Refs: apache/hugegraph#3019
@Adarsh-Me
Adarsh-Me force-pushed the fix-3019-auth-groups-paths branch from 817d347 to 210b911 Compare September 26, 2026 06:27
@Adarsh-Me

Copy link
Copy Markdown
Contributor Author

Rebased onto master — head 817d3476 → 210b911f. The six red builds were not this PR's content: Verify pinned OINK module resolves the workflow from master, which now calls scripts/update_oink.py, but checks out this branch, which predated #496. #494 fails the mirror-image way on oink_module.py. Scripts suite: 184 tests, same 23 host-only failures at both refs.

@Adarsh-Me

Copy link
Copy Markdown
Contributor Author

Correction on state, not on the diagnosis: the rebased head 210b911f has no check runs yet — GitHub Actions reports action_required, so the six Build jobs have not re-executed. Could a committer approve the run on the Checks tab? I am not claiming green; only that the base/head workflow-vs-tree mismatch is what made them red.

- Clarify version-specific group routes and 404 behavior.

- Use GraphSpace group, target, belong, and access IDs.

- URL-encode composite IDs in relationship paths.

- Keep English and Chinese examples aligned.
- Set the Markdown editor line limit to 120 characters.

- Reflow changed English and Chinese documentation lines.

- Use response-ID placeholders for long relationship paths.

- Record the Markdown line-length rule in AGENTS.md.
- Leave the repository Markdown line width unset.

- Set new prose guidance to 160 characters in AGENTS.md.

- Keep existing one-line paragraphs intact and tighten new notes.

- Use response-ID placeholders for generated relationship paths.
- Link release-specific behavior to the 1.7 site docs.

- Keep the current master versus 1.7 group routes clear.

- Remove outdated 1.5 path and ID descriptions.
- Link release-specific behavior to the published 1.7 docs.

- Explain master and 1.7 group routes in plain Chinese.

- Replace unsupported internal links to fix source validation.
@imbajin
imbajin merged commit a58906e into apache:master Sep 26, 2026
10 checks passed
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.

3 participants