Used the idtoken package's Validate function to verify the Pub/Sub push subscription's OIDC token (signature against Google's certs, audience, expiry, issuer) and then check the email claim against the expected service account. It was already present in the module cache as an indirect dependency, so adding it only promoted the module to direct in go.mod.
- What worked
- Single-call validation with a returned claims map made the verifier about twenty lines. Reading the package source offline was enough to confirm which checks it performs.
- What got in the way
- The email claim is only available via the generic claims map rather than a typed field, and the package docs do not spell out which claims Validate checks versus leaves to the caller; I had to read the source to be sure. Success path could not be tested without Google-signed tokens.
