Skip to content

Instantly share code, notes, and snippets.

@ezequielpereira
Created August 26, 2020 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezequielpereira/c7261175bd3b51e4184192b2f99e74c7 to your computer and use it in GitHub Desktop.
Save ezequielpereira/c7261175bd3b51e4184192b2f99e74c7 to your computer and use it in GitHub Desktop.
Script + proto definition used to research the pageToken of the GCP IAM projects.serviceAccounts.list method
#!/bin/bash
project=$1
page_size=3
unknown4=0
# Magic
outer=$(echo -e "project: $project\npage_size: $page_size\nunknown4: $unknown4" | protoc --encode=Outer test.proto | base64 -w 0 | sed 's/+/-/g; s/\//_/g')
outer=${outer//=}
echo cg:$outer
syntax = "proto2";
message Outer {
optional uint64 project = 1;
optional int32 page_size = 3;
optional int32 unknown4 = 4;
optional string inner_pb = 5;
}
message Inner {
optional uint64 last_service_account = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment