TF-2271 Implement dns lookup to get jmap url
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 7b0c0015a15a243b6b4aef3d78e7653d556ad109)
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
import 'package:core/data/model/source_type/data_source_type.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/caching/clients/recent_login_url_cache_client.dart';
|
||||
import 'package:tmail_ui_user/features/caching/clients/recent_login_username_cache_client.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource/login_url_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource/login_username_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource_impl/login_url_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource_impl/login_username_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/repository/login_url_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/repository/login_username_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource/login_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource_impl/hive_login_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource_impl/login_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/network/dns_service.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/repository/login_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/account_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/authentication_oidc_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/credential_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/login_url_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/login_username_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/login_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/authenticate_oidc_on_browser_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/authentication_user_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/check_oidc_is_available_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/dns_lookup_to_get_jmap_url_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/get_all_recent_login_url_on_mobile_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/get_all_recent_login_username_on_mobile_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/get_authentication_info_interactor.dart';
|
||||
@@ -27,6 +27,7 @@ import 'package:tmail_ui_user/features/login/domain/usecases/save_login_url_on_m
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/save_login_username_on_mobile_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/login/presentation/login_controller.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/cache_exception_thrower.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/remote_exception_thrower.dart';
|
||||
|
||||
class LoginBindings extends BaseBindings {
|
||||
|
||||
@@ -45,24 +46,26 @@ class LoginBindings extends BaseBindings {
|
||||
Get.find<GetAllRecentLoginUrlOnMobileInteractor>(),
|
||||
Get.find<SaveLoginUsernameOnMobileInteractor>(),
|
||||
Get.find<GetAllRecentLoginUsernameOnMobileInteractor>(),
|
||||
Get.find<DNSLookupToGetJmapUrlInteractor>(),
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsDataSource() {
|
||||
Get.lazyPut<LoginUrlDataSource>(() => Get.find<LoginUrlDataSourceImpl>());
|
||||
Get.lazyPut<LoginUsernameDataSource>(() => Get.find<LoginUsernameDataSourceImpl>());
|
||||
|
||||
Get.lazyPut<LoginDataSource>(() => Get.find<LoginDataSourceImpl>());
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsDataSourceImpl() {
|
||||
Get.lazyPut(() => LoginUrlDataSourceImpl(
|
||||
Get.lazyPut(() => HiveLoginDataSourceImpl(
|
||||
Get.find<RecentLoginUrlCacheClient>(),
|
||||
Get.find<CacheExceptionThrower>()));
|
||||
Get.lazyPut(() => LoginUsernameDataSourceImpl(
|
||||
Get.find<RecentLoginUsernameCacheClient>(),
|
||||
Get.find<CacheExceptionThrower>()));
|
||||
Get.find<CacheExceptionThrower>()
|
||||
));
|
||||
Get.lazyPut(() => LoginDataSourceImpl(
|
||||
Get.find<DNSService>(),
|
||||
Get.find<RemoteExceptionThrower>(),
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -90,28 +93,25 @@ class LoginBindings extends BaseBindings {
|
||||
Get.lazyPut(() => GetStoredOidcConfigurationInteractor(
|
||||
Get.find<AuthenticationOIDCRepository>(),
|
||||
));
|
||||
Get.lazyPut(() => SaveLoginUrlOnMobileInteractor(
|
||||
Get.find<LoginUrlRepository>(),
|
||||
));
|
||||
Get.lazyPut(() => GetAllRecentLoginUrlOnMobileInteractor(Get.find<LoginUrlRepository>()));
|
||||
Get.lazyPut(() => SaveLoginUsernameOnMobileInteractor(
|
||||
Get.find<LoginUsernameRepository>(),
|
||||
));
|
||||
Get.lazyPut(() => GetAllRecentLoginUsernameOnMobileInteractor(
|
||||
Get.find<LoginUsernameRepository>()
|
||||
));
|
||||
Get.lazyPut(() => SaveLoginUrlOnMobileInteractor(Get.find<LoginRepository>(),));
|
||||
Get.lazyPut(() => GetAllRecentLoginUrlOnMobileInteractor(Get.find<LoginRepository>()));
|
||||
Get.lazyPut(() => SaveLoginUsernameOnMobileInteractor(Get.find<LoginRepository>(),));
|
||||
Get.lazyPut(() => GetAllRecentLoginUsernameOnMobileInteractor(Get.find<LoginRepository>()));
|
||||
Get.lazyPut(() => DNSLookupToGetJmapUrlInteractor(Get.find<LoginRepository>()));
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsRepository() {
|
||||
Get.lazyPut<LoginUrlRepository>(() => Get.find<LoginUrlRepositoryImpl>());
|
||||
Get.lazyPut<LoginUsernameRepository>(() => Get.find<LoginUsernameRepositoryImpl>());
|
||||
|
||||
Get.lazyPut<LoginRepository>(() => Get.find<LoginRepositoryImpl>());
|
||||
}
|
||||
|
||||
@override
|
||||
void bindingsRepositoryImpl() {
|
||||
Get.lazyPut(() => LoginUrlRepositoryImpl(Get.find<LoginUrlDataSource>()));
|
||||
Get.lazyPut(() => LoginUsernameRepositoryImpl(Get.find<LoginUsernameDataSource>()));
|
||||
Get.lazyPut(() => LoginRepositoryImpl(
|
||||
{
|
||||
DataSourceType.hiveCache: Get.find<HiveLoginDataSourceImpl>(),
|
||||
DataSourceType.network: Get.find<LoginDataSource>(),
|
||||
}
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user