-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #RHIROS-1312 - update RBAC filters (#355)
* Fixes #RHIROS-1312 - update RBAC filters * Fix nits and add extra test case
- Loading branch information
1 parent
f3703be
commit b5c1c68
Showing
9 changed files
with
335 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"meta": { | ||
"count": 3, | ||
"limit": 1000, | ||
"offset": 0 | ||
}, | ||
"links": { | ||
"first": "/api/rbac/v1/access/?application=ros%2Cinventory&limit=1000&offset=0", | ||
"next": null, | ||
"previous": null, | ||
"last": "/api/rbac/v1/access/?application=ros%2Cinventory&limit=1000&offset=0" | ||
}, | ||
"data": [ | ||
{ | ||
"resourceDefinitions": [], | ||
"permission": "ros:*:*" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"12345678-fe1b-4191-8408-cbadbd47f7a3", | ||
"abcdefgh-d97e-4ed0-9095-ef07d73b4839", | ||
"d4e2fc0f-617d-49d5-8d1b-acbb423f0fbe" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:hosts:read" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"d4e2fc0f-617d-49d5-8d1b-acbb423f0fbe" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:hosts:read" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"d4e2fc0f-617d-49d5-8d1b-acbb423f0fbe" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:groups:read" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
tests/data_files/mock_rbac_returns_multiple_read_permissions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"meta": { | ||
"count": 5, | ||
"limit": 1000, | ||
"offset": 0 | ||
}, | ||
"links": { | ||
|
||
"first": "/api/rbac/v1/access/?application=ros%2Cinventory&limit=1000&offset=0", | ||
"next": null, | ||
"previous": null, | ||
"last": "/api/rbac/v1/access/?application=ros%2Cinventory&limit=1000&offset=0" | ||
}, | ||
"data": [ | ||
{ | ||
"resourceDefinitions": [], | ||
"permission": "ros:*:*" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"12345678-fe1b-4191-8408-cbadbd47f7a3" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:groups:read" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"155860d5-648c-4529-847a-690cbf198934" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:groups:write" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"_comment": "The test-group id", | ||
"value": [ | ||
"abcdefgh-d97e-4ed0-9095-ef07d73b4839" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:hosts:read" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"_comment": "The foo-group id", | ||
"value": [ | ||
"d4e2fc0f-617d-49d5-8d1b-acbb423f0fbe" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:hosts:read" | ||
} | ||
] | ||
} |
91 changes: 91 additions & 0 deletions
91
tests/data_files/mock_rbac_returns_multiple_types_of_read_permissions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"meta": { | ||
"count": 5, | ||
"limit": 1000, | ||
"offset": 0 | ||
}, | ||
"links": { | ||
"first": "/api/rbac/v1/access/?application=ros%2Cinventory&limit=1000&offset=0", | ||
"next": null, | ||
"previous": null, | ||
"last": "/api/rbac/v1/access/?application=ros%2Cinventory&limit=1000&offset=0" | ||
}, | ||
"data": [ | ||
{ | ||
"resourceDefinitions": [], | ||
"permission": "ros:*:*" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"404c617d-3dc7-4de6-912b-bde1312e1ce5" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:groups:read" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"155860d5-648c-4529-847a-690cbf198934" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:groups:write" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"_comment": "The example-group id", | ||
"value": [ | ||
"12345678-fe1b-4191-8408-cbadbd47f7a3" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:hosts:read" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"value": [ | ||
"abcdefgh-d97e-4ed0-9095-ef07d73b4839" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:hosts:*" | ||
}, | ||
{ | ||
"resourceDefinitions": [ | ||
{ | ||
"attributeFilter": { | ||
"key": "group.id", | ||
"_comment": "The foo-group id", | ||
"value": [ | ||
"d4e2fc0f-617d-49d5-8d1b-acbb423f0fbe" | ||
], | ||
"operation": "in" | ||
} | ||
} | ||
], | ||
"permission": "inventory:*:read" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.