mirror of
https://github.com/google/app-check
synced 2026-11-10 22:05:53 +05:45
Add initWithServiceName:resourceName:baseURL:APIKey:requestHooks: debugToken: (Swift: init(serviceName:resourceName:baseURL:apiKey: requestHooks:debugToken:)) to GACAppCheckDebugProvider so callers can supply a debug token resolved outside the SDK, such as one the Firebase CLI saved to ~/.config/configstore/firebase-appcheck.json. The existing initializer delegates to it with a nil token. Tokens resolve in this order: the AppCheckDebugToken or FIRAAppCheckDebugToken environment variable, the provided token, the stored local token, then a newly generated one. The provided token is trimmed, and an empty result falls back to the local token. When it is used, no local token is generated, stored, or logged; a debug-level message (I-GAC004005) is logged instead, and its exchanges don't change the local token's registered state. Also add debugTokenSource and AppCheckCoreDebugTokenSource (GACAppCheckDebugTokenSource: local, environmentVariable, provided), which report where the current token came from. The enum is Sendable and marked @nonexhaustive when the compiler supports it, so new sources can be added without breaking Swift clients.