Skip to content
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

DataStore cannot connect to model's sync subscriptions (AWS_LAMBDA auth type) #3549

Open
MuniekMg opened this issue Mar 5, 2024 · 1 comment
Labels
bug Something isn't working contribution Community contribution PRs datastore Issues related to the DataStore category

Comments

@MuniekMg
Copy link
Contributor

MuniekMg commented Mar 5, 2024

Describe the bug

For some of our models we are using AWS_LAMBDA auth type. ( e.g. 'HomeModel')

Every operation on this model is authorized by our custom lambda including onCreate, onUpdate and onDelete subscriptions requests.
Currently Amplify just sends request to subscribe to HomeModel (without filter/predicate) and our lambda cannot authorize this.
Instead Amplify should add DataStore syncExpressions as request's filter, e.g. subscribe to HomeModel onCreate events where HomeModel.address is equal to 'myAddress'

Steps To Reproduce

Steps to reproduce the behavior:
1. Start Application
2. See error: ConnectionProviderError.unauthorized

Expected behavior

DataStore add syncExpressions as subscriptions request filter

Amplify Framework Version

2.27.0

Amplify Categories

DataStore

Dependency manager

Swift PM

Swift version

5

CLI version

10.3.1

Xcode version

Version 15.2 (15C500b)

Relevant log output

ConnectionProviderError.unauthorized
MuniekMg added a commit to MuniekMg/amplify-swift that referenced this issue Mar 5, 2024
@5d 5d added contribution Community contribution PRs datastore Issues related to the DataStore category labels Mar 6, 2024
@5d
Copy link
Member

5d commented Mar 6, 2024

HI @MuniekMg ,

Thank you for opening the issue and submitting the patch PR. We'll look into both the issue and the proposed implementation and will resume the conversation when we have any updates or need further information.

MuniekMg added a commit to MuniekMg/amplify-swift that referenced this issue Mar 7, 2024
MuniekMg added a commit to MuniekMg/amplify-swift that referenced this issue Mar 8, 2024
@5d 5d added the bug Something isn't working label Mar 12, 2024
MuniekMg added a commit to MuniekMg/amplify-swift that referenced this issue Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contribution Community contribution PRs datastore Issues related to the DataStore category
Projects
None yet
Development

No branches or pull requests

2 participants