Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.2.4 #349

Merged
merged 10 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/flutter_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ jobs:
api-level: [21,31] # [minSdk, most used, newest (30 is not working :(] 19 would be minSDK but does not support x86_64
target: [default] # [default, google_apis]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
java-version: '17.0.7'
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.16.0'
flutter-version: '3.16.5'
- run: "flutter upgrade"
- run: "flutter --version"
- run: "flutter pub get"
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ jobs:
timeout-minutes: 40

steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
java-version: '17.0.7'
- uses: subosito/flutter-action@v1
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.16.0'
flutter-version: '3.16.5'
- run: "flutter --version"
- run: flutter pub get
- run: flutter test
12 changes: 5 additions & 7 deletions .github/workflows/test-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ jobs:
strategy:
matrix:
api-level: [29]
target: [playstore]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
distribution: 'zulu'
java-version: '11'

- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.16.5'
channel: 'stable'

# Run integration test
- name: Run Flutter Driver tests
uses: reactivecircus/android-emulator-runner@v2
with:
target: ${{ matrix.target }}
api-level: ${{ matrix.api-level }}
arch: x86_64
profile: Nexus 6
Expand Down
16 changes: 14 additions & 2 deletions integration_test/two_step_rollout_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import 'package:privacyidea_authenticator/state_notifiers/settings_notifier.dart
import 'package:privacyidea_authenticator/state_notifiers/token_folder_notifier.dart';
import 'package:privacyidea_authenticator/state_notifiers/token_notifier.dart';
import 'package:privacyidea_authenticator/utils/app_customizer.dart';
import 'package:privacyidea_authenticator/utils/logger.dart';
import 'package:privacyidea_authenticator/utils/riverpod_providers.dart';
import 'package:privacyidea_authenticator/views/main_view/main_view.dart';
import 'package:privacyidea_authenticator/views/main_view/main_view_widgets/token_widgets/hotp_token_widgets/hotp_token_widget_tile.dart';
import 'package:privacyidea_authenticator/views/main_view/main_view_widgets/token_widgets/totp_token_widgets/totp_token_widget_tile.dart';
import 'package:privacyidea_authenticator/widgets/widget_keys.dart';

import '../test/tests_app_wrapper.dart';
Expand Down Expand Up @@ -74,40 +77,49 @@ void main() {

Future<void> _addTwoStepHotpTokenTest(WidgetTester tester) async {
await pumpUntilFindNWidgets(tester, find.byType(MainView), 1, const Duration(seconds: 10));
Logger.info('Adding HOTP Token');
globalRef!.read(tokenProvider.notifier).addTokenFromOtpAuth(
otpAuth:
'otpauth://hotp/OATH0001DBD0?secret=AALIBQJMOGEE7SAVEZ5D3K2ADO7MVFQD&counter=1&digits=6&issuer=privacyIDEA&2step_salt=8&2step_output=20&2step_difficulty=10000');
Logger.info('Finding phone part dialog');
await pumpUntilFindNWidgets(tester, find.text(AppLocalizationsEn().phonePart), 1, const Duration(seconds: 20));
expect(find.text(AppLocalizationsEn().phonePart), findsOneWidget);
final finder = find.byKey(twoStepDialogContent);
expect(finder, findsOneWidget);
final text = finder.evaluate().single.widget as Text;
final phonePart = text.data;
Logger.info('Checking phone part exists and has correct length');
expect(phonePart, isNotNull);
expect(phonePart, isNotEmpty);
// step_output=20
expect(phonePart!.replaceAll(' ', '').length, 20);
expect(find.text(AppLocalizationsEn().dismiss), findsOneWidget);
Logger.info('Dismissing dialog');
await tester.tap(find.text(AppLocalizationsEn().dismiss));
await tester.pumpAndSettle();
await pumpUntilFindNWidgets(tester, find.byType(HOTPTokenWidgetTile), 1, const Duration(seconds: 10));
}

Future<void> _addTwoStepTotpTokenTest(WidgetTester tester) async {
await pumpUntilFindNWidgets(tester, find.byType(MainView), 1, const Duration(seconds: 10));
Logger.info('Adding TOTP Token');
globalRef!.read(tokenProvider.notifier).addTokenFromOtpAuth(
otpAuth:
'otpauth://totp/TOTP00009D5F?secret=NZ4OPONKAAGDFN2QHV26ZWYVTLFER4C6&period=30&digits=6&issuer=privacyIDEA&2step_salt=8&2step_output=20&2step_difficulty=10000');
Logger.info('Finding phone part dialog');
await pumpUntilFindNWidgets(tester, find.text(AppLocalizationsEn().phonePart), 1, const Duration(seconds: 20));
expect(find.text(AppLocalizationsEn().phonePart), findsOneWidget);
final finder = find.byKey(twoStepDialogContent);
expect(finder, findsOneWidget);
final text = finder.evaluate().single.widget as Text;
final phonePart = text.data;
Logger.info('Checking phone part exists and has correct length');
expect(phonePart, isNotNull);
expect(phonePart, isNotEmpty);
// step_output=20
expect(phonePart!.replaceAll(' ', '').length, 20);
expect(find.text(AppLocalizationsEn().dismiss), findsOneWidget);
Logger.info('Dismissing dialog');
await tester.tap(find.text(AppLocalizationsEn().dismiss));
await tester.pumpAndSettle();
await pumpUntilFindNWidgets(tester, find.byType(TOTPTokenWidgetTile), 1, const Duration(seconds: 10));
//cannot "await tester.pumpAndSettle();" because of the infinite TOTP animation.
}
2 changes: 1 addition & 1 deletion integration_test/views_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Future<void> _popUntilMainView(WidgetTester tester) async {
}

Future<void> _licensesViewTest(WidgetTester tester) async {
await pumpUntilFindNWidgets(tester, find.byIcon(Icons.info_outline), 1, const Duration(seconds: 10));
await pumpUntilFindNWidgets(tester, find.byIcon(Icons.info_outline), 1, const Duration(seconds: 20));
await tester.tap(find.byIcon(Icons.info_outline));
await tester.pumpAndSettle();
expect(find.text(ApplicationCustomization.defaultCustomization.appName), findsOneWidget);
Expand Down
15 changes: 14 additions & 1 deletion lib/l10n/app_cs.arb
Original file line number Diff line number Diff line change
Expand Up @@ -476,5 +476,18 @@
"hidePushTokensDescription": "Skrýt push tokeny ze seznamu tokenů. Tím se tokeny neodstraní a budou stále viditelné na samostatné obrazovce.",
"settingsGroupGeneral": "Obecné informace",
"licensesAndVersion": "Licence a verze",
"privacyPolicy": "Zásady ochrany osobních údajů"
"privacyPolicy": "Zásady ochrany osobních údajů",
"legacySigningErrorTitle": "Při použití zastaralého tokenu došlo k chybě: {tokenLabel}",
"@legacySigningErrorTitle": {
"description": "Title of the error dialog that is shown when an error occurs while using a legacy token.",
"placeholders": {
"tokenLabel": {
"example": "PUSH1234A"
}
}
},
"legacySigningErrorMessage": "Token byl vytvořen v zastaralé verzi aplikace, což může vést k problémům při jeho používání.\nPokud problém přetrvává, doporučujeme vytvořit nový push token!",
"@legacySigningErrorMessage": {
"description": "Message of the error dialog that is shown when an error occurs while using a legacy token."
}
}
15 changes: 14 additions & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -455,5 +455,18 @@
"hidePushTokensDescription": "Push-Token aus der Token-Liste ausblenden. Dadurch werden die Token nicht gelöscht und sind weiterhin auf einem separaten Bildschirm sichtbar.",
"settingsGroupGeneral": "Allgemeines",
"licensesAndVersion": "Lizenzen und Version",
"privacyPolicy": "Datenschutzerklärung"
"privacyPolicy": "Datenschutzerklärung",
"legacySigningErrorTitle": "Bei der Verwendung des veralteten Tokens ist ein Fehler aufgetreten: {tokenLabel}",
"@legacySigningErrorTitle": {
"description": "Title of the error dialog that is shown when an error occurs while using a legacy token.",
"placeholders": {
"tokenLabel": {
"example": "PUSH1234A"
}
}
},
"legacySigningErrorMessage": "Der Token wurde in einer veralteten Version der App erstellt, was zu Problemen bei der Verwendung führen kann. Es wird empfohlen, einen neuen Push-Token zu erstellen, wenn das Problem weiterhin besteht!",
"@legacySigningErrorMessage": {
"description": "Message of the error dialog that is shown when an error occurs while using a legacy token."
}
}
15 changes: 14 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -467,5 +467,18 @@
"hidePushTokensDescription": "Hide push tokens from the token list. This will not delete the tokens and they will still be visible on a separate screen.",
"settingsGroupGeneral": "General",
"licensesAndVersion": "Licenses and version",
"privacyPolicy": "Privacy policy"
"privacyPolicy": "Privacy policy",
"legacySigningErrorTitle": "An error occured while using the legacy token: {tokenLabel}",
"@legacySigningErrorTitle": {
"description": "Title of the error dialog that is shown when an error occurs while using a legacy token.",
"placeholders": {
"tokenLabel": {
"example": "PUSH1234A"
}
}
},
"legacySigningErrorMessage": "The token was enrolled in a old version of this app, which may cause trouble using it.\nIt is suggested to enroll a new push token if the problem persist!",
"@legacySigningErrorMessage": {
"description": "Message of the error dialog that is shown when an error occurs while using a legacy token."
}
}
15 changes: 14 additions & 1 deletion lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -472,5 +472,18 @@
"hidePushTokensDescription": "Ocultar tokens push de la lista de tokens. Esto no borrará los tokens y seguirán siendo visibles en una pantalla aparte",
"settingsGroupGeneral": "Información general",
"licensesAndVersion": "Licencias y versión",
"privacyPolicy": "Política de privacidad"
"privacyPolicy": "Política de privacidad",
"legacySigningErrorTitle": "Se ha producido un error al utilizar el token obsoleto: {tokenLabel}",
"@legacySigningErrorTitle": {
"description": "Title of the error dialog that is shown when an error occurs while using a legacy token.",
"placeholders": {
"tokenLabel": {
"example": "PUSH1234A"
}
}
},
"legacySigningErrorMessage": "El token se creó en una versión obsoleta de la aplicación, lo que puede provocar problemas al utilizarlo.\nSe recomienda crear un nuevo token push si el problema persiste.",
"@legacySigningErrorMessage": {
"description": "Message of the error dialog that is shown when an error occurs while using a legacy token."
}
}
15 changes: 14 additions & 1 deletion lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -477,5 +477,18 @@
"hidePushTokensDescription": "Masquer les jetons de poussée de la liste des jetons. Cela ne supprimera pas les jetons et ils seront toujours visibles sur un écran séparé",
"settingsGroupGeneral": "Généralités",
"licensesAndVersion": "Licences et version",
"privacyPolicy": "Politique de confidentialité"
"privacyPolicy": "Politique de confidentialité",
"legacySigningErrorTitle": "Une erreur s'est produite lors de l'utilisation du jeton obsolète : {tokenLabel}",
"@legacySigningErrorTitle": {
"description": "Title of the error dialog that is shown when an error occurs while using a legacy token.",
"placeholders": {
"tokenLabel": {
"example": "PUSH1234A"
}
}
},
"legacySigningErrorMessage": "Le token a été créé dans une version obsolète de l'application, ce qui peut entraîner des problèmes d'utilisation.\nIl est recommandé de créer un nouveau token push si le problème persiste !",
"@legacySigningErrorMessage": {
"description": "Message of the error dialog that is shown when an error occurs while using a legacy token."
}
}
12 changes: 12 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,18 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Privacy policy'**
String get privacyPolicy;

/// Title of the error dialog that is shown when an error occurs while using a legacy token.
///
/// In en, this message translates to:
/// **'An error occured while using the legacy token: {tokenLabel}'**
String legacySigningErrorTitle(Object tokenLabel);

/// Message of the error dialog that is shown when an error occurs while using a legacy token.
///
/// In en, this message translates to:
/// **'The token was enrolled in a old version of this app, which may cause trouble using it.\nIt is suggested to enroll a new push token if the problem persist!'**
String get legacySigningErrorMessage;
}

class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
Expand Down
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_cs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,12 @@ class AppLocalizationsCs extends AppLocalizations {

@override
String get privacyPolicy => 'Zásady ochrany osobních údajů';

@override
String legacySigningErrorTitle(Object tokenLabel) {
return 'Při použití zastaralého tokenu došlo k chybě: $tokenLabel';
}

@override
String get legacySigningErrorMessage => 'Token byl vytvořen v zastaralé verzi aplikace, což může vést k problémům při jeho používání.\nPokud problém přetrvává, doporučujeme vytvořit nový push token!';
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,12 @@ class AppLocalizationsDe extends AppLocalizations {

@override
String get privacyPolicy => 'Datenschutzerklärung';

@override
String legacySigningErrorTitle(Object tokenLabel) {
return 'Bei der Verwendung des veralteten Tokens ist ein Fehler aufgetreten: $tokenLabel';
}

@override
String get legacySigningErrorMessage => 'Der Token wurde in einer veralteten Version der App erstellt, was zu Problemen bei der Verwendung führen kann. Es wird empfohlen, einen neuen Push-Token zu erstellen, wenn das Problem weiterhin besteht!';
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,12 @@ class AppLocalizationsEn extends AppLocalizations {

@override
String get privacyPolicy => 'Privacy policy';

@override
String legacySigningErrorTitle(Object tokenLabel) {
return 'An error occured while using the legacy token: $tokenLabel';
}

@override
String get legacySigningErrorMessage => 'The token was enrolled in a old version of this app, which may cause trouble using it.\nIt is suggested to enroll a new push token if the problem persist!';
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,12 @@ class AppLocalizationsEs extends AppLocalizations {

@override
String get privacyPolicy => 'Política de privacidad';

@override
String legacySigningErrorTitle(Object tokenLabel) {
return 'Se ha producido un error al utilizar el token obsoleto: $tokenLabel';
}

@override
String get legacySigningErrorMessage => 'El token se creó en una versión obsoleta de la aplicación, lo que puede provocar problemas al utilizarlo.\nSe recomienda crear un nuevo token push si el problema persiste.';
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,12 @@ class AppLocalizationsFr extends AppLocalizations {

@override
String get privacyPolicy => 'Politique de confidentialité';

@override
String legacySigningErrorTitle(Object tokenLabel) {
return 'Une erreur s\'est produite lors de l\'utilisation du jeton obsolète : $tokenLabel';
}

@override
String get legacySigningErrorMessage => 'Le token a été créé dans une version obsolète de l\'application, ce qui peut entraîner des problèmes d\'utilisation.\nIl est recommandé de créer un nouveau token push si le problème persiste !';
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_nl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,12 @@ class AppLocalizationsNl extends AppLocalizations {

@override
String get privacyPolicy => 'Privacybeleid';

@override
String legacySigningErrorTitle(Object tokenLabel) {
return 'Er is een fout opgetreden bij het gebruik van het verouderde token: $tokenLabel';
}

@override
String get legacySigningErrorMessage => 'Het token is aangemaakt in een verouderde versie van de app, wat kan leiden tot problemen bij het gebruik ervan.\nHet wordt aanbevolen om een nieuw push token aan te maken als het probleem zich blijft voordoen!';
}
8 changes: 8 additions & 0 deletions lib/l10n/app_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,4 +467,12 @@ class AppLocalizationsPl extends AppLocalizations {

@override
String get privacyPolicy => 'Polityka prywatności';

@override
String legacySigningErrorTitle(Object tokenLabel) {
return 'Wystąpił błąd podczas korzystania z przestarzałego tokena: $tokenLabel';
}

@override
String get legacySigningErrorMessage => 'Token został utworzony w nieaktualnej wersji aplikacji, co może prowadzić do problemów podczas korzystania z niego.\nZaleca się utworzenie nowego tokena push, jeśli problem nadal występuje!';
}
15 changes: 14 additions & 1 deletion lib/l10n/app_nl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -466,5 +466,18 @@
"hidePushTokensDescription": "Verberg push tokens uit de token lijst. Hierdoor worden de tokens niet verwijderd en blijven ze zichtbaar op een apart scherm.",
"settingsGroupGeneral": "Algemene informatie",
"licensesAndVersion": "Licenties en versie",
"privacyPolicy": "Privacybeleid"
"privacyPolicy": "Privacybeleid",
"legacySigningErrorTitle": "Er is een fout opgetreden bij het gebruik van het verouderde token: {tokenLabel}",
"@legacySigningErrorTitle": {
"description": "Title of the error dialog that is shown when an error occurs while using a legacy token.",
"placeholders": {
"tokenLabel": {
"example": "PUSH1234A"
}
}
},
"legacySigningErrorMessage": "Het token is aangemaakt in een verouderde versie van de app, wat kan leiden tot problemen bij het gebruik ervan.\nHet wordt aanbevolen om een nieuw push token aan te maken als het probleem zich blijft voordoen!",
"@legacySigningErrorMessage": {
"description": "Message of the error dialog that is shown when an error occurs while using a legacy token."
}
}
Loading
Loading