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

auth: fix resource type NONE and add resource type SCHEMA #1362

Merged
merged 6 commits into from
Mar 2, 2021

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Feb 20, 2021

No description provided.

Change-Id: Iabcac3c931a977cca8ef911615152c09c517bee9
just for role permission, not for required permission

Change-Id: Iaaa1a08fbabb8b73a58c5934c742553930251b4a
since STATUS-read can be represented, but STATUS-write can't be

Change-Id: I4803c1cd94a1e3f4fcebb9db29340e8e08e72f3f
Change-Id: I5ce1405d5c9ad57f3c4e739d39a5c370dc89e39c
Change-Id: I0433719bfc9885ee12e264c59212cca214e6e624
@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #1362 (227e899) into master (7f63b57) will increase coverage by 0.01%.
The diff coverage is 73.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1362      +/-   ##
============================================
+ Coverage     62.38%   62.40%   +0.01%     
- Complexity     5817     5826       +9     
============================================
  Files           385      385              
  Lines         31922    31927       +5     
  Branches       4451     4453       +2     
============================================
+ Hits          19916    19925       +9     
+ Misses         9984     9982       -2     
+ Partials       2022     2020       -2     
Impacted Files Coverage Δ Complexity Δ
...va/com/baidu/hugegraph/auth/HugeAuthenticator.java 20.32% <ø> (ø) 0.00 <0.00> (ø)
.../java/com/baidu/hugegraph/auth/ResourceObject.java 76.19% <0.00%> (ø) 7.00 <0.00> (ø)
...in/java/com/baidu/hugegraph/auth/HugeResource.java 77.27% <33.33%> (ø) 41.00 <6.00> (ø)
...in/java/com/baidu/hugegraph/auth/ResourceType.java 86.95% <90.90%> (+13.78%) 26.00 <13.00> (+11.00)
...va/com/baidu/hugegraph/task/ServerInfoManager.java 70.22% <0.00%> (-0.57%) 50.00% <0.00%> (-1.00%)

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 7f63b57...227e899. Read the comment docs.

Assert.assertTrue(ResourceType.ROOT.match(ResourceType.EDGE));
Assert.assertTrue(ResourceType.ROOT.match(ResourceType.VERTEX_LABEL));
Assert.assertTrue(ResourceType.ROOT.match(ResourceType.META));
Assert.assertTrue(ResourceType.ALL.match(ResourceType.ALL));;
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate with line 160, ALL -> ROOT

Assert.assertTrue(ResourceType.ROOT.match(ResourceType.USER_GROUP));
Assert.assertTrue(ResourceType.ROOT.match(ResourceType.TARGET));
Assert.assertTrue(ResourceType.ROOT.match(ResourceType.METRICS));
Assert.assertFalse(ResourceType.ALL.match(ResourceType.ROOT));
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

* Construct required permission such as:
* $owner=graph1 $action=read
* (means required read permission of any one resource)
* maybe also support:
Copy link
Contributor

Choose a reason for hiding this comment

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

add an empty line and ”In the future maybe also support:“

houzhizhen
houzhizhen previously approved these changes Feb 23, 2021
Change-Id: Ib6281cb3dfdc917ecac0c9450f7919e3898f73db
@javeme javeme force-pushed the fix-auth-NONE-permission branch from 4c544cc to 227e899 Compare February 23, 2021 11:55
@Linary Linary merged commit 949ff53 into master Mar 2, 2021
@Linary Linary deleted the fix-auth-NONE-permission branch March 2, 2021 06:50
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.

4 participants