Skip to content

Conversation

ahmeddhus
Copy link

Description

This PR adds support for storing keychain items using the Secure Enclave on iOS and macOS.
A new useSecureEnclave boolean option is introduced in IOSOptions and AppleOptions.
When enabled, secrets are stored using Secure Enclave-backed keys if available.
If Secure Enclave is unavailable or unwrapping fails, the plugin falls back to standard keychain storage.

Changes

  • Added useSecureEnclave to Dart options (IOSOptions, AppleOptions)
  • Passed the flag to native code via method channel
  • Updated iOS/macOS native implementations to use Secure Enclave when requested
  • Implemented fallback logic for devices without Secure Enclave
  • Updated integration tests to cover Secure Enclave and fallback scenarios
  • Updated documentation and code comments

Motivation

Addresses #917
Provides stronger security for sensitive data on supported Apple devices.

Checklist

  • All tests pass
  • Documentation updated
  • Backwards compatible

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.78%. Comparing base (71b75a3) to head (649c4e6).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #989      +/-   ##
===========================================
+ Coverage    82.66%   82.78%   +0.11%     
===========================================
  Files            9        9              
  Lines          150      151       +1     
===========================================
+ Hits           124      125       +1     
  Misses          26       26              
Flag Coverage Δ
unittests 82.78% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants