-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(deriv_auth): [UPM-547] added deriv_passkeys to deriv_auth #488
Changes from 20 commits
c1e0067
0e592c4
fc8b0bb
6a16570
5ce30c3
7ff5653
573a4a7
f38cc25
11c8aca
dc29784
86408c3
f7930d6
5e62ee1
fac8904
59278c7
d4eb573
e96c812
d966d9f
d61a2d3
8b8ad74
ac5dd58
2ade47f
2a7e090
e594c05
1e5ba63
c12a9ee
c3187ba
303139d
6ea1dd7
a3cce1f
c93046a
5c19f3a
ca6c943
b74515f
7333af2
45cbbb6
acc501f
607eca1
7bb5f71
14b85c2
02f390b
d991133
572aa5f
6a2708e
608dcf4
87ff83b
dcda848
82de161
ed0f005
a3acdf1
4d43e25
41fa9ed
cd545c7
d6eccdc
b647404
230a954
294ca42
ec1faf3
be3f061
f462088
e110f22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
analyzer: | ||
exclude: | ||
- example/** | ||
errors: | ||
todo: ignore | ||
missing_required_param: warning | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:deriv_auth/deriv_auth.dart'; | ||
import 'package:flutter_deriv_api/state/connection/connection_cubit.dart'; | ||
|
||
/// Class that contains ConnectionInfo | ||
class DerivAuthConnectionInfo implements AuthConnectionInfo { | ||
@override | ||
String get appId => ConnectionCubit.appId; | ||
|
||
@override | ||
String get endpoint => ConnectionCubit.endpoint; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import 'package:deriv_auth/deriv_auth.dart'; | ||
import 'package:deriv_http_client/deriv_http_client.dart'; | ||
import 'package:deriv_passkeys/data/data_sources/deriv_passkeys_data_source.dart'; | ||
import 'package:deriv_passkeys/data/mappers/deriv_passkeys_mapper.dart'; | ||
import 'package:deriv_passkeys/data/repositories/deriv_passkeys_repository.dart'; | ||
import 'package:deriv_passkeys/interactor/services/deriv_passkeys_service.dart'; | ||
import 'package:deriv_passkeys/presentation/states/bloc/deriv_passkeys_bloc.dart'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to this PR but can you create a barrel file for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes i realized i should when i was implementing, thank you for the suggestion! |
||
import 'package:deriv_theme/deriv_theme.dart'; | ||
import 'package:device_preview/device_preview.dart'; | ||
import 'package:deriv_localizations/l10n/generated/deriv_auth/deriv_auth_localizations.dart'; | ||
import 'package:example/features/get_started/pages/get_started_page.dart'; | ||
import 'package:example/features/login/repositories/example_login_repository.dart'; | ||
import 'package:example/features/signup/repositories/example_referral_repository.dart'; | ||
import 'package:example/features/signup/repositories/example_signup_repository.dart'; | ||
import 'package:example/features/social_auth/deriv_auth_connection_info.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
|
@@ -15,9 +22,11 @@ void main() { | |
/// Added [DevicePreview] while fixing on UI issue | ||
/// that was only in smaller devices. This later can be removed | ||
/// when we are fully using widget book. | ||
runApp(DevicePreview( | ||
builder: (context) => const MyApp(), | ||
)); | ||
runApp( | ||
DevicePreview( | ||
builder: (context) => const MyApp(), | ||
), | ||
); | ||
} | ||
|
||
class MyApp extends StatelessWidget { | ||
|
@@ -40,6 +49,24 @@ class MyApp extends StatelessWidget { | |
referralService: ExampleReferralRepository(), | ||
), | ||
), | ||
BlocProvider( | ||
create: (context) => SocialAuthCubit( | ||
socialAuthService: DerivSocialAuthService( | ||
client: HttpClient(), | ||
connectionInfo: DerivAuthConnectionInfo(), | ||
), | ||
), | ||
), | ||
BlocProvider( | ||
create: (context) => DerivPasskeysBloc( | ||
DerivPasskeysService( | ||
DerivPasskeysRepository( | ||
DerivPasskeysDataSource( | ||
DerivPasskeysMapper(), | ||
), | ||
), | ||
), | ||
)), | ||
], | ||
child: DerivThemeProvider.builder( | ||
initialTheme: ThemeMode.dark, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,27 @@ dependencies: | |
flutter_bloc: ^8.1.3 | ||
http: ^0.13.6 | ||
device_preview: ^1.1.0 | ||
deriv_http_client: | ||
git: | ||
url: [email protected]:regentmarkets/flutter-deriv-packages.git | ||
path: packages/deriv_http_client | ||
ref: deriv_http_client-v1.0.0 | ||
deriv_passkeys: | ||
git: | ||
url: [email protected]:regentmarkets/flutter-deriv-packages.git | ||
path: packages/deriv_passkeys | ||
ref: c9b906bc20edbc94d0ca99f2211b142efa3aaf2e | ||
|
||
dependency_overrides: | ||
flutter_deriv_api: | ||
git: | ||
url: [email protected]:deriv-com/flutter-deriv-api.git | ||
ref: 64ad3673598ad807b43f751fc2ec7bc5ef01203e | ||
deriv_ui: | ||
git: | ||
url: [email protected]:regentmarkets/flutter-deriv-packages.git | ||
path: packages/deriv_ui | ||
ref: deriv_ui-v0.0.6+2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dont forget to change the dependencies before merge. |
||
|
||
dev_dependencies: | ||
flutter_test: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export 'connection_info.dart'; | ||
export 'exceptions/deriv_auth_exception.dart'; | ||
export 'extensions/extensions.dart'; | ||
export 'layouts/deriv_unavailable_country_layout.dart'; | ||
export 'models/account_model.dart'; | ||
export 'models/auth_error/auth_error.dart'; | ||
export 'models/auth_error/auth_error_model.dart'; | ||
export 'models/authorize_model.dart'; | ||
export 'models/verify_email_model.dart'; | ||
export 'services/jwt/repository/deriv_jwt_repository.dart'; | ||
export 'services/jwt/services/deriv_jwt_service.dart'; | ||
export 'services/referral/models/my_affiliate_referral_code_request_model.dart'; | ||
export 'services/token/models/enums.dart'; | ||
export 'services/token/services/deriv_token_service.dart'; | ||
export 'states/states.dart'; | ||
export 'helpers/helpers.dart'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,9 @@ extension RegexExtension on String { | |
/// Signup valid Password Regex. | ||
bool get isValidSignupPassword => validPasswordRegex.hasMatch(this); | ||
} | ||
|
||
/// Extension methods for capitalizing [String]. | ||
extension Capitalize on String { | ||
/// Capitalize the first letter of the string. | ||
String get capitalize => '${this[0].toUpperCase()}${substring(1)}'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could have been added to StringExtension why did you create a new extension? |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export 'auth_error_state_mapper.dart'; | ||
export 'auth_error_state_handler.dart'; | ||
export 'auth_state_listener.dart'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,2 @@ | ||
export 'core/connection_info.dart'; | ||
export 'core/exceptions/deriv_auth_exception.dart'; | ||
export 'core/extensions/extensions.dart'; | ||
export 'core/models/account_model.dart'; | ||
export 'core/models/auth_error/auth_error.dart'; | ||
export 'core/models/auth_error/auth_error_model.dart'; | ||
export 'core/models/authorize_model.dart'; | ||
export 'core/models/verify_email_model.dart'; | ||
export 'core/services/jwt/repository/deriv_jwt_repository.dart'; | ||
export 'core/services/jwt/services/deriv_jwt_service.dart'; | ||
export 'core/helpers/semantic_labels.dart'; | ||
export 'core/services/token/models/enums.dart'; | ||
export 'core/services/token/services/deriv_token_service.dart'; | ||
export 'core/services/referral/models/my_affiliate_referral_code_request_model.dart'; | ||
export 'features/auth/cubit/deriv_auth_cubit.dart'; | ||
export 'features/auth/models/logout/logout_response.dart'; | ||
export 'features/auth/repository/base_auth_repository.dart'; | ||
export 'features/auth/services/deriv_auth_service.dart'; | ||
export 'features/reset_password/cubit/reset_password_cubit.dart'; | ||
export 'features/reset_password/repository/base_reset_password_repository.dart'; | ||
export 'features/reset_password/services/deriv_reset_password_service.dart'; | ||
export 'features/signup/cubit/signup_cubit.dart'; | ||
export 'features/signup/models/new_virtual_account_request_model.dart'; | ||
export 'features/signup/models/signup_error_type.dart'; | ||
export 'features/signup/repository/base_signup_repository.dart'; | ||
export 'features/signup/services/deriv_signup_service.dart'; | ||
export 'features/social_auth/social_auth.dart'; | ||
export 'core/layouts/deriv_unavailable_country_layout.dart'; | ||
export 'features/get_started/presentation/layouts/deriv_get_started_layout.dart'; | ||
export 'features/get_started/models/deriv_get_started_slide_model.dart'; | ||
export 'features/login/presentation/layouts/deriv_2fa_layout.dart'; | ||
export 'features/login/presentation/layouts/deriv_login_layout.dart'; | ||
export 'features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart'; | ||
export 'features/reset_password/presentation/layouts/deriv_reset_pass_layout.dart'; | ||
export 'features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart'; | ||
export 'features/setting_page/presentation/layouts/deriv_setting_layout.dart'; | ||
export 'features/signup/cubit/deriv_country_selection_cubit.dart'; | ||
export 'features/signup/presentation/layouts/deriv_country_selection_layout.dart'; | ||
export 'features/signup/presentation/layouts/deriv_email_not_received_layout.dart'; | ||
export 'features/signup/presentation/layouts/deriv_set_password_layout.dart'; | ||
export 'features/signup/presentation/layouts/deriv_signup_layout.dart'; | ||
export 'features/signup/presentation/layouts/deriv_verification_done_layout.dart'; | ||
export 'features/signup/presentation/layouts/deriv_verify_email_layout.dart'; | ||
export 'features/signup/models/deriv_auth_utm_model.dart'; | ||
export 'features/signup/models/deriv_password_policy_model.dart'; | ||
export 'features/signup/models/deriv_residence_model.dart'; | ||
export 'core/states/states.dart'; | ||
export 'core/core.dart'; | ||
export 'features/features.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this added inside
social_auth
folder?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it's being used in the social auth service:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is passed in
DerivAuthCubit
as well.DerivAuthConnectionInfo
is for auth endpoint - oauth.deriv.com, it should be in somewhere common folder.