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.
The debug provider stores a per-service "registered" flag so it stops
logging the local debug token's registration instructions once that
token has been exchanged successfully. Exchanges using the
AppCheckDebugToken or FIRAAppCheckDebugToken environment variable also
updated the flag, even though the local token wasn't used:
- On success, the local token was marked as registered, so after the
variable was removed the SDK fell back to an unregistered token
without logging how to register it.
- On failure, the flag was cleared, so an already registered local
token logged its registration instructions again.
Only set or clear the flag when the local token was the one exchanged;
serverUnreachable failures still leave it untouched. There are no
public API changes.
Also document all parameters of the public initializer, and fix the
test tearDown, which only removed the registered key's prefix and let
the flag leak between tests.
The App Check Core unit tests still have a dependency on Firebase Core (specifically, FirebaseCoreExtension). Updated the imports to framework-style <>, instead of "", since they are coming from the dependency rather than looking for a local path (different repo).
Updated the version from 10.13.0 to 0.1.0-alpha.1 to reflect the pre-release status.
For consistency, renamed both instanceName and storageID to serviceName for consistency.
In all cases, the serviceName is an identifier that differentiates multiple GACAppCheck instances such as when there are multiple FIRApps in use, or multiple dependent SDKs (e.g., Firebase and Google Sign-In). This unique identifier ensures their state is not shared in the Keychain or in User Defaults.