如何模拟 Identity Platform Authentication 以触发 beforeCreateHandler

发布于 2025-01-09 11:29:22 字数 766 浏览 1 评论 0原文

我有一个谷歌云函数,我在 Google Identity Platform 的 beforeCreate 触发器中运行它,如下所示:

import * as gcipCloudFunctions from "gcip-cloud-functions";
const authClient = new gcipCloudFunctions.Auth();
const beforeCreate = authClient.functions().beforeCreateHandler((user, context) => {
 console.log("Hello world");
 });
export default beforeCreate;

如何创建笑话测试来模拟此事件?或者如何创建测试来执行此功能?

<一href="https://cloud.google.com/identity-platform/docs/blocking-functions#:%7E:text=Creating%20a%20blocking%20function,-%20following%20steps&text=Go%20到%20the%20Identity%20Platform%20Settings%20page%20in%20the%20Cloud%20Console.&text=选择%20the%20Triggers%20tab.,and%20then%20click%20Create%20function” rel="nofollow noreferrer">阻止功能。

I have a google cloud function which I run in Google Identity Platform in the beforeCreate trigger which looks like this:

import * as gcipCloudFunctions from "gcip-cloud-functions";
const authClient = new gcipCloudFunctions.Auth();
const beforeCreate = authClient.functions().beforeCreateHandler((user, context) => {
 console.log("Hello world");
 });
export default beforeCreate;

How do I go by to create jest test to mock this event? Or How can I create test to execute this function?

Blocking Functions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷雾森÷林ヴ 2025-01-16 11:29:22

据我所知,目前GCP还没有这样的功能。但是,您可以尝试将其作为一项功能来请求。您可以使用问题跟踪器来请求此功能。

Currently, GCP is not having such a feature as far as I know. However, you can try requesting it as a feature. You can use issue tracker to request this feature.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文