-
Notifications
You must be signed in to change notification settings - Fork 629
chore(server): bump REST API version #3159
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
base: master
Are you sure you want to change the base?
Changes from all commits
52035da
88a762a
3d9d954
ed1310c
0752ec2
ddfec94
3d23131
eae9401
e2d7fff
7a57568
006a2b3
2f844ed
ca0478a
d8699ae
28641f5
8c69441
17615dc
8d03d9c
2ed446b
b94347b
f38b4ad
6f78df5
7083242
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,10 +146,7 @@ public String setDefaultRole(@Context GraphManager manager, | |
| throw new ForbiddenException("Forbidden to set role " + role.toString()); | ||
| } | ||
|
|
||
| boolean hasGraph = role.equals(HugeDefaultRole.OBSERVER); | ||
|
|
||
| E.checkArgument(!hasGraph || StringUtils.isNotEmpty(graph), | ||
| "Must set a graph for observer"); | ||
| boolean hasGraph = role.equals(HugeDefaultRole.OBSERVER) && StringUtils.isNotEmpty(graph); | ||
| if (hasGraph) { | ||
| validGraph(manager, name, graph); | ||
| } | ||
|
|
@@ -164,6 +161,11 @@ public String setDefaultRole(@Context GraphManager manager, | |
| result.put("graph", graph); | ||
| } else { | ||
| authManager.createSpaceDefaultRole(name, user, role); | ||
| if (role.equals(HugeDefaultRole.OBSERVER)) { | ||
| for (String currentGraph : manager.graphs(name)) { | ||
| authManager.deleteDefaultRole(name, user, role, currentGraph); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return manager.serializer().writeMap(result); | ||
|
|
@@ -203,20 +205,25 @@ public String checkDefaultRole(@Context GraphManager manager, | |
| defaultRole.equals(HugeDefaultRole.SPACE)) { | ||
| throw new ForbiddenException("Forbidden to check role " + role); | ||
| } | ||
| boolean hasGraph = defaultRole.equals(HugeDefaultRole.OBSERVER); | ||
| E.checkArgument(!hasGraph || StringUtils.isNotEmpty(graph), | ||
| "Must set a graph for observer"); | ||
| boolean hasGraph = defaultRole.equals(HugeDefaultRole.OBSERVER) && | ||
| StringUtils.isNotEmpty(graph); | ||
| if (hasGraph) { | ||
| validGraph(manager, name, graph); | ||
| } | ||
|
|
||
| boolean result; | ||
| if (hasGraph) { | ||
| result = authManager.isDefaultRole(name, graph, user, | ||
| defaultRole); | ||
| result = authManager.isDefaultRole(name, graph, user, defaultRole); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } else { | ||
| result = authManager.isDefaultRole(name, user, | ||
| defaultRole); | ||
| result = authManager.isDefaultRole(name, user, defaultRole); | ||
| if (!result && defaultRole.equals(HugeDefaultRole.OBSERVER)) { | ||
| for (String currentGraph : manager.graphs(name)) { | ||
| if (authManager.isDefaultRole(name, currentGraph, user, defaultRole)) { | ||
| result = true; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return manager.serializer().writeMap(ImmutableMap.of("check", result)); | ||
| } | ||
|
|
@@ -259,16 +266,19 @@ public void deleteDefaultRole(@Context GraphManager manager, | |
| E.checkArgument(false, "Invalid role value '%s'", role); | ||
| defaultRole = null; // unreachable, satisfies compiler | ||
| } | ||
| boolean hasGraph = defaultRole.equals(HugeDefaultRole.OBSERVER); | ||
| E.checkArgument(!hasGraph || StringUtils.isNotEmpty(graph), | ||
| "Must set a graph for observer"); | ||
| boolean hasGraph = defaultRole.equals(HugeDefaultRole.OBSERVER) && StringUtils.isNotEmpty(graph); | ||
| if (hasGraph) { | ||
| validGraph(manager, name, graph); | ||
| } | ||
| if (hasGraph) { | ||
| authManager.deleteDefaultRole(name, user, defaultRole, graph); | ||
| } else { | ||
| authManager.deleteDefaultRole(name, user, defaultRole); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if (defaultRole.equals(HugeDefaultRole.OBSERVER)) { | ||
| for (String currentGraph : manager.graphs(name)) { | ||
| authManager.deleteDefaultRole(name, user, defaultRole, currentGraph); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -290,6 +290,10 @@ private static Object matchedAction(HugePermission action, | |
| } | ||
| for (Map.Entry<HugePermission, Object> e : perms.entrySet()) { | ||
| HugePermission permission = e.getKey(); | ||
| if (permission == HugePermission.SPACE || | ||
| permission == HugePermission.SPACE_MEMBER) { | ||
| continue; | ||
| } | ||
| // Maybe required = ANY | ||
| if (action.match(permission) || | ||
| action.equals(HugePermission.EXECUTE)) { | ||
|
|
@@ -359,8 +363,15 @@ public static boolean match(Object role, RolePermission grant, | |
| } | ||
| } | ||
|
|
||
| RolePermission rolePerm = RolePermission.fromJson(role); | ||
| return rolePerm.contains(grant); | ||
| RolePermission grantedRole = RolePermission.fromJson(grant); | ||
| RolePerm rolePerm = RolePerm.fromJson(role); | ||
| if (resourceObject != null && | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| !RolePermission.isAdmin(grantedRole) && | ||
| grantedRole.roles().containsKey(resourceObject.graphSpace()) && | ||
| rolePerm.matchSpace(resourceObject.graphSpace(), "space")) { | ||
| return true; | ||
| } | ||
| return RolePermission.fromJson(role).contains(grantedRole); | ||
| } | ||
|
|
||
| @SuppressWarnings({"unchecked", "rawtypes"}) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**/Dockerfile*filter leaves the repository'sdocker/hbase/**tree outside everypull_request.pathsentry, although it still contains a Dockerfile, entrypoint, and HBase configuration. Changes to that image will no longer trigger Docker Build CI and can merge without any image validation. Please retaindocker/hbase/**in the trigger or add a dedicated HBase build job with checks appropriate to that image.