gcploit icon indicating copy to clipboard operation
gcploit copied to clipboard

bfs.py: Fix API issue, add auto org mode

Open tm23 opened this issue 5 years ago • 0 comments

I ran into an API limitation, where one could only send 10 permissions at a time (by default, at least), leading to the following error message: {"error": {"code": 400, "message": "Some specified value(s) are invalid.", "status": "INVALID_ARGUMENT", "details": [{"@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [{"field": "access_selector", "description": "In one request, the total number of roles and permissions should be equal or less than 10. If you have more than that, please split your request into multiple ones."}]}]}}

So I added some ugly code to batch up the number of permissions we ask the API and attempt to collate the results on the other side.

I also added an "automatic" mode to step through the entire org's projects. This may hit your API requests rate quota, even with the sleep times included.

(edit to fix typo)

tm23 avatar Oct 08 '20 19:10 tm23