Commit Graph
48 Commits
Author SHA1 Message Date
Nick CookeandAndrew Heard 4639d4e97e fix(backoff): allow retry when device clock moves backward (#137)
Signed-off-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
Co-authored-by: Andrew Heard <andrewheard@google.com>
2026-11-06 13:38:26 -05:00
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
Andrew Heard 958f0212cf fix(debug): only track registration state for local debug token (#135)
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.
2026-11-05 16:47:46 -05:00
Daniel Morfa Vega 49687692b6 fix: refresh cached token when it was received in the future (#132) 2026-11-05 15:46:21 -05:00
c7eb17e554 Rewrite AppCheckCore in Swift (#111)
Signed-off-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
Co-authored-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
Co-authored-by: Nick Cooke <nickcooke@google.com>
2026-09-23 18:22:08 -04:00
Paul Beusterien 1a2da7fca1 fix: capture request date before network request to prevent clock skew/suspension bugs (#113) 2026-09-11 08:17:58 -07:00
Nick Cooke 8ceec5f0b6 refactor: migrate GACAppAttestProviderTests off OCMock (Milestone 2) (#109)
Signed-off-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
2026-07-27 21:38:27 -04:00
Paul BeusterienandNick Cooke 7ef9d41b33 fix: Reset and retry attestation on DCErrorUnknownSystemFailure during assertion phase (#96)
Co-authored-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
2026-07-07 18:07:30 -04:00
Nick Cooke a574648453 fix: eliminate thread starvation flake in legacy provider tests (#100) 2026-06-20 12:20:53 -04:00
Nick Cooke fd4a710637 fix(url): point to firebase docs over gcp docs (#98) 2026-06-16 20:08:13 -04:00
Andrew HeardandNick Cooke bb4002485f feat: Only log local debug tokens when not yet registered (#95)
Co-authored-by: Nick Cooke <nickcooke@google.com>
2026-06-10 11:30:20 -04:00
f6b4582ed1 feat: Add Recaptcha attestation provider (#94)
Signed-off-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
Co-authored-by: Hitesh Maurya <hiteshmaurya@google.com>
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
2026-06-09 16:44:19 -04:00
Andrew Heardandgoogle-labs-jules[bot] 3d50c0ed6d [AppCheckCore] Fix import in GACAppCheckAPIService.h (#83)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-24 16:57:51 -04:00
Nick Cooke 4b265b9557 [AppCheckCore] Skip local cache when making network requests (#78) 2024-10-17 19:26:14 -04:00
Nick Cooke cf707f9306 [AppCheck] Reset to attestation flow if assertion flow fails (#76) 2024-10-04 15:07:32 -04:00
Paul Beusterien 33bb9af2b1 [v11] Merge main (#64) 2024-06-17 16:52:41 -04:00
Nick Cooke 34e4ef0800 [v11] Migrate to GoogleUtilities v8 (#61)
Signed-off-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
2024-06-12 15:22:18 -04:00
Nick Cooke 9c29eedf61 [App Attest] Reset App Attest key state if 'DCErrorInvalidInput' occurs (#54) 2024-05-09 14:38:25 -04:00
Nick Cooke 7d2688de03 [AppCheckCore] Migrate to GoogleUtilities's storage container (#53) 2024-04-12 15:40:49 -04:00
Andrew Heard 7a21efdb57 Add clientDataHash to App Attest failure reasons (#50) 2024-03-28 16:49:12 -04:00
Andrew Heard 96ff7d1065 Add DCError descriptions to App Attest failure reasons (#47) 2024-01-16 16:26:14 -05:00
Andrew Heard 3a923e73b9 Add TODO to fix token(forcingRefresh: true) issue (#42) (#43) 2023-11-08 14:26:27 -05:00
Andrew Heard 5746b2d35c Reset App Attest key state if attestKey fails (#41) 2023-11-03 10:00:52 -04:00
Andrew Heard 5889dd55eb Fix warning due to NSUInteger length on watchOS (#36) 2023-10-27 17:24:53 -04:00
Andrew Heard 56b18a0dd8 Forward declare GACAppCheckToken in GACAppCheckTokenDelegate (#33) 2023-10-26 12:16:34 -04:00
Andrew Heard 6417d6a215 Add failure reasons for App Attest error cases (#32) 2023-10-24 18:03:48 -04:00
Andrew Heard ba91f3f518 Fix C function warnings in Xcode 14.3+ (#28) 2023-09-08 17:36:04 -04:00
Andrew Heard 462e3d2cf5 Make API key nonnull in DeviceCheck and debug providers (#26) 2023-09-07 15:15:43 -04:00
Andrew Heard a8fa18eb92 Update GACAppCheckDebugProvider documentation (#25) 2023-09-07 11:12:29 -04:00
Andrew Heard 4e405b8c4f Rename debug token environment variable key (#24) 2023-09-07 10:57:38 -04:00
Andrew Heard d6b709f294 Set default log level in load instead of getter (#23) 2023-09-06 17:03:58 -04:00
Andrew Heard abe7026e19 Set default log level to warning (#22) 2023-09-06 10:45:30 -04:00
Andrew Heard 023abd45d3 Add baseURL parameter to GACAppCheckDebugProvider constructor (#21) 2023-08-31 12:18:47 -04:00
Andrew Heard f77879ca75 Return GACAppCheckTokenResult in limitedUseTokenWithCompletion (#20) 2023-08-31 10:36:31 -04:00
Andrew Heard f2cc90d0ce Return GACAppCheckTokenResult in tokenForcingRefresh handler (#19) 2023-08-30 14:22:33 -04:00
Andrew Heard f191868209 Add GACAppCheckTokenResult type (#18) 2023-08-30 11:44:09 -04:00
Andrew Heard 961b37aef3 Remove outdated GACAppAttestProvider constructor (#17) 2023-08-29 16:11:17 -04:00
Andrew Heard f53218675e Consistently use GACAppCheckTokenProtocol in public API (#15) 2023-08-23 10:12:24 -04:00
Andrew Heard f85d46bd67 Remove get prefix from getToken and getLimitedUseToken (#14) 2023-08-22 18:08:51 -04:00
Andrew Heard 8d0bdd3f24 Add generation of limited-use tokens with a TTL of 5 mins (#11) 2023-08-22 12:56:00 -04:00
Andrew Heard 2b623874c9 Add DeviceCheck isSupported check (#13) 2023-08-21 18:32:11 -04:00
Andrew Heard 1413786b89 Make GACAppAttestProvider's constructor nonnull (#12) 2023-08-21 13:54:26 -04:00
Andrew Heard c3bf9c299f Fix App Attest and DeviceCheck API availability (#10)
- Updated the `GAC_DEVICE_CHECK_PROVIDER_AVAILABILITY` and `GAC_APP_ATTEST_PROVIDER_AVAILABILITY` API availability macros to reflect the set of supported platforms for DeviceCheck (iOS 11+, macOS 10.15+, macCatalyst 13+, tvOS 11+, watchOS 9+) and App Attest (iOS 14+, macOS 11.3+, macCatalyst 14.5+, tvOS 15+, watchOS 9+).
- Removed the extraneous check for the watchOS 9 SDK since Xcode 14 is the minimum supported by App Check.
2023-08-11 17:00:47 -04:00
Andrew Heard b12f472db8 Rename instanceName and storageID to serviceName (#11599)
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.
2023-08-01 13:48:42 -04:00
Andrew Heard fe4b137399 Remove App Check Core Interop SDK (#11595)
The ObjC Protocol-only interop SDK is not needed by our integrators.
2023-08-01 13:42:29 -04:00
Andrew Heard 6446e93e83 Implement FIRAppCheckSettings as subclass (#11597)
Added a class GACAppCheckSettings that conforms to GACAppCheckSettingsProtocol and implemented FIRAppCheckSettings as a subclass of it.
2023-08-01 13:37:56 -04:00
Andrew Heard 90bcc7767f Make tokenDelegate nullable in GACAppCheck (#11592)
Made the tokenDelegate parameter nullable in the constructor for GACAppCheck since the feature is not used by all integrators. E.g., it is not needed if token refresh isn't used -- 'tokenDidUpdate:instanceName:' would never get called.

- Added parameter documentation to the 'initWithInstanceName:appCheckProvider:settings:tokenDelegate:resourceName:keychainAccessGroup' constructor in GACAppCheck.
- Renamed the umbrella header from AppCheck.h to AppCheckCore.h to match the framework name.
2023-08-01 13:31:24 -04:00
Andrew Heard 2d2d0e6228 Renamed AppCheck to AppCheckCore (#11581)
Renamed the App Check (Lite) SDK to App Check Core.
2023-07-21 10:17:20 -04:00