Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 22, 2025

The FlutterSecureCredentialsStorage class previously created the underlying FlutterSecureStorage with default options, making it impossible to configure platform-specific settings like KeyChain accessibility on iOS.

This PR adds an optional storage parameter to the constructor, allowing users to provide a custom FlutterSecureStorage instance with specific configuration options:

// Default usage (unchanged)
const storage = FlutterSecureCredentialsStorage();

// Custom configuration with iOS KeyChain accessibility
const customStorage = FlutterSecureCredentialsStorage(
  storage: FlutterSecureStorage(
    iOptions: IOSOptions(
      accessibility: KeychainAccessibility.first_unlock_this_device,
    ),
    aOptions: AndroidOptions(
      encryptedSharedPreferences: true,
    ),
  ),
);

Key features:

  • Fully backward compatible - existing code works unchanged
  • Enables platform-specific configurations for Android, iOS, macOS, Linux, Windows, and Web
  • Well-documented with clear usage examples
  • Comprehensive test coverage

The implementation uses a private field to store the custom storage and a getter that falls back to the default instance when no custom storage is provided, ensuring minimal code changes while preserving all existing functionality.

Fixes #478.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl-ssl.google.com
    • Triggering command: curl -fsSL REDACTED (dns block)
  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)
  • https://api.github.com/repos/flutter/flutter/releases/latest
    • Triggering command: curl -s REDACTED (http block)
  • https://storage.googleapis.com/flutter_infra_release/flutter/1e9a811bf8e70466596bcf0ea3a8b5adb5f17f7f/dart-sdk-linux-x64.zip
    • Triggering command: curl --retry 3 --continue-at - --location --output /tmp/flutter/bin/cache/dart-sdk-linux-x64.zip REDACTED (http block)
  • https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.3-stable.tar.xz
    • Triggering command: wget -q REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] [login_client_flutter] Allow configuring FlutterSecureStorage Add configurable FlutterSecureStorage to FlutterSecureCredentialsStorage Aug 22, 2025
Copilot AI requested a review from PiotrRogulski August 22, 2025 09:24
Copilot finished work on behalf of PiotrRogulski August 22, 2025 09:24
Copilot AI requested a review from PiotrRogulski August 22, 2025 09:32
Copilot finished work on behalf of PiotrRogulski August 22, 2025 09:32
Copilot finished work on behalf of PiotrRogulski August 22, 2025 09:37
Copilot AI requested a review from PiotrRogulski August 22, 2025 09:37
@github-actions github-actions bot added the p: login_client_flutter Related to the login_client_flutter package label Aug 22, 2025
@PiotrRogulski
Copy link
Member

@copilot Update the changelog and the package version

…ble FlutterSecureStorage feature

Co-authored-by: PiotrRogulski <[email protected]>
Copy link
Contributor Author

Copilot AI commented Aug 22, 2025

@copilot Update the changelog and the package version

Updated package version to 3.1.0 and added changelog entry describing the new configurable FlutterSecureStorage feature. Commit 784bcd9

Copilot finished work on behalf of PiotrRogulski August 22, 2025 10:20
Copilot AI requested a review from PiotrRogulski August 22, 2025 10:26
Copilot finished work on behalf of PiotrRogulski August 22, 2025 10:26
Copilot AI requested a review from PiotrRogulski August 22, 2025 10:37
Copilot finished work on behalf of PiotrRogulski August 22, 2025 10:37
@PiotrRogulski PiotrRogulski requested a review from pdenert August 22, 2025 10:55
@PiotrRogulski PiotrRogulski marked this pull request as ready for review August 22, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: login_client_flutter Related to the login_client_flutter package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[login_client_flutter] Allow configuring FlutterSecureStorage

2 participants