-
Notifications
You must be signed in to change notification settings - Fork 197
fix: ensure session persistence on IOS #1457
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd the label graphite-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
@iykazrji do you think we could break this PR up? Ideally one that updates the example and another that fixes the bug? |
d83eb59
to
b3b0d9f
Compare
Sure! @rthomare , Updated this PR, would be working on updating the examples regardless, so that would come in a separate PR |
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.
Generally looks good just a couple of comments to simplify.
account-kit/rn-signer/ios/implementation/NativeTEKStamperImpl.swift
Outdated
Show resolved
Hide resolved
fb807a2
to
018b2c3
Compare
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.
Thanks for making all these iterations, great work! We are so close just a couple of thoughts.
let account_kit_ephemeral_private_key = "ephemeralPrivateKey" | ||
|
||
// Keep save_ephemeral_private_key_query mutable | ||
var save_ephemeral_private_key_query: [String: Any] = [ |
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.
Ahh didn't realize we need to update this one. Can we either make a static function for this one, or just make this let
inlined in the function.
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.
Using var
here since we need to modify the query to pass in the kSecValueData
in the savePrivateKeyToKeychain()
function.
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.
Yeah still think we should isolate the generation of it, but we should probably do a generator function or something: #1457 (comment)
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.
Okay, just made an update to make a local copy of it in the savePrivateKeyToKeychain()
function which can then be updated with the kSecValueData
. Please help take a look if this is a better implementation.
Pull Request Checklist
yarn test
)site
folder, and guidelines for updating/adding docs can be found in the contribution guide)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:write
)PR-Codex overview
This PR introduces functionality for securely handling ephemeral private keys using the Keychain in the
KeychainHelper.swift
file. It updates theNativeTEKStamperImpl.swift
to utilize these new Keychain methods for storing and retrieving the private key.Detailed summary
KeychainHelper.swift
to manage ephemeral private keys.savePrivateKeyToKeychain
,getPrivateKeyFromKeychain
, anddeletePrivateKeyFromKeychain
methods.NativeTEKStamperImpl
to retrieve the private key from Keychain and save it if not present.ephemeralPrivateKey
increate
method, replaced with Keychain call.clear
method to delete the private key from Keychain.