@@ -33,21 +33,12 @@ public final class FirebaseAI: Sendable {
33
33
/// - backend: The backend API for the Firebase AI SDK; if not specified, uses the default
34
34
/// ``Backend/googleAI()`` (Gemini Developer API).
35
35
/// - useLimitedUseAppCheckTokens: When sending tokens to the backend, this option enables
36
- /// the usage of App Check's limited-use tokens instead of the standard cached tokens.
37
- ///
38
- /// A new limited-use tokens will be generated for each request; providing a smaller attack
39
- /// surface for malicious parties to hijack tokens. When used alongside replay protection,
40
- /// limited-use tokens are also _consumed_ after each request, ensuring they can't be used
41
- /// again.
36
+ /// the usage of App Check's limited-use tokens instead of the standard cached tokens. Learn
37
+ /// more about [limited-use tokens](https://firebase.google.com/docs/ai-logic/app-check),
38
+ /// including their nuances, when to use them, and best practices for integrating them into
39
+ /// your app.
42
40
///
43
41
/// _This flag is set to `false` by default._
44
- ///
45
- /// > Important: Replay protection is not currently supported for the FirebaseAI backend.
46
- /// > While this feature is being developed, you can still migrate to using
47
- /// > limited-use tokens. Because limited-use tokens are backwards compatible, you can still
48
- /// > use them without replay protection. Due to their shorter TTL over standard App Check
49
- /// > tokens, they still provide a security benefit.
50
- /// >
51
42
/// > Migrating to limited-use tokens sooner minimizes disruption when support for replay
52
43
/// > protection is added.
53
44
/// - Returns: A `FirebaseAI` instance, configured with the custom `FirebaseApp`.
@@ -110,8 +101,7 @@ public final class FirebaseAI: Sendable {
110
101
tools: tools,
111
102
toolConfig: toolConfig,
112
103
systemInstruction: systemInstruction,
113
- requestOptions: requestOptions,
114
- useLimitedUseAppCheckTokens: useLimitedUseAppCheckTokens
104
+ requestOptions: requestOptions
115
105
)
116
106
}
117
107
@@ -147,8 +137,7 @@ public final class FirebaseAI: Sendable {
147
137
apiConfig: apiConfig,
148
138
generationConfig: generationConfig,
149
139
safetySettings: safetySettings,
150
- requestOptions: requestOptions,
151
- useLimitedUseAppCheckTokens: useLimitedUseAppCheckTokens
140
+ requestOptions: requestOptions
152
141
)
153
142
}
154
143
@@ -163,8 +152,6 @@ public final class FirebaseAI: Sendable {
163
152
164
153
let apiConfig : APIConfig
165
154
166
- let useLimitedUseAppCheckTokens : Bool
167
-
168
155
/// A map of active `FirebaseAI` instances keyed by the `FirebaseApp` name and the `location`,
169
156
/// in the format `appName:location`.
170
157
private nonisolated ( unsafe) static var instances : [ InstanceKey : FirebaseAI ] = [ : ]
@@ -227,11 +214,11 @@ public final class FirebaseAI: Sendable {
227
214
projectID: projectID,
228
215
apiKey: apiKey,
229
216
firebaseAppID: app. options. googleAppID,
230
- firebaseApp: app
217
+ firebaseApp: app,
218
+ useLimitedUseAppCheckTokens: useLimitedUseAppCheckTokens
231
219
)
232
220
self . apiConfig = apiConfig
233
221
self . location = location
234
- self . useLimitedUseAppCheckTokens = useLimitedUseAppCheckTokens
235
222
}
236
223
237
224
func modelResourceName( modelName: String ) -> String {
0 commit comments