Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix delete/read without READ permission throw 'no such id' #1134

Merged
merged 6 commits into from
Aug 7, 2020

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Aug 6, 2020

  • fix delete/read without READ permission throw 'no such id'
    this patch define delete/update requires read permission, an ForbiddenException
    is thrown when there is no read permission instead 'No such vertex with id: xx'.
  • fix rest api depend on gremlin permission, updated to not depend on gremlin.
  • fix expired time is inaccurate due to call now() before tx open()
  • refactor edgesOfVertex() to unified entrance with EdgeStep

Change-Id: I0d8cfd3d4b7d8ccaf10721249f8d9f86b53b442e
fix: hugegraph-test-811, hugegraph-test-837, hugegraph-test-846

this patch define delete/update requires read permission, an ForbiddenException
is thrown when there is no read permission instead 'No such vertex with id: xx'.

also fix rest api depend on gremlin permission, updated to not depend on gremlin.

Change-Id: I0d8cfd3d4b7d8ccaf10721249f8d9f86b53b442e
Change-Id: Ia30ff97b073bd2b15599cc4e1cbac5ed7b651063
Change-Id: I1adf25c68bd0eb2157b17fd9466171ec9e237de7
Change-Id: I08f536b75228c44a1af1c588336df9a1ceea8406
Change-Id: If55f532fb2c08b664e3ea816832741096fb767c4
* 2.oltp rest api (like crosspointpath/neighborrank)
* 3.olap rest api (like centrality/lpa/louvain/subgraph)
*/
String caller = Thread.currentThread().getName();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

olap task may run not in grizzly-http-server thread

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes olap may run in task worker or olap thread, but currently we can't distinguish gremlin job and olap job

@@ -467,6 +462,11 @@ public void removeEdge(Edge edge) {
this.graphTransaction().removeEdgeProperty((HugeEdgeProperty<V>) p);
}

@Override
public Vertex vertex(Object objects) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object

@@ -490,6 +490,11 @@ public boolean checkAdjacentVertexExist() {
return this.graphTransaction().checkAdjacentVertexExist();
}

@Override
public Edge edge(Object objects) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Change-Id: I303482a631e25834f7e56d2d44248f9097eec778
@codecov
Copy link

codecov bot commented Aug 7, 2020

Codecov Report

Merging #1134 into master will decrease coverage by 0.19%.
The diff coverage is 33.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1134      +/-   ##
============================================
- Coverage     65.85%   65.66%   -0.20%     
+ Complexity     5653     5627      -26     
============================================
  Files           354      354              
  Lines         28840    28847       +7     
  Branches       4064     4053      -11     
============================================
- Hits          18994    18941      -53     
- Misses         7966     8014      +48     
- Partials       1880     1892      +12     
Impacted Files Coverage Δ Complexity Δ
...api/src/main/java/com/baidu/hugegraph/api/API.java 69.04% <ø> (+3.49%) 0.00 <0.00> (ø)
...a/com/baidu/hugegraph/api/traversers/CountAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...graph/api/traversers/CustomizedCrosspointsAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...u/hugegraph/api/traversers/CustomizedPathsAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...aidu/hugegraph/api/traversers/NeighborRankAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...baidu/hugegraph/api/traversers/SourceVertices.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java 4.12% <0.00%> (-0.07%) 0.00 <0.00> (ø)
...e/src/main/java/com/baidu/hugegraph/HugeGraph.java 65.30% <ø> (ø) 9.00 <0.00> (ø)
...ugegraph/backend/store/BackendStoreSystemInfo.java 75.60% <0.00%> (ø) 9.00 <2.00> (ø)
...aidu/hugegraph/backend/tx/AbstractTransaction.java 76.00% <ø> (ø) 53.00 <0.00> (ø)
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32adab5...8c9872c. Read the comment docs.

@javeme javeme merged commit 92617ca into master Aug 7, 2020
@javeme javeme deleted the auth-fix-delete-need-read-perm branch August 7, 2020 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants