Add app/device attestation for gated info-server requests - #6137
Open
paullinator wants to merge 1 commit into
Open
Add app/device attestation for gated info-server requests#6137paullinator wants to merge 1 commit into
paullinator wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Done
Or push these changes by commenting:
@cursor push b8caa6fd86
Preview (b8caa6fd86)
diff --git a/src/locales/en_US.ts b/src/locales/en_US.ts
--- a/src/locales/en_US.ts
+++ b/src/locales/en_US.ts
@@ -694,7 +694,7 @@
string_ok_cap: 'OK',
clock_skew_title: 'Device clock is wrong',
clock_skew_message:
- "Your device time differs from Edge's servers by more than two minutes. Turn on automatic date & time in your system settings so one-time codes and other time-based features keep working.",
+ 'Your device time differs from our servers by more than two minutes. Turn on automatic date & time in your system settings so one-time codes and other time-based features keep working.',
string_forget: 'Forget',
string_delete: 'Delete',
string_keep: 'Keep',
diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json
--- a/src/locales/strings/enUS.json
+++ b/src/locales/strings/enUS.json
@@ -523,7 +523,7 @@
"string_cancel": "CANCEL",
"string_ok_cap": "OK",
"clock_skew_title": "Device clock is wrong",
- "clock_skew_message": "Your device time differs from Edge's servers by more than two minutes. Turn on automatic date & time in your system settings so one-time codes and other time-based features keep working.",
+ "clock_skew_message": "Your device time differs from our servers by more than two minutes. Turn on automatic date & time in your system settings so one-time codes and other time-based features keep working.",
"string_forget": "Forget",
"string_delete": "Delete",
"string_keep": "Keep",
diff --git a/src/util/attestation.ts b/src/util/attestation.ts
--- a/src/util/attestation.ts
+++ b/src/util/attestation.ts
@@ -1,6 +1,7 @@
import { NativeModules, Platform } from 'react-native'
import { showButtonsModal } from '../components/modals/ButtonsModal'
+import { ENV } from '../env'
import { lstrings } from '../locales/strings'
import { monotonicNow } from './monotonicTime'
import { fetchInfo } from './network'
@@ -318,7 +319,9 @@
throw error
}
// noKey / invalidKey / native signing failure: fall back to full attestation.
- console.log('[attestation] assertion unavailable:', String(error))
+ if (ENV.DEBUG_VERBOSE_LOGGING) {
+ console.log('[attestation] assertion unavailable:', String(error))
+ }
return undefined
}
@@ -589,7 +592,9 @@
lastFailureAt = undefined
consecutiveFailures = 0
cachedToken = freshToken
- console.log('[attestation] handshake ok')
+ if (ENV.DEBUG_VERBOSE_LOGGING) {
+ console.log('[attestation] handshake ok')
+ }
scheduleRefresh(freshToken.expiresMono)
})
.catch((error: unknown) => {You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 52196d0. Configure here.
paullinator
force-pushed
the
paul/appAttestationV2
branch
from
August 4, 2026 14:37
ae37d31 to
95985d3
Compare
Run a background attestation engine that handshakes with Apple App Attest or Android Keystore, caches a short-lived JWT on a monotonic clock, and refreshes ahead of expiry. Gated Simplex and Banxa signing calls attach x-attestation-token when a token is available; otherwise the info server decides. Includes native modules, Keychain/Keystore key lifecycle, ramp error surfacing, and the Simplex supported-countries response check.
paullinator
force-pushed
the
paul/appAttestationV2
branch
from
August 4, 2026 14:37
95985d3 to
faaf688
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
src/util/attestation.ts) plus iOS App Attest and Android Keystore native modules that enroll once, refresh via assertion/signature, and cache JWTs on a monotonic clock with lead-ahead refresh and failure backoff.x-attestation-tokenwhen available; surface gated signing failures in ramp UI instead of silently no-oping.docs/APP_ATTESTATION.md. Depends on info-server lifetime/expiresIn/serverTimesupport (edge-info-server#158).Test plan
npm test -- src/__tests__/util/attestation.test.ts src/__tests__/util/attestationNativeBridge.test.tstsc/ lint on changed files;npm run fix-kotlin/ ktlint on attestation Kotlin modulesgenerateAssertionsignChallengeENV.INFO_SERVERat a local info server from edge-info-server#158; confirm Banxa/Simplex signing sendsx-attestation-tokenand fails loudly on 403