-
Notifications
You must be signed in to change notification settings - Fork 193
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
fix(DataStore): auth plugin requirement for single auth rule #3453
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3453 +/- ##
==========================================
+ Coverage 68.13% 68.14% +0.01%
==========================================
Files 1085 1085
Lines 36248 36266 +18
==========================================
+ Hits 24699 24715 +16
- Misses 11549 11551 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Storage/StorageEngine+SyncRequirement.swift
Outdated
Show resolved
Hide resolved
AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Storage/StorageEngine+SyncRequirement.swift
Outdated
Show resolved
Hide resolved
…orageEngine+SyncRequirement.swift Co-authored-by: Sebastian Villena <97059974+ruisebas@users.noreply.github.com>
…orageEngine+SyncRequirement.swift Co-authored-by: Sebastian Villena <97059974+ruisebas@users.noreply.github.com>
Issue #
aws-amplify/amplify-flutter#3967
aws-amplify/amplify-flutter#3967 (comment)
V1 PR #3454
Description
The auth mode strategy and the auth rules are used in determination of whether the auth plugin is required for DataStore. Some common scenarios are
The issue in aws-amplify/amplify-flutter#3967 describes the scenario
The problem was DataStore was requiring auth plugin for this scenario. The change in this PR addresses that by only checking the auth rules if and only if there is one auth rule when multi-auth is not enabled. If there is more than one auth rule, fall back to the API's default auth type. There are also some edge cases that remains the same in the logic and were not changed by this PR: if there are no auth rules, do not require auth plugin. if there is an auth rule but no provider can be found, also fall back to the API's default auth type.
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.