Page MenuHomePhabricator

[native] Make SecureStore methods static
ClosedPublic

Authored by michal on Nov 17 2023, 8:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 11:23 AM
Unknown Object (File)
Fri, Nov 1, 9:47 PM
Unknown Object (File)
Fri, Oct 25, 5:51 PM
Unknown Object (File)
Oct 13 2024, 1:09 AM
Unknown Object (File)
Oct 13 2024, 1:09 AM
Unknown Object (File)
Oct 13 2024, 1:09 AM
Unknown Object (File)
Oct 13 2024, 1:09 AM
Unknown Object (File)
Oct 13 2024, 1:02 AM
Subscribers

Details

Summary

ENG-1567

This will make it easier to expose SecureStore to Rust as our native Rust codebase as inherently stateless.

Test Plan

Tested on Android and iOS physical devices:

  • Add log to SQLiteQueryExecutor::initilize that prints maybeEncryptionKey read from Secure Store
  • Open the app -> encryption key is logged
  • Log out and log in to trigger creation of a new encryption key
  • Restart the app -> a different encryption key is logged

Tested notifications on physical devices:

  • Send notification - ensure it is displayed correctly.
  • Send notification to backgrounded app, kill keyserver in the terminal and open the app. Ensure that data delivered with notification are present even though the keyserver is not running.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/cpp/CommonCpp/Tools/CommSecureStore.h
13–15 ↗(On Diff #33387)

This needs to be inline because each variable can only be defined once. In case of instance variables this can be done in a header file (as each instance has a "separate" variable). In case of static variables their values normally would be specified in the .cpp files which is problematic for us as we have a separate implementations for iOS and Android. Fortunately we can use C++17 feature and mark them as inline which allows us the specify value in the header file.

C++ reference, section "Static data members"

Test plan should include an additional steps that ensure notifications functionality is not broken by those changes:

  1. Send notification - ensure it is displayed correctly.
  2. Send notification to backgrounded app, kill keyserver in the terminal and open the app. Ensure that data delivered with notification are present even though the keyserver is not running.
This revision is now accepted and ready to land.Nov 20 2023, 2:17 AM