Skip to content

Commit 7e7b96a

Browse files
fix(client): authAPIs to remove the "graph" path
1 parent f901c17 commit 7e7b96a

File tree

10 files changed

+23
-17
lines changed

10 files changed

+23
-17
lines changed

hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/AuthAPI.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
public abstract class AuthAPI extends API {
2525

2626
private static final String PATH = "graphspaces/%s/auth/%s";
27+
private static final String USER_PATH = "auth/%s";
28+
29+
public AuthAPI(RestClient client) {
30+
super(client);
31+
this.path(USER_PATH, this.type());
32+
}
2733

2834
public AuthAPI(RestClient client, String graphSpace) {
2935
super(client);

hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/GroupAPI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
public class GroupAPI extends AuthAPI {
3131

32-
public GroupAPI(RestClient client, String graphSpace) {
33-
super(client, graphSpace);
32+
public GroupAPI(RestClient client) {
33+
super(client);
3434
}
3535

3636
@Override

hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/LoginAPI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
public class LoginAPI extends AuthAPI {
2727

28-
public LoginAPI(RestClient client, String graphSpace) {
29-
super(client, graphSpace);
28+
public LoginAPI(RestClient client) {
29+
super(client);
3030
}
3131

3232
@Override

hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/LogoutAPI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
public class LogoutAPI extends AuthAPI {
2626

27-
public LogoutAPI(RestClient client, String graphSpace) {
28-
super(client, graphSpace);
27+
public LogoutAPI(RestClient client) {
28+
super(client);
2929
}
3030

3131
@Override

hugegraph-client/src/main/java/org/apache/hugegraph/driver/AuthManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ public class AuthManager {
6161

6262
public AuthManager(RestClient client, String graphSpace, String graph) {
6363
this.targetAPI = new TargetAPI(client, graphSpace);
64-
this.groupAPI = new GroupAPI(client, graphSpace);
64+
this.groupAPI = new GroupAPI(client);
6565
this.userAPI = new UserAPI(client, graphSpace);
6666
this.accessAPI = new AccessAPI(client, graphSpace);
67-
this.belongAPI = new BelongAPI(client, graphSpace);
6867
this.projectAPI = new ProjectAPI(client, graphSpace);
69-
this.loginAPI = new LoginAPI(client, graphSpace);
70-
this.logoutAPI = new LogoutAPI(client, graphSpace);
68+
this.belongAPI = new BelongAPI(client, graphSpace);
69+
this.loginAPI = new LoginAPI(client);
70+
this.logoutAPI = new LogoutAPI(client);
7171
this.tokenAPI = new TokenAPI(client, graphSpace);
7272
this.managerAPI = new ManagerAPI(client, graphSpace);
7373
}

hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/GroupApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class GroupApiTest extends AuthApiTest {
3434

3535
@BeforeClass
3636
public static void init() {
37-
api = new GroupAPI(initClient(), GRAPHSPACE);
37+
api = new GroupAPI(initClient());
3838
}
3939

4040
@AfterClass

hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/LoginApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class LoginApiTest extends AuthApiTest {
3535

3636
@BeforeClass
3737
public static void init() {
38-
loginAPI = new LoginAPI(initClient(), GRAPHSPACE);
38+
loginAPI = new LoginAPI(initClient());
3939
userAPI = new UserAPI(initClient(), GRAPHSPACE);
4040
}
4141

hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/LogoutApiTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public class LogoutApiTest extends AuthApiTest {
3838

3939
@BeforeClass
4040
public static void init() {
41-
logoutAPI = new LogoutAPI(initClient(), GRAPHSPACE);
42-
loginAPI = new LoginAPI(initClient(), GRAPHSPACE);
41+
logoutAPI = new LogoutAPI(initClient());
42+
loginAPI = new LoginAPI(initClient());
4343
userAPI = new UserAPI(initClient(), GRAPHSPACE);
4444
}
4545

hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/TokenApiTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public class TokenApiTest extends AuthApiTest {
4141
@BeforeClass
4242
public static void init() {
4343
tokenAPI = new TokenAPI(initClient(), GRAPHSPACE);
44-
logoutAPI = new LogoutAPI(initClient(), GRAPHSPACE);
45-
loginAPI = new LoginAPI(initClient(), GRAPHSPACE);
44+
logoutAPI = new LogoutAPI(initClient());
45+
loginAPI = new LoginAPI(initClient());
4646
userAPI = new UserAPI(initClient(), GRAPHSPACE);
4747
}
4848

hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class HugeClientHttpsTest extends BaseFuncTest {
5050

5151
@Before
5252
public void initBaseFuncTest() {
53-
CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "hugegraph.truststore", TRUST_STORE_PATH);
53+
5454
}
5555

5656
@After

0 commit comments

Comments
 (0)