apache / apache/hugegraph

[Bug] 创建带`versions`结尾的图名,会报鉴权失败错误

Open
#2,176 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

other exception / error (其他异常报错)

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

### Environment (环境信息)

- Server Version: 0.12.0(Apache Release Version)

### Expected & Actual behavior (期望与实际表现)

经过源码分析发现,在 `hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AuthenticationFilter.java`当中设置的WHITE_API_LIST
进行过滤时是使用的`path.endsWith(whiteApi)`方法,这会导致以`versions`结尾的请求都会被过滤,抛出鉴权错误

![图片](https://user-images.githubusercontent.com/40155703/227080506-ced890d0-366a-4829-b71b-b4a8f7d17a97.png)

### Vertex/Edge example (问题点 / 边数据举例)

_No response_

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.