From 19d8e560e83eca66d458562724573a4db52a3407 Mon Sep 17 00:00:00 2001 From: Jeff <3759507+jhuleatt@users.noreply.github.com> Date: Fri, 14 Feb 2025 09:22:44 -0500 Subject: [PATCH] Remove `authPolicy` section --- docs/firebase.md | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/docs/firebase.md b/docs/firebase.md index d68d91b697..ca30135779 100644 --- a/docs/firebase.md +++ b/docs/firebase.md @@ -91,31 +91,6 @@ import { onCallGenkit } from 'firebase-functions/https'; export generatePoem = onCallGenkit(generatePoemFlow); ``` -### Define an authorization policy - -All deployed flows, whether deployed to Firebase or not, should have an -authorization policy; without one, anyone can invoke your potentially-expensive -generative AI flows. To define an authorization policy, use the -`authPolicy` parameter of `onCallGenkit`: - -```ts -export const generatePoem = onCallGenkit({ - authPolicy: (auth) => auth?.token?.email_verified, -}, generatePoemFlow); -``` - -This sample uses a manual function as its auth policy. In addition, the https -library exports the `signedIn()` and `hasClaim()` helpers. Here is the same code -using one of those helpers: - -```ts -import { hasClaim } from 'firebase-functions/https'; - -export const generatePoem = onCallGenkit({ - authPolicy: hasClaim('email_verified'), -}, generatePoemFlow); -``` - ### Make API credentials available to deployed flows Once deployed, your flows need some way to authenticate with any remote services @@ -393,4 +368,4 @@ the Dev UI). To see traces from Firestore in the Dev UI, you can navigate to the _Inspect_ tab and toggle the *Dev/Prod* switch. When toggled to _prod_ it loads -traces from firestore. \ No newline at end of file +traces from firestore.