Skip to content

Add Android Play Integrity verifier and refresh path#22

Merged
aliXsed merged 3 commits into
mainfrom
feat/android-play-integrity-verifier
Jul 17, 2026
Merged

Add Android Play Integrity verifier and refresh path#22
aliXsed merged 3 commits into
mainfrom
feat/android-play-integrity-verifier

Conversation

@aliXsed

@aliXsed aliXsed commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Trait-mocked Google decodeIntegrityToken client (reqwest + gcp_auth ADC) with a consecutive-failure circuit breaker, plus a local verdict policy engine (PLAY_RECOGNIZED, device floor, package/cert trust, 300s freshness, iteration-1 requestHash = SHA256(challenge ‖ wallet)).
  • POST /v1/attest/android and Android support on POST /v1/attest/refresh; on transient Google failures, extend an existing Android record’s grace once and return a retryable error without breaking the wallet session.
  • Synthetic Play Integrity fixture (regenerated for the iteration-1 hash) and integration tests that inject MockPlayIntegrityClient so CI never needs GCP credentials.

Stacked on #21 (feat/ios-app-attest-verifier). Retarget to main after that lands.

Test plan

  • cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --check
  • Confirm fixture policy unit tests pass (evaluate_verdict / JWE precheck)
  • Confirm /v1/attest/android with a mocked verdict mints tier=attested / att.platform=android
  • Confirm Google outage path returns 5xx/429 and sets grace_extended only once
  • Confirm malformed integrity tokens are rejected before any decode call

Made with Cursor

@aliXsed
aliXsed force-pushed the feat/android-play-integrity-verifier branch from 3a4a018 to 3e2a46a Compare July 17, 2026 01:55
Base automatically changed from feat/ios-app-attest-verifier to main July 17, 2026 01:57
aliXsed and others added 3 commits July 17, 2026 13:57
Promote reqwest, add gcp_auth, and land a trait-mocked Google decode
path plus iteration-1 requestHash binding against the synthetic fixture.

Co-authored-by: Cursor <[email protected]>
Expose POST /v1/attest/android and Android refresh, fail-degrade on
Google outages by extending grace once, and trip a decode circuit.

Co-authored-by: Cursor <[email protected]>
Integration tests drive a mocked decode client so CI never depends on
ADC while still exercising token minting and one-shot grace extension.

Co-authored-by: Cursor <[email protected]>
@aliXsed
aliXsed force-pushed the feat/android-play-integrity-verifier branch from 3e2a46a to 0a3a160 Compare July 17, 2026 01:57
@github-actions

Copy link
Copy Markdown

Coverage report

Thresholds: 80% line · 78% region (condition)

✅ Coverage meets the required threshold.

   13|      1|            .init(),
   14|      3|        _ => registry.with(tracing_subscriber::fmt::layer()).init(),
   15|       |    }
   16|      4|}

@aliXsed
aliXsed merged commit 4977149 into main Jul 17, 2026
5 checks passed
@aliXsed
aliXsed deleted the feat/android-play-integrity-verifier branch July 17, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant