bitflicker64 commented on code in PR #3366:
URL: https://github.com/apache/hugegraph/pull/3366#discussion_r4301465283
##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/cypher/CypherAPI.java:
##########
@@ -176,10 +179,14 @@ private CypherModel queryByCypher(HttpHeaders headers,
String graphspace,
aliases.put("graph", graphInfo);
aliases.put("g", "__g_" + graphInfo);
- return this.client(headers).submitQuery(cypher, aliases, parameters);
+ return this.client(manager, headers).submitQuery(cypher, aliases,
parameters);
}
- private CypherClient client(HttpHeaders headers) {
+ private CypherClient client(GraphManager manager, HttpHeaders headers) {
+ if (!manager.requireAuthentication()) {
Review Comment:
Minor: When REST auth is off, this returns the anonymous client before
reading the Authorization header, so caller credentials are no longer forwarded
to Gremlin. GremlinAPI still forwards the header in the same mode
(GremlinAPI.java:67 and :81).
Setup: rest-server.properties has no auth.authenticator, while
gremlin-server.yaml has the StandardAuthenticator block. Before this PR, Cypher
with a valid Basic header worked there. Now the header is ignored, the Gremlin
handshake sends no credentials and the query fails, while Gremlin GET/POST with
the same header still works. No shipped script produces this setup, so this is
not blocking.
Please use the anonymous client only when no Authorization header is sent,
or state in docs/cypher-api.md that this mixed setup is unsupported.
--
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]