Files
app-check/AppCheckCore/Tests/Unit/ObjC
Andrew Heard ebd7f0547a feat(debug): add debugToken: initializer and debugTokenSource (#134)
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.
2026-11-06 12:23:01 -05:00
..