sincecutoff.com
← all changes

gcloud services API keys update supports --append

Introduced 2026-08-18 · score 0.97

HOW TO USE IT

When adding application or API target restrictions while retaining existing restrictions, run `gcloud services api-keys update` with `--append` and the new restriction flags.

gcloud services api-keys update projects/<project>/locations/global/keys/<key-id> --append --allowed-referrers="https://www.example.com/*" --api-target=service=<service>.googleapis.com

WHY THIS HELPS

Add application or API target restrictions to an API key while preserving its existing restrictions.

BEFORE THIS CHANGE

Update the key's restrictions by replacing its existing restrictions with the new application and API target restrictions.

REQUIREMENTS AND LIMITATIONS

  • KEY (required): Key ID or fully qualified key identifier.
  • --append: Merge new restrictions with the key’s current restrictions instead of replacing them.
  • --api-target: Repeatable; specifies a service and optionally specific methods.
  • --allowed-application: Repeatable; specifies an allowed application using `sha1_fingerprint` and `package_name`.
  • --allowed-bundle-ids: Specifies allowed iOS app bundle IDs.
  • --allowed-ips: Specifies caller IP addresses allowed to make API calls with the key.
  • --allowed-referrers: Specifies regular expressions for referrer URLs allowed to make API calls with the key.
  • Application restriction flags: `--allowed-application`, `--allowed-bundle-ids`, `--allowed-ips`, and `--allowed-referrers` are mutually exclusive.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card