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

implement users store and access control #749

Merged
merged 13 commits into from
Apr 23, 2020
Merged

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Nov 14, 2019

implement: #209
Change-Id: I6492c284b6677b9dd1ef545aaf08c5d6e5cf8ad7

@javeme
Copy link
Contributor Author

javeme commented Nov 14, 2019

rebased on v0.11 and close #704

@codecov
Copy link

codecov bot commented Nov 14, 2019

Codecov Report

Merging #749 into master will decrease coverage by 0.12%.
The diff coverage is 62.35%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #749      +/-   ##
============================================
- Coverage     71.77%   71.64%   -0.13%     
- Complexity     4676     4914     +238     
============================================
  Files           298      309      +11     
  Lines         22382    23485    +1103     
  Branches       3178     3305     +127     
============================================
+ Hits          16064    16826     +762     
- Misses         4736     5023     +287     
- Partials       1582     1636      +54     
Impacted Files Coverage Δ Complexity Δ
...n/java/com/baidu/hugegraph/api/graph/BatchAPI.java 26.98% <0.00%> (-0.44%) 0.00 <0.00> (ø)
...n/java/com/baidu/hugegraph/api/job/GremlinAPI.java 17.39% <0.00%> (ø) 0.00 <0.00> (ø)
.../hugegraph/api/traversers/AllShortestPathsAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...baidu/hugegraph/api/traversers/CrosspointsAPI.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> (ø)
...a/com/baidu/hugegraph/api/traversers/EdgesAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ugegraph/api/traversers/FusiformSimilarityAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...hugegraph/api/traversers/JaccardSimilarityAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...m/baidu/hugegraph/api/traversers/KneighborAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
... and 92 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 25bd36b...d8b8523. Read the comment docs.

@@ -117,6 +131,12 @@ public static String decompress(byte[] value) {
}
}

public static String sha256(String string) {
byte[] stringBytes = StringEncoding.encode(string);
Copy link
Contributor

Choose a reason for hiding this comment

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

byte[] stringBytes = encode(string);

}

public static <V> HugeAccess fromEdge(Edge edge) {
HugeAccess belong = new HugeAccess((Id) edge.outVertex().id(),
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to access

public static final String CREATE = "~belong_create";
public static final String UPDATE = "~belong_update";

public static String unhide(String key) {
Copy link
Contributor

Choose a reason for hiding this comment

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

unHide

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems there is unhide word

}

public static HugeGroup fromVertex(Vertex vertex) {
HugeGroup entity = new HugeGroup((Id) vertex.id());
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to group

}

public static HugeTarget fromVertex(Vertex vertex) {
HugeTarget entity = new HugeTarget((Id) vertex.id());
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

public class HugeUser extends Entity {

/*
* TODO: add vertex label: group and action (or group and graph)
Copy link
Contributor

Choose a reason for hiding this comment

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

delete

}

public static HugeUser fromVertex(Vertex vertex) {
HugeUser entity = new HugeUser((Id) vertex.id());
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

public static <T extends Relationship> T fromEdge(Edge edge,
T relationship) {
E.checkArgument(edge.label().equals(relationship.label()),
"Illegal edge label '%s' for entity '%s'",
Copy link
Contributor

Choose a reason for hiding this comment

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

"Illegal edge label '%s' for relationship '%s'",

byte[] stringBytes = encode(string);
DIGEST.reset();
return Base64.getEncoder().encodeToString(DIGEST.digest(stringBytes));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

BCrypt.hashpw(myPassword, BCrypt.gensalt(4))
BCrypt.checkpw(candidatePassword, dbPassword)

Change-Id: I6492c284b6677b9dd1ef545aaf08c5d6e5cf8ad7
implement: #209
Change-Id: Ia38bfd191b1ff15a6919f29dc5857272a696f222
Change-Id: I7f2ec3e318bbd29371bd907a8584ca11b0720ede
Change-Id: I92f992f98d52b2bfd4d1e316b9a00cb32c293288
Change-Id: I617f22fdd528baba05495f9d987f36b8a6771b9d
Change-Id: I34cccde13d35596ccccbaee65d037bd33a9d97e9
Change-Id: If6f4a3fafdc117b91e5d49b2ccae464f859971d9
Change-Id: Iaf63b2b06526448646a5fec021c1bca0f51f25f1
Change-Id: Ia8c9bb70ff4aad038818f93ef33fe26e86aedbf0
Change-Id: Ic0dbe13ad34f068b88a07ba5852671eb26c1b8be
@javeme javeme force-pushed the user-passwd-store-rebase-0.11 branch from 9d179cb to c757c40 Compare April 16, 2020 10:11
Change-Id: I48c19def8578f230c5da5a9446148d678aab408e
Change-Id: I2264497d31b15285da75abe42d091abaad66ca8f
Change-Id: I1f7989b026504667e8ebc5cecb81eae8aacd65f4
@javeme javeme merged commit 17417df into master Apr 23, 2020
@javeme javeme deleted the user-passwd-store-rebase-0.11 branch April 23, 2020 09:14
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

3 participants