-
Notifications
You must be signed in to change notification settings - Fork 95
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
iPad #301
base: main
Are you sure you want to change the base?
iPad #301
Conversation
siandreev
commented
Nov 18, 2024
let keychainQuery: [CFString: Any] = [ | ||
kSecClass: kSecClassGenericPassword, | ||
kSecAttrAccount: id, | ||
kSecValueData: data.data(using: .utf8)! |
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.
я бы предложил однозначно избегать !
, попадется строка, которая успешно в дату не перегонится в utf8, будет тупо крэш
наверное я бы написал что-то типа такого
guard let id = call.getString("id"),
let dataString = call.getString("data"),
let data = dataString.data(using: .utf8) else {
call.reject("Missing required parameters")
return
}
} | ||
|
||
let keychainQuery: [CFString: Any] = [ | ||
kSecClass: kSecClassGenericPassword, |
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.
можно еще добавить ключ kSecAttrAccessible
это настраивает разные параметры доступа к данным в кейчен, в том числе, будут ли они попадать с в бэкап или только этом девайсе будут храниться
https://developer.apple.com/documentation/security/ksecattraccessible
|
||
let reason = call.getString("reason") ?? "Access requires authentication" | ||
|
||
authContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason ) { success, error in |
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.
это не самый безопасный подход
если получаешь доступ к девайсу, ставишь джейлбрейк и в рантайме подменяешь success
на мой взгляд, лучше просто сохранять пароль/пин код в кейчейне под доступом через биометрию
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.