imbajin opened a new pull request, #3366:
URL: https://github.com/apache/hugegraph/pull/3366

   ## Purpose of the PR
   
   With Server authentication disabled, both Cypher GET and POST requests still 
returned 401 unless an Authorization header was supplied. This also prevented 
Hubble from executing Cypher in anonymous mode. Cypher now follows the Server 
authentication switch and connects to Gremlin without credentials when 
authentication is disabled.
   
   ## Main Changes
   
   - Use GraphManager authentication mode for both Cypher resource methods.
   - Add an anonymous Cypher client that clears credentials from a cloned 
driver configuration, so a deployment service account is never inherited.
   - Keep the existing Basic/Bearer path when authentication is enabled, and 
document the connection behavior.
   
   ## Verifying these changes
   
   - [ ] Trivial rework / code cleanup without any test coverage. (No Need)
   - [ ] Already covered by existing tests.
   - [x] Need tests and can be verified as follows:
     - Focused Cypher client tests cover anonymous configuration isolation and 
authenticated header handling.
     - API module clean compilation and formatter checks; compilation targets 
Java 17 using a local JDK 21, with the Java-version enforcer skipped.
     - Real Server HTTP GET/POST requests with authentication disabled return 
query results without login or credentials. With authentication enabled on both 
REST and Gremlin, missing/invalid credentials are rejected, valid Basic/Bearer 
queries succeed, and a restricted reader cannot read another graph or write 
data.
     - An anonymous Hubble instance generates Cypher through a local model 
fixture and executes it against the fixed Server; edited write queries are 
rejected by Hubble.
   
   ## Does this PR potentially affect the following parts?
   
   - [ ] Dependencies
   - [ ] Modify configurations
   - [x] The public API
   - [ ] Other affects
   - [ ] Nope
   
   ## Documentation Status
   
   - [ ] `Doc - TODO`: required documentation is pending.
   - [x] `Doc - Done`: documentation is included here.
   - [ ] `Doc - No Need`: no user-visible documentation is affected.
   
   Documentation: `docs/cypher-api.md`, Authentication section.
   
   Related Hubble integration: 
https://github.com/hugegraph/hugegraph-toolchain/pull/75 and 
https://github.com/apache/hugegraph-toolchain/pull/824.
   
   Org counterpart: https://github.com/hugegraph/hugegraph/pull/321.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to