google-pubsub-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Google Cloud Pub/Sub push subscription webhooks. Use when setting up a Pub/Sub push endpoint, verifying the OIDC `Authorization: Bearer`…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Google Cloud Pub/Sub Webhooks (Push Subscriptions)
When to Use This Skill
- How do I receive Google Cloud Pub/Sub messages at an HTTP endpoint?
- How do I verify a Pub/Sub push request is really from Google?
- How do I validate the OIDC JWT in the
Authorization: Bearerheader? - Why does Pub/Sub keep redelivering the same message to my webhook?
- How do I decode
message.datafrom a Pub/Sub push envelope? - Why is my Pub/Sub push endpoint returning 401?
How Pub/Sub Push Differs From HMAC Webhooks
Pub/Sub is not a signed-webhook provider. Read this before looking for a signature header — there isn't one.
- No signing secret, no HMAC header. There is no
X-Goog-Signature, no Standard Webhooks (webhook-id/webhook-timestamp/webhook-signature). Do not invent one. - The body is never signed. On an authenticated push subscription the
Authorization: Bearer <JWT>header proves who is calling (your push service account), not what they sent. So unlike Stripe or Shopify, you do not need the raw body — parsing JSON first is fine here. - No event catalog. Pub/Sub carries whatever your publisher published. Event
semantics live entirely in
message.dataandmessage.attributes. There are nopayment.succeeded-style Pub/Sub event names. - Two auth postures, depending on how the subscription was created:
| Posture | What Pub/Sub sends | What you can check |
|---|---|---|
| Default (no subscription auth) | Nothing proving origin | An unguessable ?token= in the push URL, plus network-level ingress restriction |
OIDC (--push-auth-service-account, recommended) |
Authorization: Bearer <Google-signed OIDC JWT> |
RS256 signature, iss, aud, email, email_verified |
Configure OIDC. See references/setup.md.
The Push Envelope
POST with Content-Type: application/json:
Google's documented minimum example:
{
"message": {
"data": "SGVsbG8gQ2xvdWQgUHViL1N1YiEgSGVyZSBpcyBteSBtZXNzYWdlIQ==",
"messageId": "2070443601311540",
"message_id": "2070443601311540",
"publishTime": "2021-02-26T19:13:55.749Z",
"publish_time": "2021-02-26T19:13:55.749Z"
},
"subscription": "projects/myproject/subscriptions/mysubscription"
}
data is base64 and may be absent (a message needs data or at least one
attribute). attributes is an optional string map set by the publisher.
orderingKey appears when the publisher set one, and a top-level
deliveryAttempt when the subscription has a dead-letter topic.
Verification (core)
Verify the OIDC token with Google's official auth library — it fetches and
caches Google's public keys and checks the RS256 signature, aud, and exp.
You must still check the service account yourself.
const { OAuth2Client } = require('google-auth-library');
const client = new OAuth2Client();
// Both are valid Google issuers — accept either, as the official libraries do.
const GOOGLE_ISSUERS = ['https://accounts.google.com', 'accounts.google.com'];
async function verifyPushJwt(authorizationHeader) {
// RFC 9110: the auth scheme is case-insensitive.
const [scheme, token] = String(authorizationHeader || '').split(' ');
if (!token || scheme.toLowerCase() !== 'bearer') return null;
let claims;
try {
// Verifies the RS256 signature against Google's public keys, plus aud + exp.
const ticket = await client.verifyIdToken({
idToken: token.trim(),
audience: process.env.PUBSUB_AUDIENCE, // defaults to the push endpoint URL
});
claims = ticket.getPayload();
} catch {
return null;
}
// Checks the library does not do for you.
if (!claims.iss || !GOOGLE_ISSUERS.includes(claims.iss)) return null;
if (claims.email_verified !== true) return null;
// Service account emails are case-insensitive — normalize before comparing.
const email = String(claims.email || '').toLowerCase();
if (!email || email !== process.env.PUBSUB_SERVICE_ACCOUNT_EMAIL.trim().toLowerCase()) {
return null;
}
return claims;
}
Python is the same shape with google-auth:
id_token.verify_oauth2_token(token, google.auth.transport.requests.Request(), audience),
then check iss / email / email_verified yourself. Details and the
unauthenticated fallback are in references/verification.md.
For complete handlers with envelope parsing, subscription allowlisting, and tests, see:
Acknowledgement and Redelivery
- Ack by returning
200,201,202,204, or102. Any other status code — and any timeout — is a nack, and Pub/Sub redelivers. - Respond within the subscription's ack deadline (default 10 seconds, configurable up to 600 seconds). Do slow work asynchronously and ack fast.
- Delivery is **at-l
Установить google-pubsub-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл google-pubsub-webhooks?
Receive and verify Google Cloud Pub/Sub push subscription webhooks. Use when setting up a Pub/Sub push endpoint, verifying the OIDC `Authorization: Bearer` JWT that Pub/Sub attaches to authenticated push subscriptions (iss, aud, email, email_verified), parsing the push envelope (`message.data` base64, `message.attributes`, `messageId`, `publishTime`, `subscription`), securing an unauthenticated push endpoint, or debugging redelivery and ack deadline issues.
Как установить скилл google-pubsub-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл google-pubsub-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic