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

fix(datastore): filter authrules with invalid ownerfield #1606

Closed
wants to merge 1 commit into from

Conversation

diegocstn
Copy link
Contributor

@diegocstn diegocstn commented Jan 24, 2022

Description of changes:
This PR introduces changes to AuthRuleDecorator to support multiple rules with different owner fields as per documentation.

Given the following schema

type PostDraftCognitoMultiOwner @model
  @auth(rules: [
    { allow: owner },
    { allow: owner, ownerField: "editors", operations: [update, read] }
  ]) {
  id: ID!
  title: String!
  content: String
  owner: String
  editors: [String]
}

AppSync generates

Check points: (check or cross out if not relevant)

  • Added new tests to cover change, if needed
    - [ ] Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
    - [ ] Documentation update for the change if required
  • PR title conforms to conventional commit style
    - [ ] If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@maziarzamani
Copy link

Can't wait for this to be merged. Any ETA? Cheers.

@piro49
Copy link

piro49 commented Jan 27, 2022

Same over here!

@maziarzamani
Copy link

Hi @diegocstn. I know you have loads on your plate, but I have 2 projects waiting for this PR to go through and released. Can we expedite it, seems like we are 99% of the way? Cheers.

@maziarzamani
Copy link

@diegocstn, while we wait for this PR to go through, is there a temporary workaround? E.g. can the primary owner be turned into an array, so we can at least support multi-owner?

type PostDraftCognitoMultiOwner @model
  @auth(rules: [
    { allow: owner }
  ]) {
  id: ID!
  title: String!
  content: String
  owner: [String]
}

@maziarzamani
Copy link

@diegocstn, can you provide an update for this issue? It's been almost 3months, and yet this need-to-have feature is still not working on iOS.

@maziarzamani
Copy link

Almost 4months has passed and a standard feature in amplify-cli is still not supported in a major SDK. Unfortunately this will kill all my iOS related projects going forward.

@kavamara
Copy link

any further with this?

@royjit royjit changed the base branch from main to v1 October 17, 2022 17:24
@maziarzamani
Copy link

Documentation was updated recently with something that could indicate there is support for this feature. Could there be light at the end of the tunnel?

aws-amplify/docs@1562ca1

@lawmicha
Copy link
Contributor

This PR is no longer needed, it was re-done in #3223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datastore Issues related to the DataStore category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants