bfs.py: Fix API issue, add auto org mode
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)