Stripe——这些不同的键是什么?

Stripe - what are all these different keys?

这些键是什么以及如何使用它们?

Dashboard:

前 3 个在 Dashboard 中可见。

这些密钥都用在什么地方?


我通过反复试验发现的:(我不知道这在生产中会是什么样子)

在 CLI 为 运行 时解码事件:


Webhook.constructEvent(rawRequestBody, signature, WEBHOOK_SIGNING_SECRET)

全局设置API键

Stripe.apiKey = SECRET_KEY

我的问题是:

您可以在 Stripe's documentation on API keys.

中阅读有关可发布、秘密和受限 API 密钥的更多信息

since there is no Stripe CLI running in prod, is the webhook_signing_secret the same as the secret_key? (event is not forwarded through the CLI)

不,它们完全不同,用途不同。

why can't the Stripe CLI create an event with the signing secret encoded? it has already the publishable_key and secret_keys configured, why does it need a new one?

在事件中包含 webhook 签名秘密会破坏目的,阻止安全措施发挥作用,并且不能代表生产中的工作方式。