commit | 20d696109fee8b4b6018f3b686eab386047dd9bb | [log] [tgz] |
---|---|---|
author | Shawn Pearce <sop@google.com> | Thu Dec 08 10:52:34 2016 -0800 |
committer | Shawn Pearce <sop@google.com> | Thu Dec 08 11:20:16 2016 -0800 |
tree | 2ce830c2204d4732ef935779251bcbc37c48db04 | |
parent | 58a58caa8fc2dac2c5feb8d8b9fe29bcba93157f [diff] |
Move to metadata server v1 API Support any scope that may be accepted by a service. Change-Id: Ifef92158ff425b1e478b6fb73eae60878d782f63
The git-cookie-authdaemon
uses the GCE metadata server to acquire an OAuth2 access token and configures git
to always present this OAuth2 token when connecting to googlesource.com or Google Cloud Source Repositories.
Launch the GCE VMs with the gerritcodereview scope requested, for example:
gcloud compute instances create \ --scopes https://www.googleapis.com/auth/gerritcodereview \ ...
Install the daemon within the VM image and start it running:
sudo apt-get install git git clone https://gerrit.googlesource.com/gcompute-tools/ ./gcompute-tools/git-cookie-authdaemon
The daemon launches itself into the background and continues to keep the OAuth2 access token fresh.