square / Valet

Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy. We promise.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation for `afterFirstUnlockThisDeviceOnly` wrong?

aried3r opened this issue · comments

Hey! While going through the official Apple docs and the Valet docs we found a change in the docs for Valet that are contrary to what Apple says. Namely, for afterFirstUnlockThisDeviceOnly. From the docs, emphasis mine:

Apple:

After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.
https://developer.apple.com/documentation/security/ksecattraccessibleafterfirstunlockthisdeviceonly

Valet:

Valet data cannot be accessed after a restart until the device has been unlocked once; data is accessible until the device is next rebooted. This attribute is recommended for data that needs to be accessible by background applications. Valet data with this attribute will migrate to a new device when using encrypted backups.
https://github.com/square/Valet/blob/4.1.2/Sources/Valet/Accessibility.swift#L31-L32

This was changed here, and we were wondering if that was perhaps a mistake?
#258 (comment)

Good find! Looks like I got carried away with a copy/paste. Will fix.