docs: add limited-use App Check tokens documentation for iOS#149
docs: add limited-use App Check tokens documentation for iOS#149DjNastor wants to merge 1 commit into
Conversation
- Add 'Using Limited-Use App Check Tokens' section in initialization - Include SecureAIViewModel example showing production-ready setup - Document benefits: single-use tokens, reduced attack surface - Add prerequisites for App Check configuration Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds documentation and Swift code examples for using limited-use App Check tokens with Firebase AI Logic on iOS. The review feedback correctly identifies that the backend parameter .googleAI() is incorrect and should be .geminiDeveloperAPI(), and suggests adding the [AGENT] placeholder comment to the SwiftUI integration example.
| let ai = FirebaseAI.firebaseAI( | ||
| backend: .googleAI(), | ||
| useLimitedUseAppCheckTokens: true | ||
| ) |
There was a problem hiding this comment.
The backend parameter .googleAI() is incorrect. According to the SKILL.md and Firebase AI Logic specifications, the supported Gemini API providers are the Gemini Developer API and Vertex AI Gemini API. The correct enum case for the Gemini Developer API is .geminiDeveloperAPI().
| let ai = FirebaseAI.firebaseAI( | |
| backend: .googleAI(), | |
| useLimitedUseAppCheckTokens: true | |
| ) | |
| let ai = FirebaseAI.firebaseAI( | |
| backend: .geminiDeveloperAPI(), | |
| useLimitedUseAppCheckTokens: true | |
| ) |
| private lazy var model = FirebaseAI.firebaseAI( | ||
| backend: .googleAI(), | ||
| useLimitedUseAppCheckTokens: true | ||
| ).generativeModel(modelName: "<latest_supported_model>") |
There was a problem hiding this comment.
The backend parameter .googleAI() is incorrect. It should be .geminiDeveloperAPI() to match the supported Gemini Developer API provider. Additionally, please add the [AGENT] comment above the model initialization so that automated agents can correctly identify and update the model name placeholder.
| private lazy var model = FirebaseAI.firebaseAI( | |
| backend: .googleAI(), | |
| useLimitedUseAppCheckTokens: true | |
| ).generativeModel(modelName: "<latest_supported_model>") | |
| // [AGENT] Replace "<latest_supported_model>" with the latest model from https://firebase.google.com/docs/ai-logic/models.md.txt | |
| private lazy var model = FirebaseAI.firebaseAI( | |
| backend: .geminiDeveloperAPI(), | |
| useLimitedUseAppCheckTokens: true | |
| ).generativeModel(modelName: "<latest_supported_model>") |
Summary
Add comprehensive documentation for using limited-use App Check tokens with Firebase AI Logic on iOS. This feature enhances security by restricting each App Check token to a single API request, reducing risk if a token is intercepted.
Changes
SecureAIViewModelexample showing production-ready implementation with limited-use tokens in SwiftUIWhy This Matters
Limited-use tokens are a best practice for production iOS applications. This documentation makes the feature discoverable and provides developers with clear, runnable examples of how to implement this security enhancement.