Closed AntonVoitsekhivskyi-okta closed 3 years ago
@IldarAbdullin-okta @oleggnidets-okta @MikeMondragon-okta Haven't found how to tag you as reviewers guys from Fork-based PR, so mentioning you here for review, thanks
Instead of searching for keys by prefix, have you considered making an API that could return the list of keys instead? That way you're not limited to filtering by prefix, instead you could use the existing APIs to get the stored values, once you have the keys you're interested in.
@mikenachbaur-okta Returning the whole list of keys sounds good to me.
Refactored getStoredKeysMatching()
-> getStoredKeys()
to return an array of stored keys and let client decide, which way to traverse / filter through the result.
…rompt:accessGroup:) function
Problem Analysis (Technical)
Currently, there are no possibility to access keychain by some key prefix and not the exact key.
Solution (Technical)
Extending API by requesting Keychain items attributes and then filter keys by prefix:
getStoredKeysMatching(prefix:biometricPrompt:accessGroup:)
The function replicates
hasPrefix()
behaviour forString
from Swift's Foundation. If this needs to be extended to accept some regex-backed search, please let me know. "Has prefix" approach is initially chosen from a performance perspectiveAffected Components
Steps to reproduce: N/A
Actual result:
Expected result:
Tests
Added
testSetAndMultipleGetByPrefix()