-
Notifications
You must be signed in to change notification settings - Fork 13
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/secure auth #1
base: master
Are you sure you want to change the base?
Feature/secure auth #1
Conversation
# Conflicts: # app/build.gradle # app/src/main/AndroidManifest.xml # app/src/main/java/com/otus/securehomework/data/repository/TokenAuthenticator.kt # app/src/main/java/com/otus/securehomework/di/AppModule.kt # app/src/main/java/com/otus/securehomework/di/RemoteDataSource.kt
@@ -0,0 +1,7 @@ | |||
package com.otus.securehomework.data.dto | |||
|
|||
data class LoginData(val email: String, val password: String) { |
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.
в идеале пароль поменять из String на CharSequence
private fun canAuthenticate(authenticator: Int) = BiometricManager.from(context) | ||
.canAuthenticate(authenticator) == BiometricManager.BIOMETRIC_SUCCESS | ||
|
||
fun ByteArray.toBase64(flags: Int = Base64.DEFAULT): String = Base64.encodeToString(this, flags) |
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.
Можно эти экстеншены вынести в общие , так как будут переиспользоваться
@@ -5,14 +5,19 @@ import android.view.View | |||
import androidx.fragment.app.Fragment | |||
import androidx.fragment.app.viewModels | |||
import com.otus.securehomework.R | |||
import com.otus.securehomework.databinding.FragmentLoginBinding |
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.
лишний импорт
val ciphertext = encryptor.doFinal(plaintext.toByteArray()) | ||
return EncryptedEntity( | ||
ciphertext, | ||
encryptor.iv |
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.
мне кажется странным, возвращать вектор как результат . Класс , который отвечает за шифрование, должен уметь и сохранять вектор безопасно
Created BaseSecurePreferences as EncryptedSharedPreferences, added key creation for api 21+, added fingerprint assigning and validation