diff --git a/lib/api/impl/privacy_idea_container_api.dart b/lib/api/impl/privacy_idea_container_api.dart index 6626dae2..81701a77 100644 --- a/lib/api/impl/privacy_idea_container_api.dart +++ b/lib/api/impl/privacy_idea_container_api.dart @@ -45,9 +45,9 @@ import '../../utils/logger.dart'; import '../../widgets/dialog_widgets/enter_passphrase_dialog.dart'; import '../interfaces/container_api.dart'; -class PrivacyIdeaContainerApi implements ContainerApi { +class PiContainerApi implements TokenContainerApi { final PrivacyideaIOClient _ioClient; - const PrivacyIdeaContainerApi({required PrivacyideaIOClient ioClient}) : _ioClient = ioClient; + const PiContainerApi({required PrivacyideaIOClient ioClient}) : _ioClient = ioClient; // Returns a tuple of updated/new tokens and serials of deleted tokens @override diff --git a/lib/api/interfaces/container_api.dart b/lib/api/interfaces/container_api.dart index 196979be..5c8ddb69 100644 --- a/lib/api/interfaces/container_api.dart +++ b/lib/api/interfaces/container_api.dart @@ -24,7 +24,7 @@ import '../../model/token_container.dart'; import '../../model/tokens/token.dart'; import '../../utils/ecc_utils.dart'; -abstract class ContainerApi { +abstract class TokenContainerApi { Future finalizeContainer(TokenContainerUnfinalized container, EccUtils eccUtils); Future getTransferQrData(TokenContainerFinalized container); Future<(List, List)?> sync(TokenContainerFinalized container, TokenState tokenState); diff --git a/lib/interfaces/api_endpoint.dart b/lib/interfaces/api_endpoint.dart deleted file mode 100644 index 544cbbf4..00000000 --- a/lib/interfaces/api_endpoint.dart +++ /dev/null @@ -1,27 +0,0 @@ -/* - * privacyIDEA Authenticator - * - * Author: Frank Merkel - * - * Copyright (c) 2024 NetKnights GmbH - * - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import '../utils/privacyidea_io_client.dart'; - -abstract class ApiEndpioint { - ApiEndpioint(PrivacyideaIOClient ioClient); - Future fetch(); - Future sync(Credential container, Data data); -} diff --git a/lib/model/riverpod_states/progress_state.freezed.dart b/lib/model/riverpod_states/progress_state.freezed.dart index 4b087ee8..ae8d6890 100644 --- a/lib/model/riverpod_states/progress_state.freezed.dart +++ b/lib/model/riverpod_states/progress_state.freezed.dart @@ -60,18 +60,22 @@ mixin _$ProgressState { /// Create a copy of ProgressState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) - $ProgressStateCopyWith get copyWith => throw _privateConstructorUsedError; + $ProgressStateCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class $ProgressStateCopyWith<$Res> { - factory $ProgressStateCopyWith(ProgressState value, $Res Function(ProgressState) then) = _$ProgressStateCopyWithImpl<$Res, ProgressState>; + factory $ProgressStateCopyWith( + ProgressState value, $Res Function(ProgressState) then) = + _$ProgressStateCopyWithImpl<$Res, ProgressState>; @useResult $Res call({int max, int value}); } /// @nodoc -class _$ProgressStateCopyWithImpl<$Res, $Val extends ProgressState> implements $ProgressStateCopyWith<$Res> { +class _$ProgressStateCopyWithImpl<$Res, $Val extends ProgressState> + implements $ProgressStateCopyWith<$Res> { _$ProgressStateCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -101,8 +105,11 @@ class _$ProgressStateCopyWithImpl<$Res, $Val extends ProgressState> implements $ } /// @nodoc -abstract class _$$ProgressStateUninitializedImplCopyWith<$Res> implements $ProgressStateCopyWith<$Res> { - factory _$$ProgressStateUninitializedImplCopyWith(_$ProgressStateUninitializedImpl value, $Res Function(_$ProgressStateUninitializedImpl) then) = +abstract class _$$ProgressStateUninitializedImplCopyWith<$Res> + implements $ProgressStateCopyWith<$Res> { + factory _$$ProgressStateUninitializedImplCopyWith( + _$ProgressStateUninitializedImpl value, + $Res Function(_$ProgressStateUninitializedImpl) then) = __$$ProgressStateUninitializedImplCopyWithImpl<$Res>; @override @useResult @@ -110,9 +117,12 @@ abstract class _$$ProgressStateUninitializedImplCopyWith<$Res> implements $Progr } /// @nodoc -class __$$ProgressStateUninitializedImplCopyWithImpl<$Res> extends _$ProgressStateCopyWithImpl<$Res, _$ProgressStateUninitializedImpl> +class __$$ProgressStateUninitializedImplCopyWithImpl<$Res> + extends _$ProgressStateCopyWithImpl<$Res, _$ProgressStateUninitializedImpl> implements _$$ProgressStateUninitializedImplCopyWith<$Res> { - __$$ProgressStateUninitializedImplCopyWithImpl(_$ProgressStateUninitializedImpl _value, $Res Function(_$ProgressStateUninitializedImpl) _then) + __$$ProgressStateUninitializedImplCopyWithImpl( + _$ProgressStateUninitializedImpl _value, + $Res Function(_$ProgressStateUninitializedImpl) _then) : super(_value, _then); /// Create a copy of ProgressState @@ -139,7 +149,8 @@ class __$$ProgressStateUninitializedImplCopyWithImpl<$Res> extends _$ProgressSta /// @nodoc class _$ProgressStateUninitializedImpl extends ProgressStateUninitialized { - const _$ProgressStateUninitializedImpl({this.max = 0, this.value = 0}) : super._(); + const _$ProgressStateUninitializedImpl({this.max = 0, this.value = 0}) + : super._(); @override @JsonKey() @@ -170,8 +181,9 @@ class _$ProgressStateUninitializedImpl extends ProgressStateUninitialized { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProgressStateUninitializedImplCopyWith<_$ProgressStateUninitializedImpl> get copyWith => - __$$ProgressStateUninitializedImplCopyWithImpl<_$ProgressStateUninitializedImpl>(this, _$identity); + _$$ProgressStateUninitializedImplCopyWith<_$ProgressStateUninitializedImpl> + get copyWith => __$$ProgressStateUninitializedImplCopyWithImpl< + _$ProgressStateUninitializedImpl>(this, _$identity); @override @optionalTypeArgs @@ -237,7 +249,8 @@ class _$ProgressStateUninitializedImpl extends ProgressStateUninitialized { } abstract class ProgressStateUninitialized extends ProgressState { - const factory ProgressStateUninitialized({final int max, final int value}) = _$ProgressStateUninitializedImpl; + const factory ProgressStateUninitialized({final int max, final int value}) = + _$ProgressStateUninitializedImpl; const ProgressStateUninitialized._() : super._(); @override @@ -249,20 +262,28 @@ abstract class ProgressStateUninitialized extends ProgressState { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProgressStateUninitializedImplCopyWith<_$ProgressStateUninitializedImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProgressStateUninitializedImplCopyWith<_$ProgressStateUninitializedImpl> + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ProgressStateImplCopyWith<$Res> implements $ProgressStateCopyWith<$Res> { - factory _$$ProgressStateImplCopyWith(_$ProgressStateImpl value, $Res Function(_$ProgressStateImpl) then) = __$$ProgressStateImplCopyWithImpl<$Res>; +abstract class _$$ProgressStateImplCopyWith<$Res> + implements $ProgressStateCopyWith<$Res> { + factory _$$ProgressStateImplCopyWith( + _$ProgressStateImpl value, $Res Function(_$ProgressStateImpl) then) = + __$$ProgressStateImplCopyWithImpl<$Res>; @override @useResult $Res call({int max, int value}); } /// @nodoc -class __$$ProgressStateImplCopyWithImpl<$Res> extends _$ProgressStateCopyWithImpl<$Res, _$ProgressStateImpl> implements _$$ProgressStateImplCopyWith<$Res> { - __$$ProgressStateImplCopyWithImpl(_$ProgressStateImpl _value, $Res Function(_$ProgressStateImpl) _then) : super(_value, _then); +class __$$ProgressStateImplCopyWithImpl<$Res> + extends _$ProgressStateCopyWithImpl<$Res, _$ProgressStateImpl> + implements _$$ProgressStateImplCopyWith<$Res> { + __$$ProgressStateImplCopyWithImpl( + _$ProgressStateImpl _value, $Res Function(_$ProgressStateImpl) _then) + : super(_value, _then); /// Create a copy of ProgressState /// with the given fields replaced by the non-null parameter values. @@ -320,7 +341,8 @@ class _$ProgressStateImpl extends _ProgressState { @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$ProgressStateImplCopyWith<_$ProgressStateImpl> get copyWith => __$$ProgressStateImplCopyWithImpl<_$ProgressStateImpl>(this, _$identity); + _$$ProgressStateImplCopyWith<_$ProgressStateImpl> get copyWith => + __$$ProgressStateImplCopyWithImpl<_$ProgressStateImpl>(this, _$identity); @override @optionalTypeArgs @@ -386,7 +408,8 @@ class _$ProgressStateImpl extends _ProgressState { } abstract class _ProgressState extends ProgressState { - const factory _ProgressState({required final int max, required final int value}) = _$ProgressStateImpl; + const factory _ProgressState( + {required final int max, required final int value}) = _$ProgressStateImpl; const _ProgressState._() : super._(); @override @@ -398,5 +421,6 @@ abstract class _ProgressState extends ProgressState { /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$ProgressStateImplCopyWith<_$ProgressStateImpl> get copyWith => throw _privateConstructorUsedError; + _$$ProgressStateImplCopyWith<_$ProgressStateImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/app_constraints_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/app_constraints_notifier.g.dart index 4cdde41d..3713f8cd 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/app_constraints_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/app_constraints_notifier.g.dart @@ -24,4 +24,4 @@ final appConstraintsNotifierProvider = typedef _$AppConstraintsNotifier = Notifier; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/application_customizer_provider.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/application_customizer_provider.g.dart index 9ac36527..065eeafb 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/application_customizer_provider.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/application_customizer_provider.g.dart @@ -27,4 +27,4 @@ final applicationCustomizerProvider = AutoDisposeAsyncNotifierProvider< typedef _$ApplicationCustomizer = AutoDisposeAsyncNotifier; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/deeplink_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/deeplink_notifier.g.dart index 2180d3ad..70f0b43c 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/deeplink_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/deeplink_notifier.g.dart @@ -23,4 +23,4 @@ final deeplinkNotifierProvider = typedef _$DeeplinkNotifier = StreamNotifier; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.g.dart index c12b9856..ce8c35b8 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.g.dart @@ -158,6 +158,8 @@ class IntroductionNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin IntroductionNotifierRef on AsyncNotifierProviderRef { /// The parameter `repo` of this provider. IntroductionRepository get repo; @@ -172,4 +174,4 @@ class _IntroductionNotifierProviderElement extends AsyncNotifierProviderElement< (origin as IntroductionNotifierProvider).repo; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.g.dart index d9fc9597..9ddf6149 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.g.dart @@ -206,6 +206,8 @@ class PushRequestNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin PushRequestNotifierRef on AsyncNotifierProviderRef { /// The parameter `rsaUtils` of this provider. RsaUtils get rsaUtils; @@ -238,4 +240,4 @@ class _PushRequestNotifierProviderElement (origin as PushRequestNotifierProvider).pushRepo; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.g.dart index 5b67e46e..f1515735 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.g.dart @@ -157,6 +157,8 @@ class SettingsNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin SettingsNotifierRef on AsyncNotifierProviderRef { /// The parameter `repo` of this provider. SettingsRepository get repo; @@ -171,4 +173,4 @@ class _SettingsNotifierProviderElement SettingsRepository get repo => (origin as SettingsNotifierProvider).repo; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.g.dart index 14b306a7..af9de16b 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.g.dart @@ -19,6 +19,8 @@ final sortablesProvider = AutoDisposeProvider>.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef SortablesRef = AutoDisposeProviderRef>; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart index f9697828..240505a9 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart @@ -23,10 +23,10 @@ import 'package:basic_utils/basic_utils.dart'; import 'package:collection/collection.dart'; import 'package:http/http.dart'; import 'package:mutex/mutex.dart'; +import 'package:privacyidea_authenticator/model/extensions/enums/rollout_state_extension.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../../../../../../../model/exception_errors/pi_server_result_error.dart'; -import '../../../../../../../model/extensions/enums/rollout_state_extension.dart'; import '../../../../../../../model/processor_result.dart'; import '../../../../../../../model/tokens/token.dart'; import '../../../../../../../utils/globals.dart'; @@ -57,7 +57,7 @@ part 'token_container_notifier.g.dart'; final tokenContainerProvider = tokenContainerNotifierProviderOf( repo: SecureTokenContainerRepository(), - containerApi: const PrivacyIdeaContainerApi(ioClient: PrivacyideaIOClient()), + containerApi: const PiContainerApi(ioClient: PrivacyideaIOClient()), eccUtils: const EccUtils(), ); @@ -68,7 +68,7 @@ class TokenContainerNotifier extends _$TokenContainerNotifier with ResultHandler TokenContainerNotifier({ TokenContainerRepository? repoOverride, - ContainerApi? containerApiOverride, + TokenContainerApi? containerApiOverride, EccUtils? eccUtilsOverride, }) : _repoOverride = repoOverride, _containerApiOverride = containerApiOverride, @@ -80,9 +80,9 @@ class TokenContainerNotifier extends _$TokenContainerNotifier with ResultHandler final TokenContainerRepository? _repoOverride; @override - PrivacyIdeaContainerApi get containerApi => _containerApi; - late PrivacyIdeaContainerApi _containerApi; - final PrivacyIdeaContainerApi? _containerApiOverride; + TokenContainerApi get containerApi => _containerApi; + late TokenContainerApi _containerApi; + final TokenContainerApi? _containerApiOverride; @override EccUtils get eccUtils => _eccUtils; @@ -92,7 +92,7 @@ class TokenContainerNotifier extends _$TokenContainerNotifier with ResultHandler @override Future build({ required TokenContainerRepository repo, - required PrivacyIdeaContainerApi containerApi, + required TokenContainerApi containerApi, required EccUtils eccUtils, }) async { await _stateMutex.acquire(); diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart index 2d1213aa..dec08f5e 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart @@ -7,7 +7,7 @@ part of 'token_container_notifier.dart'; // ************************************************************************** String _$tokenContainerNotifierHash() => - r'40d7e6593f060ef97762b0fe3aa3942cfb5b277a'; + r'a2040d0fdc2f8fb3264fb5820342a234f2e77045'; /// Copied from Dart SDK class _SystemHash { @@ -33,12 +33,12 @@ class _SystemHash { abstract class _$TokenContainerNotifier extends BuildlessAsyncNotifier { late final TokenContainerRepository repo; - late final PrivacyIdeaContainerApi containerApi; + late final TokenContainerApi containerApi; late final EccUtils eccUtils; FutureOr build({ required TokenContainerRepository repo, - required PrivacyIdeaContainerApi containerApi, + required TokenContainerApi containerApi, required EccUtils eccUtils, }); } @@ -56,7 +56,7 @@ class TokenContainerNotifierFamily /// See also [TokenContainerNotifier]. TokenContainerNotifierProvider call({ required TokenContainerRepository repo, - required PrivacyIdeaContainerApi containerApi, + required TokenContainerApi containerApi, required EccUtils eccUtils, }) { return TokenContainerNotifierProvider( @@ -98,7 +98,7 @@ class TokenContainerNotifierProvider extends AsyncNotifierProviderImpl< /// See also [TokenContainerNotifier]. TokenContainerNotifierProvider({ required TokenContainerRepository repo, - required PrivacyIdeaContainerApi containerApi, + required TokenContainerApi containerApi, required EccUtils eccUtils, }) : this._internal( () => TokenContainerNotifier() @@ -132,7 +132,7 @@ class TokenContainerNotifierProvider extends AsyncNotifierProviderImpl< }) : super.internal(); final TokenContainerRepository repo; - final PrivacyIdeaContainerApi containerApi; + final TokenContainerApi containerApi; final EccUtils eccUtils; @override @@ -192,13 +192,15 @@ class TokenContainerNotifierProvider extends AsyncNotifierProviderImpl< } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin TokenContainerNotifierRef on AsyncNotifierProviderRef { /// The parameter `repo` of this provider. TokenContainerRepository get repo; /// The parameter `containerApi` of this provider. - PrivacyIdeaContainerApi get containerApi; + TokenContainerApi get containerApi; /// The parameter `eccUtils` of this provider. EccUtils get eccUtils; @@ -213,10 +215,10 @@ class _TokenContainerNotifierProviderElement TokenContainerRepository get repo => (origin as TokenContainerNotifierProvider).repo; @override - PrivacyIdeaContainerApi get containerApi => + TokenContainerApi get containerApi => (origin as TokenContainerNotifierProvider).containerApi; @override EccUtils get eccUtils => (origin as TokenContainerNotifierProvider).eccUtils; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.g.dart index 22b30bce..931ce529 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.g.dart @@ -158,6 +158,8 @@ class TokenFolderNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin TokenFolderNotifierRef on NotifierProviderRef { /// The parameter `repo` of this provider. TokenFolderRepository get repo; @@ -173,4 +175,4 @@ class _TokenFolderNotifierProviderElement (origin as TokenFolderNotifierProvider).repo; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.g.dart index ae4a7e33..e32060cb 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.g.dart @@ -6,7 +6,7 @@ part of 'token_notifier.dart'; // RiverpodGenerator // ************************************************************************** -String _$tokenNotifierHash() => r'dad3219c8ac92b3881adfa0c13386f508c30dea9'; +String _$tokenNotifierHash() => r'042e8f25ab54d1822f980797f4bfd4fa3dbb73ec'; /// Copied from Dart SDK class _SystemHash { @@ -203,6 +203,8 @@ class TokenNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin TokenNotifierRef on NotifierProviderRef { /// The parameter `repo` of this provider. TokenRepository get repo; @@ -234,4 +236,4 @@ class _TokenNotifierProviderElement (origin as TokenNotifierProvider).firebaseUtils; } // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/pubspec.lock b/pubspec.lock index 040f460e..fa275c08 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -30,6 +30,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.7.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + url: "https://pub.dev" + source: hosted + version: "0.11.3" app_links: dependency: "direct main" description: @@ -254,6 +262,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" cli_util: dependency: transitive description: @@ -342,6 +358,38 @@ packages: url: "https://pub.dev" source: hosted version: "2.7.0" + custom_lint: + dependency: transitive + description: + name: custom_lint + sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_builder: + dependency: transitive + description: + name: custom_lint_builder + sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" + url: "https://pub.dev" + source: hosted + version: "1.0.0+6.7.0" dart_style: dependency: transitive description: @@ -727,6 +775,14 @@ packages: url: "https://pub.dev" source: hosted version: "10.7.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e" + url: "https://pub.dev" + source: hosted + version: "2.5.7" freezed_annotation: dependency: "direct main" description: @@ -788,6 +844,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.0" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e + url: "https://pub.dev" + source: hosted + version: "4.2.0" http: dependency: "direct main" description: @@ -1345,6 +1409,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.6.1" + riverpod_analyzer_utils: + dependency: transitive + description: + name: riverpod_analyzer_utils + sha256: dc53a659cb543b203cdc35cd4e942ed08ea893eb6ef12029301323bdf18c5d95 + url: "https://pub.dev" + source: hosted + version: "0.5.7" riverpod_annotation: dependency: "direct main" description: @@ -1353,6 +1425,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.6.1" + riverpod_generator: + dependency: "direct dev" + description: + name: riverpod_generator + sha256: "54458dac2fea976990dc9ed379060db6ae5c8790143f1963fedd0fb99980a326" + url: "https://pub.dev" + source: hosted + version: "2.6.2" + riverpod_lint: + dependency: "direct dev" + description: + name: riverpod_lint + sha256: "326efc199b87f21053b9a2afbf2aea26c41b3bf6f8ba346ce69126ee17d16ebd" + url: "https://pub.dev" + source: hosted + version: "2.6.2" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" shared_preferences: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 3d609392..a4e53785 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -91,12 +91,15 @@ dev_dependencies: integration_test: sdk: flutter flutter_lints: ^5.0.0 + riverpod_lint: ^2.6.2 mockito: ^5.4.2 test: ^1.24.1 flutter_launcher_icons: ^0.14.1 build_runner: ^2.4.11 json_serializable: ^6.8.0 dependency_validator: ^4.1.1 + riverpod_generator: ^2.6.2 + freezed: ^2.5.7 # For information on the generic Dart part of this file, see the diff --git a/test/tests_app_wrapper.dart b/test/tests_app_wrapper.dart index f1e6f2a1..df3508af 100644 --- a/test/tests_app_wrapper.dart +++ b/test/tests_app_wrapper.dart @@ -23,7 +23,7 @@ import 'package:privacyidea_authenticator/utils/rsa_utils.dart'; MockSpec(), MockSpec(), MockSpec(), - MockSpec(), + MockSpec(), MockSpec(), MockSpec(), MockSpec(), diff --git a/test/tests_app_wrapper.mocks.dart b/test/tests_app_wrapper.mocks.dart index 6a0ef84b..39b2e68d 100644 --- a/test/tests_app_wrapper.mocks.dart +++ b/test/tests_app_wrapper.mocks.dart @@ -701,10 +701,10 @@ class MockTokenContainerRepository extends _i1.Mock ) as _i13.Future<_i6.TokenContainerState>); } -/// A class which mocks [ContainerApi]. +/// A class which mocks [TokenContainerApi]. /// /// See the documentation for Mockito's code generation for more information. -class MockContainerApi extends _i1.Mock implements _i22.ContainerApi { +class MockTokenContainerApi extends _i1.Mock implements _i22.TokenContainerApi { @override _i13.Future<_i7.Response> finalizeContainer( _i21.TokenContainerUnfinalized? container, diff --git a/test/unit_test/state_notifiers/token_container_notifier_test.dart b/test/unit_test/state_notifiers/token_container_notifier_test.dart index c99f840a..70215627 100644 --- a/test/unit_test/state_notifiers/token_container_notifier_test.dart +++ b/test/unit_test/state_notifiers/token_container_notifier_test.dart @@ -8,6 +8,7 @@ import 'package:privacyidea_authenticator/model/enums/ec_key_algorithm.dart'; import 'package:privacyidea_authenticator/model/riverpod_states/token_container_state.dart'; import 'package:privacyidea_authenticator/model/token_container.dart'; import 'package:privacyidea_authenticator/utils/ecc_utils.dart'; +import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart'; import '../../tests_app_wrapper.mocks.dart'; @@ -36,7 +37,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -77,7 +78,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -126,7 +127,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -190,7 +191,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -246,7 +247,7 @@ void _testTokenContainerNotifier() { ], ); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -298,7 +299,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -368,7 +369,7 @@ void _testTokenContainerNotifier() { ], ); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -404,7 +405,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -438,7 +439,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -472,7 +473,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -506,7 +507,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) { @@ -540,7 +541,7 @@ void _testTokenContainerNotifier() { final container = ProviderContainer(); var repoState = _getBaseState(); final mockRepo = MockTokenContainerRepository(); - final mockContainerApi = MockPrivacyIdeaContainerApi(); + final mockContainerApi = MockTokenContainerApi(); when(mockContainerApi.finalizeContainer(any, any)).thenAnswer((_) async => Response('{}', 404)); when(mockRepo.loadContainerState()).thenAnswer((_) => Future.value(repoState)); when(mockRepo.saveContainer(any)).thenAnswer((invocation) {