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

[Feature] Introduce User Authentication #36

Merged
merged 24 commits into from
May 4, 2024
Merged

Conversation

Divinelink
Copy link
Owner

@Divinelink Divinelink commented May 1, 2024

In this pull request we introduced the authentication functionality by following the following API doc.

The authentication is based on the following 3 steps:

  • Create a request token
  • Ask the user for permission
  • Create a session ID

For security purposes, the session ID is the encrypted to the device. This session ID will be used on future API requests, that way, the user can rate movies, see their lists etc.

It's important to note that the application NEVER gets access to the users credentials.
The authentication process is done by redirecting the user to the official TMDB website and the permitting the application to read and write data on behalf of the app. That way, we ensure that the user never enter their credential on our app. 😇

Changes made

Additionally, we made the following changes:

  • Migrate from custom Result class to kotlin.Result
  • Update codebase format
  • Migrate settings from views to jetpack compose, making the app fully compose and single activity

Decided to completely replace Settings DSL API with compose. This help us achieve single activity architecture, reduce development time and also remove a lot of unnecessary files.
Implement functionality to obtain and utilize a sessionId for valid requests with the TMDB account. This involves guiding the user through authentication on the official TMDB website to generate a request token. Upon user authentication and permission approval, the request token is exchanged for a sessionId through an API call. The sessionId is encrypted for enhanced security.
@Divinelink Divinelink added the enhancement New feature or request label May 1, 2024
@Divinelink Divinelink self-assigned this May 1, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 48.21192% with 782 lines in your changes are missing coverage. Please review.

Project coverage is 56.40%. Comparing base (90ef971) to head (38d4630).

Files Patch % Lines
...main/java/com/andreolas/movierama/ui/theme/Type.kt 0.00% 102 Missing ⚠️
...ain/java/com/andreolas/movierama/ui/theme/Color.kt 0.00% 54 Missing ⚠️
...ettings/app/appearance/AppearanceSettingsScreen.kt 0.00% 38 Missing ⚠️
...erama/settings/components/SettingsRadioPrefItem.kt 0.00% 34 Missing ⚠️
...ierama/ui/components/details/videos/VideoPlayer.kt 37.03% 33 Missing and 1 partial ⚠️
...ama/settings/components/AlertDialogSelectOption.kt 0.00% 33 Missing ⚠️
...vierama/base/storage/EncryptedPreferenceStorage.kt 0.00% 32 Missing ⚠️
...s/movierama/session/login/ui/LoginWebViewScreen.kt 0.00% 30 Missing ⚠️
...ovierama/settings/components/SettingsSwitchItem.kt 0.00% 27 Missing ⚠️
...reolas/movierama/ui/components/EmptySectionCard.kt 0.00% 21 Missing ⚠️
... and 62 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   49.77%   56.40%   +6.62%     
==========================================
  Files         104      140      +36     
  Lines        3385     3537     +152     
  Branches      552      537      -15     
==========================================
+ Hits         1685     1995     +310     
+ Misses       1418     1277     -141     
+ Partials      282      265      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Divinelink Divinelink merged commit 100a6e0 into main May 4, 2024
3 of 4 checks passed
@Divinelink Divinelink deleted the feature/authentication branch May 4, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant