Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e0efcd1
fix(client): fixed wrong ref for AuthAPI && update commit_id
sadwitdastreetz Nov 2, 2025
cac0108
fix(client): fixed wrong ref for AuthAPI && update commit_id
sadwitdastreetz Nov 2, 2025
587b1d2
fix(client): wtf with this authAPI?
sadwitdastreetz Nov 2, 2025
c3252ac
666
sadwitdastreetz Nov 2, 2025
91c4c4d
fix deserialize problem (not sure yet)
sadwitdastreetz Nov 3, 2025
29cc636
fix: refactor code style and update CI commit ID
imbajin Nov 3, 2025
9355d6a
Merge branch 'master' into fix-bug
sadwitdastreetz Nov 3, 2025
0f54303
revert Target.java
sadwitdastreetz Nov 3, 2025
b6b7be7
Merge remote-tracking branch 'origin/fix-bug' into fix-bug
sadwitdastreetz Nov 3, 2025
7d8faf9
fix: remove graphSpace field from Belong class
imbajin Nov 3, 2025
e5e826c
fix: refactor Target resource handling for server compatibility (FIXME)
imbajin Nov 3, 2025
c4e4490
fix: set graphSpace and link fields to read-only in auth models
imbajin Nov 3, 2025
e96ba68
fix: refactor async task test for vertex insertion
imbajin Nov 3, 2025
bcb6bbd
fix: improve test reliability and server initialization handling
imbajin Nov 3, 2025
e068801
fix: refactor test cleanup logic and improve resilience
imbajin Nov 3, 2025
f190261
fix: disable failing graph tests due to server issue
imbajin Nov 3, 2025
7d36688
fix: update user role structure and related tests
imbajin Nov 3, 2025
7bd446d
fix: add authentication for spark-connector tests
sadwitdastreetz Nov 3, 2025
b850c73
fix: remove graphSpace setting for spark-connector tests
sadwitdastreetz Nov 3, 2025
128b855
fix: get authentication for spark-connector tests
sadwitdastreetz Nov 3, 2025
c19dddd
fix: test scala for spark-connector tests
sadwitdastreetz Nov 3, 2025
df476c8
fix: add auth in client https test
sadwitdastreetz Nov 3, 2025
b6e10e8
fix scala?
sadwitdastreetz Nov 3, 2025
d1e9ab0
fix scala?
sadwitdastreetz Nov 3, 2025
030df03
fix client install sh
sadwitdastreetz Nov 3, 2025
ca58c5c
fix(client): authAPIs to remove the "graph" path
sadwitdastreetz Nov 4, 2025
44b235c
fix(client): authAPIs to remove the "graph" path
sadwitdastreetz Nov 4, 2025
f901c17
fix(client): authAPIs to remove the "graph" path
sadwitdastreetz Nov 4, 2025
7e7b96a
fix(client): authAPIs to remove the "graph" path
sadwitdastreetz Nov 4, 2025
ff59498
we back
sadwitdastreetz Nov 4, 2025
83c60ff
fix(client):add ignore to one test
sadwitdastreetz Nov 4, 2025
d5a0f5b
fix(client):fix missing part of https test
sadwitdastreetz Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/client-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-client/assembly/travis
# TODO: replace it with the (latest - n) commit id (n >= 15)
# hugegraph commit date: 2025-05-05
COMMIT_ID: 8c1ee71
# hugegraph commit date: 2025-11-4
COMMIT_ID: b7998c1
strategy:
fail-fast: false
matrix:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/client-go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-client/assembly/travis
# TODO: replace it with the (latest - n) commit id (n >= 15)
# hugegraph commit date: 2024-12-09
COMMIT_ID: f838897
# FIXME: hugegraph commit date: 2025-10-30
COMMIT_ID: 8c1ee71 # 5b3d295
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:

- name: Init Go env
uses: actions/setup-go@v2.1.3
with: { go-version: '1.x' }
with: {go-version: '1.x'}

- name: Go test
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hubble-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ on:
env:
TRAVIS_DIR: hugegraph-hubble/hubble-dist/assembly/travis
# TODO: replace it with the (latest - n) commit id (n >= 15)
# hugegraph commit date: 2024-12-09
COMMIT_ID: f838897
# FIXME: hugegraph commit date: 2025-10-30
COMMIT_ID: 8c1ee71 # 5b3d295

jobs:
hubble-ci:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spark-connector-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
env:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-spark-connector/assembly/travis
# hugegraph commit date: 2024-12-09
COMMIT_ID: f838897
# hugegraph commit date: 2025-10-30
COMMIT_ID: 5b3d295
strategy:
matrix:
JAVA_VERSION: [ '11' ]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tools-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
TRAVIS_DIR: hugegraph-tools/assembly/travis
# TODO: could we use one param to unify it? or use a action template (could use one ci file)
# TODO: replace it with the (latest - n) commit id (n >= 15)
COMMIT_ID: 29ecc0
# hugegraph commit date: 2025-11-4
COMMIT_ID: b7998c1
strategy:
matrix:
JAVA_VERSION: [ '11' ]
Expand Down
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,27 @@ Thumbs.db
# client-go
go.env

# AI-IDE prompt files (We only keep AGENTS.md, other files could soft-linked it when needed)
# Claude Projects
CLAUDE.md
CLAUDE_*.md
# Gemini/Google
GEMINI.md
# GitHub Copilot / Microsoft
copilot-instructions.md
.copilot-instructions.md
# Cursor IDE
cursor-instructions.md
.cursor-instructions.md
cursor.md
# Windsurf/Codeium
windsurf.md
windsurf-instructions.md
codeium.md
codeium-instructions.md
# Other AI coding assistants
.ai-instructions.md
*.ai-prompt.md
WARP.md


44 changes: 23 additions & 21 deletions hugegraph-client/assembly/travis/install-hugegraph-from-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,45 @@ fi

COMMIT_ID=$1
HUGEGRAPH_GIT_URL="https://github.com/apache/hugegraph.git"
GIT_DIR=hugegraph

# download code and compile
git clone --depth 150 ${HUGEGRAPH_GIT_URL} $GIT_DIR
cd "${GIT_DIR}"
git clone --depth 150 ${HUGEGRAPH_GIT_URL} hugegraph
cd hugegraph
git checkout "${COMMIT_ID}"
mvn package -DskipTests -Dmaven.javadoc.skip=true -ntp

# TODO: lack incubator after apache package release (update it later)
cd hugegraph-server
TAR=$(echo apache-hugegraph-*.tar.gz)
tar zxf "${TAR}" -C ../../
mv apache-hugegraph-*.tar.gz ../../
cd ../../
rm -rf "${GIT_DIR}"
# TODO: lack incubator after apache package release (update it later)
HTTP_SERVER_DIR=$(echo apache-hugegraph-*.*)
HTTPS_SERVER_DIR="hugegraph_https"

cp -r "${HTTP_SERVER_DIR}" "${HTTPS_SERVER_DIR}"

# config auth options just for http server (must keep '/.')
cp -rf "${TRAVIS_DIR}"/conf/. "${HTTP_SERVER_DIR}"/conf/
rm -rf hugegraph
tar zxf apache-hugegraph-*.tar.gz

HTTPS_SERVER_DIR="hugegraph_https"
mkdir ${HTTPS_SERVER_DIR}
# TODO: lack incubator after apache package release (update it later)
cp -r apache-hugegraph-*/. ${HTTPS_SERVER_DIR}
cd "$(find apache-hugegraph-* | head -1)"
# start HugeGraphServer with http protocol
cd "${HTTP_SERVER_DIR}"
sed -i 's|gremlin.graph=org.apache.hugegraph.HugeFactory|gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy|' conf/graphs/hugegraph.properties
sed -i 's|#auth.authenticator=.*|auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator|' conf/rest-server.properties
sed -i 's|#auth.admin_pa=.*|auth.admin_pa=pa|' conf/rest-server.properties
echo -e "pa" | bin/init-store.sh || exit 1
bin/start-hugegraph.sh || exit 1

# config options for https server
cd ../"${HTTPS_SERVER_DIR}"
# Wait for server to initialize
echo "Waiting 5 seconds for HugeGraph server to initialize..."
sleep 5

cd ../${HTTPS_SERVER_DIR}
REST_SERVER_CONFIG="conf/rest-server.properties"
GREMLIN_SERVER_CONFIG="conf/gremlin-server.yaml"
sed -i "s?http://127.0.0.1:8080?https://127.0.0.1:8443?g" "$REST_SERVER_CONFIG"
sed -i "s/#port: 8182/port: 8282/g" "$GREMLIN_SERVER_CONFIG"
echo "gremlinserver.url=http://127.0.0.1:8282" >> ${REST_SERVER_CONFIG}

# start HugeGraphServer with https protocol
bin/init-store.sh
bin/start-hugegraph.sh || (cat logs/hugegraph-server.log && exit 1)
sed -i 's|gremlin.graph=org.apache.hugegraph.HugeFactory|gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy|' conf/graphs/hugegraph.properties
sed -i 's|#auth.authenticator=.*|auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator|' conf/rest-server.properties
sed -i 's|#auth.admin_pa=.*|auth.admin_pa=pa|' conf/rest-server.properties
echo -e "pa" | bin/init-store.sh || exit 1
bin/start-hugegraph.sh
cd ../
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

public class AccessAPI extends AuthAPI {

public AccessAPI(RestClient client, String graph) {
super(client, graph);
public AccessAPI(RestClient client, String graphSpace) {
super(client, graphSpace);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@

public abstract class AuthAPI extends API {

private static final String PATH = "graphs/%s/auth/%s";
private static final String PATH = "graphspaces/%s/auth/%s";
private static final String USER_PATH = "auth/%s";

public AuthAPI(RestClient client, String graph) {
public AuthAPI(RestClient client) {
super(client);
this.path(PATH, graph, this.type());
this.path(USER_PATH, this.type());
}

public AuthAPI(RestClient client, String graphSpace) {
super(client);
this.path(PATH, graphSpace, this.type());
}

public static String formatEntityId(Object id) {
Expand All @@ -40,11 +46,6 @@ public static String formatEntityId(Object id) {
}

public static String formatRelationId(Object id) {
if (id == null) {
return null;
} else if (id instanceof AuthElement) {
id = ((AuthElement) id).id();
}
return String.valueOf(id);
return formatEntityId(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

public class BelongAPI extends AuthAPI {

public BelongAPI(RestClient client, String graph) {
super(client, graph);
public BelongAPI(RestClient client, String graphSpace) {
super(client, graphSpace);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

public class GroupAPI extends AuthAPI {

public GroupAPI(RestClient client, String graph) {
super(client, graph);
public GroupAPI(RestClient client) {
super(client);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

public class LoginAPI extends AuthAPI {

public LoginAPI(RestClient client, String graph) {
super(client, graph);
public LoginAPI(RestClient client) {
super(client);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

public class LogoutAPI extends AuthAPI {

public LogoutAPI(RestClient client, String graph) {
super(client, graph);
public LogoutAPI(RestClient client) {
super(client);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

public class ManagerAPI extends AuthAPI {

public ManagerAPI(RestClient client, String graph) {
super(client, graph);
public ManagerAPI(RestClient client, String graphSpace) {
super(client, graphSpace);
}

public UserManager create(UserManager userManager) {
Expand Down Expand Up @@ -80,8 +80,7 @@ public boolean checkDefaultRole(String graphSpace, String role,
params.put("graph", graph);
}
RestResult result = this.client.get(path, params);
return (boolean) result.readObject(Map.class).getOrDefault("check",
false);
return (boolean) result.readObject(Map.class).getOrDefault("check", false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class ProjectAPI extends AuthAPI {
private static final String ACTION_ADD_GRAPH = "add_graph";
private static final String ACTION_REMOVE_GRAPH = "remove_graph";

public ProjectAPI(RestClient client, String graph) {
super(client, graph);
public ProjectAPI(RestClient client, String graphSpace) {
super(client, graphSpace);
}

@Override
Expand Down Expand Up @@ -75,8 +75,7 @@ public Project addGraphs(Object projectId, Set<String> graphs) {
RestResult result = this.client.put(this.path(),
formatEntityId(projectId),
project,
ImmutableMap.of("action",
ACTION_ADD_GRAPH));
ImmutableMap.of("action", ACTION_ADD_GRAPH));
return result.readObject(Project.class);
}

Expand All @@ -86,8 +85,7 @@ public Project removeGraphs(Object projectId, Set<String> graphs) {
RestResult result = this.client.put(this.path(),
formatEntityId(projectId),
project,
ImmutableMap.of("action",
ACTION_REMOVE_GRAPH));
ImmutableMap.of("action", ACTION_REMOVE_GRAPH));
return result.readObject(Project.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

public class TargetAPI extends AuthAPI {

public TargetAPI(RestClient client, String graph) {
super(client, graph);
public TargetAPI(RestClient client, String graphSpace) {
super(client, graphSpace);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

public class TokenAPI extends AuthAPI {

public TokenAPI(RestClient client, String graph) {
super(client, graph);
public TokenAPI(RestClient client) {
super(client);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

public class UserAPI extends AuthAPI {

public UserAPI(RestClient client, String graph) {
super(client, graph);
public UserAPI(RestClient client, String graphSpace) {
super(client, graphSpace);
}

@Override
Expand All @@ -44,13 +44,10 @@ public User create(User user) {
return result.readObject(User.class);
}

public Map<String, List<Map<String, String>>> createBatch(List<Map<String,
String>> data) {
public Map<String, List<Map<String, String>>> createBatch(List<Map<String, String>> data) {
String path = String.join("/", this.path(), "batch");
RestResult result = this.client.post(path, data);
Map<String, List<Map<String, String>>> resultList =
(Map<String, List<Map<String, String>>>) result.readObject(Map.class);
return resultList;
return (Map<String, List<Map<String, String>>>) result.readObject(Map.class);
}

public User get(Object id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Map<String, ElementCount> getEVCountByMonth(String monthStr) {

// convert json to Map<String, TypeCount>
Map<String, Object> elementCounts = resp.readObject(Map.class);
for(Map.Entry<String, Object> entry : elementCounts.entrySet()) {
for (Map.Entry<String, Object> entry : elementCounts.entrySet()) {
String strDate = entry.getKey();
Object elementCountMap = entry.getValue();
ElementCount elementCount =
Expand Down Expand Up @@ -138,7 +138,7 @@ public Map<String, TypeCount> getTypeCountByMonth(String monthStr) {

// convert json to Map<String, TypeCount>
Map<String, Object> typeCounts = resp.readObject(Map.class);
for(Map.Entry<String, Object> entry : typeCounts.entrySet()) {
for (Map.Entry<String, Object> entry : typeCounts.entrySet()) {
String strDate = entry.getKey();
Object typeCountMap = entry.getValue();
TypeCount typeCount =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.apache.hugegraph.api.kvstore;

import java.util.LinkedHashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.hugegraph.api.traverser;


import org.apache.hugegraph.api.graph.GraphAPI;
import org.apache.hugegraph.client.RestClient;
import org.apache.hugegraph.rest.RestResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.apache.hugegraph.api.traverser;

import org.apache.hugegraph.client.RestClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.util.Map;

import org.apache.hugegraph.driver.VersionManager;
import org.apache.hugegraph.exception.ServerException;
import org.apache.hugegraph.rest.AbstractRestClient;
import org.apache.hugegraph.rest.ClientException;
Expand Down
Loading
Loading