-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat(datastore): support multi owner auth rules #3223
Conversation
14bdd2a
to
3bf5780
Compare
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #3223 +/- ##
==========================================
+ Coverage 64.61% 64.80% +0.19%
==========================================
Files 1091 1091
Lines 37071 37079 +8
==========================================
+ Hits 23952 24030 +78
+ Misses 13119 13049 -70
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 19 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Issue #
Taking this PR forward: #1606
Description
This PR enables the use case of having multiple "owner" auth rules on a single model type.
Instead of using the hand written swift types in the Integration test from #1606, it makes more sense to update the schema file for that test suite. In
singleauth-cogniot-schema.graphql
, I added the use case:I believe the use cases are
Think of "user1" as the admin user creating the Todo with "user2" assigned in the editors field, so "user2" can read, receive changes to the data, and perform updates to the Todo.
In the following examples, I've provisioned the backend using the steps from here https://github.com/aws-amplify/amplify-swift/pull/3223/files#diff-5d3a18e8865a6311b2ab88fa95415c905d81544fae2d44ba19295f0bfbd7fb17 so it is enabled for DataStore.
"michael2" establishes subscription to this data:
"michael" creates the data
"michael2" receives the data:
"michael2" establiesh onUpdate:
"michael2" tries to update the data:
"michael2" receives the update mutation
General Checklist
Given When Then
inline code documentation and are named accordinglytestThing_condition_expectation()
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.