-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Persist ParseUser, ParseInstallation, and default ACL in Keychain #19
Conversation
Codecov Report
@@ Coverage Diff @@
## main #19 +/- ##
===========================================
+ Coverage 53.57% 64.91% +11.33%
===========================================
Files 28 29 +1
Lines 1258 1485 +227
===========================================
+ Hits 674 964 +290
+ Misses 584 521 -63
Continue to review full report at Codecov.
|
@pranjalsatija can you review this? Also, you probably know better than I would on how best to write |
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.
This looks good to me. My only concern is the changes in concurrent iterations / timeouts, but those aren't big issues.
- Add updated badges - Bump minimus iOS support to iOS9 - Send codecov reports for all builds
Add initial version of ParseInstallation, still needs test cases
Also cleaned up file structure
@pranjalsatija can you review this? The large changes in lines are due to documentation and restructuring. Most of the updates are Installation (new), ParseUser (storing to Keychain and memory), and default ACL to Keychain, along with their respective test cases |
…dded updated saving of User and Installation during fetch, find, first. Additional updates - updated some documentation (still more to do) - Deleted unnecessary files
…tic. For example, 100 signup threads won't be created to sign up a user
@TomWFox a significant part of this PR is the API documentation since it essentially had no documentation before this. I ported the markdown comments from the obj-c framework to this one and attempted to tailor to this framework. This also switches to the "swift" style markdown ( I'm sure there are number of grammatical mistakes along with better documentation needed. Feel free to make any adjustments you think are necessary. |
@cbaker6 Spell checked and some minor improvements. |
…ed examples in playgrounds
Clean up Query
…-server JSON key "ACL". It also prevents you from using var ACL = ACL.defaultACL(). So we now use var ACL = ParseACL.defaultACL() instead.
@cbaker6 sorry for taking so long; I noticed you were still slowly adding stuff so I figured I'd wait for at least a little while and then I got busy with school stuff. My main concern with this PR is the fact that it's directly using the Keychain from within the framework. IIRC, Flo's idea was to make it so that users could "plug and play" different adaptors for different tasks, including the persistence of the current user, installation, etc. which is why I added Other than that, I don't have any issues -- LGTM. I'll do another scan for typos and stuff. |
@pranjalsatija thanks for reviewing!
I agree with you for the most part here. With the changes, I don't intend to store all or even most of the objects in the Keychain. The only items I store are the BaseParseUser, BaseInstallation, and the default ParseACL. This not only keeps these items safe, but also provides the local storage needed, which I don't think much else will need to be stored in Keychain. This differs slightly from the objective-c framework which just stored the sessionToken in the Keychain. My thinking is keep the user and Parse required items in a safe space (Keychain) and 3rd party storage can be used for everything else via a protocol and ParseStore.shared that you made |
That's sensible! What if I update struct ParseStorage {
struct StorageConfig {
let keyValueStore: PrimitiveObjectStore // defaults to in memory
let secureStore: PrimitiveObjectStore // defaults to Keychain
}
mutating func use(_ config: StorageConfig) {
self.backingStore = store
}
} And then I can also update the parts of this PR that reference the Keychain directly to reference the secure store? |
Sounds reasonable to me. It would make it more modular. My only concern is, do we want to let the user/developer to keep/choose the |
If you want, it might be easier to merge this PR before you make the storage changes you mentioned |
@cbaker6 I'll definitely merge this PR first! And I think letting them customize it is the way to go; you already pointed out the Linux situation and we / users might want to swap in an in-memory store for unit tests or something. |
@TomWFox can you approve this? @pranjalsatija has reviewed it |
This takes a slightly different approach than its' Objective-c counterpart when storing important/private information related to the ParseUser, ParseInstallation, and default ACL. Instead of using some form of local storage such as CoreData or SQLite, it stores these items in the Keychain for safety. The Objective-c SDK does store sessionToken and some other items in the Keychain, but not whole objects as in this case.
.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4)
due to ParseEncoder requirements. In the future may bump hire, check here for discussion.