Skip to content

Commit

Permalink
doc: added cypher api (apache#280)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: imbajin <[email protected]>
  • Loading branch information
lynnbond and imbajin committed Jul 31, 2023
1 parent 59f96c0 commit 18547af
Show file tree
Hide file tree
Showing 10 changed files with 310 additions and 72 deletions.
1 change: 1 addition & 0 deletions content/cn/docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* [Graphs](clients/restful-api/graphs.md)
* [Task](clients/restful-api/task.md)
* [Gremlin](clients/restful-api/gremlin.md)
* [Cypher](clients/restful-api/cypher.md)
* [Authentication](clients/restful-api/auth.md)
* [Other](clients/restful-api/other.md)
* [Java Client](clients/hugegraph-client.md)
Expand Down
2 changes: 2 additions & 0 deletions content/cn/docs/clients/restful-api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ HugeGraph-Server通过HugeGraph-API基于HTTP协议为Client提供操作图的

[comment]: <> (- [Gremlin]&#40;restful-api/gremlin.md&#41;)

[comment]: <> (- [Cypher]&#40;restful-api/cypher.md&#41;)

[comment]: <> (- [Authentication]&#40;restful-api/auth.md&#41;)

[comment]: <> (- [Other]&#40;restful-api/other.md&#41;)
66 changes: 33 additions & 33 deletions content/cn/docs/clients/restful-api/auth.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Authentication API"
linkTitle: "Authentication"
weight: 15
weight: 16
---

### 9.1 用户认证与权限控制
### 10.1 用户认证与权限控制

> 开启权限及相关配置请先参考 [权限配置](/docs/config/config-authentication/) 文档
Expand All @@ -23,10 +23,10 @@ city: Beijing})
##### 接口说明:
用户认证与权限控制接口包括5类:UserAPI、GroupAPI、TargetAPI、BelongAPI、AccessAPI。

### 9.2 用户(User)API
### 10.2 用户(User)API
用户接口包括:创建用户,删除用户,修改用户,和查询用户相关信息接口。

#### 9.2.1 创建用户
#### 10.2.1 创建用户

##### Params

Expand Down Expand Up @@ -76,7 +76,7 @@ POST https://localhost:8080/graphs/hugegraph/auth/users
}
```

#### 9.2.2 删除用户
#### 10.2.2 删除用户

##### Params

Expand All @@ -101,7 +101,7 @@ DELETE https://localhost:8080/graphs/hugegraph/auth/users/-63:test
1
```

#### 9.2.3 修改用户
#### 10.2.3 修改用户

##### Params

Expand Down Expand Up @@ -143,7 +143,7 @@ PUT https://localhost:8080/graphs/hugegraph/auth/users/-63:test
}
```

#### 9.2.4 查询用户列表
#### 10.2.4 查询用户列表

##### Params

Expand Down Expand Up @@ -179,7 +179,7 @@ GET https://localhost:8080/graphs/hugegraph/auth/users
}
```

#### 9.2.5 查询某个用户
#### 10.2.5 查询某个用户

##### Params

Expand Down Expand Up @@ -214,7 +214,7 @@ GET https://localhost:8080/graphs/hugegraph/auth/users/-63:admin
}
```

#### 9.2.6 查询某个用户的角色
#### 10.2.6 查询某个用户的角色

##### Method & Url

Expand Down Expand Up @@ -246,11 +246,11 @@ GET https://localhost:8080/graphs/hugegraph/auth/users/-63:boss/role
}
```

### 9.3 用户组(Group)API
### 10.3 用户组(Group)API
用户组会赋予相应的资源权限,用户会被分配不同的用户组,即可拥有不同的资源权限。
用户组接口包括:创建用户组,删除用户组,修改用户组,和查询用户组相关信息接口。

#### 9.3.1 创建用户组
#### 10.3.1 创建用户组

##### Params

Expand Down Expand Up @@ -292,7 +292,7 @@ POST https://localhost:8080/graphs/hugegraph/auth/groups
}
```

#### 9.3.2 删除用户组
#### 10.3.2 删除用户组

##### Params

Expand All @@ -317,7 +317,7 @@ DELETE https://localhost:8080/graphs/hugegraph/auth/groups/-69:grant
1
```

#### 9.3.3 修改用户组
#### 10.3.3 修改用户组

##### Params

Expand Down Expand Up @@ -357,7 +357,7 @@ PUT https://localhost:8080/graphs/hugegraph/auth/groups/-69:grant
}
```

#### 9.3.4 查询用户组列表
#### 10.3.4 查询用户组列表

##### Params

Expand Down Expand Up @@ -392,7 +392,7 @@ GET https://localhost:8080/graphs/hugegraph/auth/groups
}
```

#### 9.3.5 查询某个用户组
#### 10.3.5 查询某个用户组

##### Params

Expand Down Expand Up @@ -423,12 +423,12 @@ GET https://localhost:8080/graphs/hugegraph/auth/groups/-69:all
}
```

### 9.4 资源(Target)API
### 10.4 资源(Target)API
资源描述了图数据库中的数据,比如符合某一类条件的顶点,每一个资源包括type、label、properties三个要素,共有18种type、
任意label、任意properties的组合形成的资源,一个资源的内部条件是且关系,多个资源之间的条件是或关系。
资源接口包括:资源的创建、删除、修改和查询。

#### 9.4.1 创建资源
#### 10.4.1 创建资源

##### Params
- target_name: 资源名称
Expand Down Expand Up @@ -494,7 +494,7 @@ POST https://localhost:8080/graphs/hugegraph/auth/targets
}
```

#### 9.4.2 删除资源
#### 10.4.2 删除资源

##### Params

Expand All @@ -519,7 +519,7 @@ DELETE https://localhost:8080/graphs/hugegraph/auth/targets/-77:gremlin
1
```

#### 9.4.3 修改资源
#### 10.4.3 修改资源

##### Params

Expand Down Expand Up @@ -574,7 +574,7 @@ PUT https://localhost:8080/graphs/hugegraph/auth/targets/-77:gremlin
}
```

#### 9.4.4 查询资源列表
#### 10.4.4 查询资源列表

##### Params

Expand Down Expand Up @@ -633,7 +633,7 @@ GET https://localhost:8080/graphs/hugegraph/auth/targets
}
```

#### 9.4.5 查询某个资源
#### 10.4.5 查询某个资源

##### Params

Expand Down Expand Up @@ -672,11 +672,11 @@ GET https://localhost:8080/graphs/hugegraph/auth/targets/-77:grant
}
```

### 9.5 关联角色(Belong)API
### 10.5 关联角色(Belong)API
关联用户和用户组的关系,一个用户可以关联一个或者多个用户组。用户组拥有相关资源的权限,不同用户组的资源权限可以理解为不同的角色。即给用户关联角色。
关联角色接口包括:用户关联角色的创建、删除、修改和查询。

#### 9.5.1 创建用户的关联角色
#### 10.5.1 创建用户的关联角色

##### Params

Expand Down Expand Up @@ -719,7 +719,7 @@ POST https://localhost:8080/graphs/hugegraph/auth/belongs
}
```

#### 9.5.2 删除关联角色
#### 10.5.2 删除关联角色

##### Params

Expand All @@ -743,7 +743,7 @@ DELETE https://localhost:8080/graphs/hugegraph/auth/belongs/S-63:boss>-82>>S-69:g
1
```

#### 9.5.3 修改关联角色
#### 10.5.3 修改关联角色
关联角色只能修改描述,不能修改 user 和 group 属性,如果需要修改关联角色,需要删除原来关联关系,新增关联角色。

##### Params
Expand Down Expand Up @@ -784,7 +784,7 @@ PUT https://localhost:8080/graphs/hugegraph/auth/belongs/S-63:boss>-82>>S-69:gran
}
```

#### 9.5.4 查询关联角色列表
#### 10.5.4 查询关联角色列表

##### Params

Expand Down Expand Up @@ -820,7 +820,7 @@ GET https://localhost:8080/graphs/hugegraph/auth/belongs
}
```

#### 9.5.5 查看某个关联角色
#### 10.5.5 查看某个关联角色

##### Params

Expand Down Expand Up @@ -851,11 +851,11 @@ GET https://localhost:8080/graphs/hugegraph/auth/belongs/S-63:boss>-82>>S-69:all
}
```

### 9.6 赋权(Access)API
### 10.6 赋权(Access)API
给用户组赋予资源的权限,主要包含:读操作(READ)、写操作(WRITE)、删除操作(DELETE)、执行操作(EXECUTE)等。
赋权接口包括:赋权的创建、删除、修改和查询。

#### 9.6.1 创建赋权(用户组赋予资源的权限)
#### 10.6.1 创建赋权(用户组赋予资源的权限)

##### Params

Expand Down Expand Up @@ -906,7 +906,7 @@ POST https://localhost:8080/graphs/hugegraph/auth/accesses
}
```

#### 9.6.2 删除赋权
#### 10.6.2 删除赋权

##### Params

Expand All @@ -931,7 +931,7 @@ DELETE https://localhost:8080/graphs/hugegraph/auth/accesses/S-69:all>-88>12>S-77
1
```

#### 9.6.3 修改赋权
#### 10.6.3 修改赋权
赋权只能修改描述,不能修改用户组、资源和权限许可,如果需要修改赋权的关系,可以删除原来的赋权关系,新增赋权。

##### Params
Expand Down Expand Up @@ -973,7 +973,7 @@ PUT https://localhost:8080/graphs/hugegraph/auth/accesses/S-69:all>-88>12>S-77:al
}
```

#### 9.6.4 查询赋权列表
#### 10.6.4 查询赋权列表

##### Params

Expand Down Expand Up @@ -1009,7 +1009,7 @@ GET https://localhost:8080/graphs/hugegraph/auth/accesses
}
```

#### 9.6.5 查询某个赋权
#### 10.6.5 查询某个赋权

##### Params

Expand Down
Loading

0 comments on commit 18547af

Please sign in to comment.