From 9cc4590d80978161376a81e946a0c1025a086e97 Mon Sep 17 00:00:00 2001 From: Chris Chestnut Date: Mon, 13 May 2024 17:39:54 +0000 Subject: [PATCH] Using selfSSummaryFlow in auth and other joke replacements --- docs/auth.md | 18 +++++++++--------- docs/cloud-run.md | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/auth.md b/docs/auth.md index 8aee7de8b..9ea0e88f4 100644 --- a/docs/auth.md +++ b/docs/auth.md @@ -121,8 +121,8 @@ You can use Firebase Auth to protect your flows defined with `onFlow()`: import { firebaseAuth } from '@genkit-ai/firebase/auth'; import { onFlow } from '@genkit-ai/firebase/functions'; -export const menuSuggestionFlow = onFlow({ - name: 'menuSuggestionFlow', +export const selfSummaryFlow = onFlow({ + name: 'selfSummaryFlow', inputSchema: z.string(), outputSchema: z.string(), authPolicy: firebaseAuth((user) => { @@ -140,7 +140,7 @@ above. When running this flow during development, you would pass the user object in the same way: ```posix-terminal -genkit flow:run menuSuggestionFlow '"Banana"' --auth '{"admin": true}' +genkit flow:run selfSummaryFlow '{"uid": "abc-def"}' --auth '{"admin": true}' ``` By default the Firebase Auth plugin requires the auth header to be sent by the @@ -169,14 +169,14 @@ indicate to the library that you are forgoing authorization checks by using the ```ts import { onFlow, noAuth } from '@genkit-ai/firebase/functions'; -export const menuSuggestionFlow = onFlow({ - name: 'menuSuggestionFlow', +export const selfSummaryFlow = onFlow({ + name: 'selfSummaryFlow', inputSchema: z.string(), outputSchema: z.string(), // WARNING: Only do this if you have some other gatekeeping in place, like // Cloud IAM! authPolicy: noAuth(), - }, (joke) => {...}) + }, (subject) => {...}) ``` ### Client integrity @@ -190,8 +190,8 @@ the following configuration options to your `onFlow()`: ```ts import { onFlow } from '@genkit-ai/firebase/functions'; -export const menuSuggestionFlow = onFlow({ - name: 'menuSuggestionFlow', +export const selfSummaryFlow = onFlow({ + name: 'selfSummaryFlow', inputSchema: z.string(), outputSchema: z.string(), @@ -202,7 +202,7 @@ export const menuSuggestionFlow = onFlow({ consumeAppCheckToken: true, authPolicy: ..., - }, (joke) => {...}) + }, (subject) => {...}) ``` ## Non-Firebase HTTP authorization diff --git a/docs/cloud-run.md b/docs/cloud-run.md index 9c5258cb6..68c62576c 100644 --- a/docs/cloud-run.md +++ b/docs/cloud-run.md @@ -160,7 +160,7 @@ After deployment finishes, the tool will print the service URL. You can test it with `curl`: ```posix-terminal -curl -X POST https:///jokeFlow \ +curl -X POST https:///menuSuggestionFlow \ -H "Authorization: Bearer $(gcloud auth print-identity-token)" \ -H "Content-Type: application/json" -d '{"data": "banana"}' ```