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.