privacybydesign / irmamobile

IRMA app for iOS and Android
Other
79 stars 20 forks source link

irmamobile

Authentication made easy, privacy-friendly, and secure

Yivi, formerly known as IRMA, offers a privacy-friendly, flexible and secure solution to many authentication problems, putting the user in full control over his/her data.

The Yivi app manages the user's cards containing personal data. It can receive new cards, selectively disclose data contained in the user's cards to others, and attaching data to signed statements. These data can be relevant properties, such as: "I am over 18", "my name is ..." and "I am entitled to access ....". They are only stored on the user's device and nowhere else.

NOTE: During the transition period in which we change IRMA to Yivi, it can happen that both names are used interchangeably.

<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" alt="Get it on Google Play" height="80"> <img src="https://privacybydesign.foundation/images/app-store-badge-padded.png" alt="Get it on Apple App Store" height="80"> <img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">

Screenshot of the Yivi app on Android, showing the introduction screen at the start of the onboarding process  Screenshot of the Yivi app on Android, showing the home screen with recent activities  Screenshot of the Yivi app on Android, showing the issue wizard at the point where the user is collecting data  Screenshot of the Yivi app on Android, showing the issue wizard screen at the point where the user is about to share the collected data 

Development setup

JSON serialization code

This project uses json_serializer. To re-generate serialization code, run ./codegen.sh

Integration tests

The integration tests are in development, so not all use cases are covered yet.

As preliminary to run the integration tests, you need a fully configured irmamobile development setup.

Run locally using an iOS/Android simulator

The full set of integration tests can be started in the following way:

  # For an iOS testing device/simulator
  flutter test integration_test/test_all.dart
  # For an Android testing device/simulator
  flutter test integration_test/test_all.dart --flavor=alpha

You can also run the integration tests in a specific test file only. For example:

  flutter test integration_test/issuance_test.dart

Note: flutter test also supports directory paths as argument. When doing this, all tests in that particular directory are run. However, a new build is made for every test file. Running multiple tests in this way takes much more time for that reason.

Run on Android natively

To natively run the integration tests on Android, you can use the command below.

  flutter pub get
  (cd android && ./gradlew app:connectedAlphaDebugAndroidTest -Ptarget=`pwd`/../integration_test/test_all.dart)

You can also manually build APKs for testing using Fastlane.

  bundle exec fastlane android_build_integration_test

The APKs can be found in ./fastlane/build. They can be uploaded to services like Google Firebase. You can also run them locally using the following commands:

  adb install ./fastlane/build/app-alpha-debug.apk
  adb install ./fastlane/build/app-alpha-debug-androidTest.apk
  adb shell am instrument -w -r foundation.privacybydesign.irmamobile.alpha.test/androidx.test.runner.AndroidJUnitRunner

Run on iOS natively

To natively run the integration tests as XCTests on iOS, you can do this using XCode.

At first, you need to choose which test you want to run. For example, to run the tests in issuance_test.dart you execute:

  flutter build ios integration_test/issuance_test.dart --config-only

The tests can be started by opening the ios/Runner.xcworkspace in XCode and then start the tests via Product > Test.

You can use testing services like Google Firebase to easily run your tests on physical devices. The testing service of your choice needs to support XCTest (not to be confused with XCUITest). You can make a build for this purpose using Fastlane:

  bundle exec fastlane ios_build_integration_test

The integration test build should be provisioned with at least a development provisioning profile. More information about how to set the provisioning profile can be found in the Fastlane documentation.

The generated ./fastlane/build/ios_tests.zip can be uploaded to Google Firebase.

Fastlane

For build automation we use Fastlane scripting. These scripts are used by our CI tooling (i.e. the GitHub Actions workflows in .github/workflows). Documentation about the Fastlane scripting can be found here.

Troubleshooting