Skip to content

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

Open
@MuniekMg

Description

@MuniekMg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontributionCommunity contribution PRsdatastoreIssues related to the DataStore categoryfollow upRequires follow up from maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions