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

merge from remote #1

Merged
merged 14 commits into from
May 5, 2021
Merged

merge from remote #1

merged 14 commits into from
May 5, 2021

Conversation

abhi7cr
Copy link
Owner

@abhi7cr abhi7cr commented May 5, 2021

Description of changes

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

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

cjihrig and others added 14 commits May 3, 2021 15:52
 - amplify-app@2.23.4
 - amplify-appsync-simulator@1.26.3
 - amplify-category-analytics@2.21.5
 - amplify-category-api@2.31.5
 - amplify-category-auth@2.30.5
 - amplify-category-function@2.31.5
 - amplify-category-hosting@2.7.5
 - amplify-category-predictions@2.8.5
 - amplify-category-storage@2.11.5
 - amplify-category-xr@2.8.5
 - amplify-cli-core@1.21.1
 - @aws-amplify/cli@4.50.1
 - amplify-console-hosting@1.8.5
 - amplify-console-integration-tests@1.5.5
 - amplify-container-hosting@1.3.5
 - amplify-dotnet-function-runtime-provider@1.5.3
 - amplify-dotnet-function-template-provider@1.5.5
 - amplify-dynamodb-simulator@1.18.5
 - amplify-e2e-core@1.18.1
 - amplify-e2e-tests@2.39.1
 - amplify-frontend-android@2.15.2
 - amplify-frontend-flutter@0.4.2
 - amplify-frontend-ios@2.19.5
 - amplify-frontend-javascript@2.21.5
 - amplify-go-function-runtime-provider@1.7.5
 - amplify-go-function-template-provider@1.3.6
 - amplify-graphiql-explorer@1.5.0
 - amplify-graphql-docs-generator@2.2.2
 - @aws-amplify/graphql-function-transformer@0.2.0
 - @aws-amplify/graphql-http-transformer@0.2.0
 - @aws-amplify/graphql-model-transformer@0.3.5
 - @aws-amplify/graphql-transformer-core@0.4.0
 - @aws-amplify/graphql-transformer-interfaces@1.4.0
 - amplify-graphql-types-generator@2.8.2
 - amplify-java-function-runtime-provider@1.7.5
 - amplify-migration-tests@2.21.5
 - amplify-nodejs-function-runtime-provider@1.5.4
 - amplify-nodejs-function-template-provider@1.6.5
 - amplify-provider-awscloudformation@4.46.0
 - amplify-python-function-runtime-provider@1.7.5
 - amplify-python-function-template-provider@1.3.8
 - amplify-util-import@1.4.5
 - amplify-util-mock@3.30.5
 - graphql-auth-transformer@6.24.5
 - graphql-connection-transformer@4.21.5
 - graphql-dynamodb-transformer@6.22.5
 - graphql-elasticsearch-transformer@4.11.5
 - graphql-function-transformer@2.5.5
 - graphql-http-transformer@4.17.5
 - graphql-key-transformer@2.23.5
 - graphql-predictions-transformer@2.5.5
 - graphql-relational-schema-transformer@2.17.2
 - graphql-transformer-common@4.19.2
 - graphql-transformer-core@6.28.5
 - graphql-transformers-e2e-tests@6.23.5
 - graphql-versioned-transformer@4.17.5
 - amplify-app@2.23.5
 - amplify-appsync-simulator@1.26.4
 - amplify-category-analytics@2.21.6
 - amplify-category-api@2.31.6
 - amplify-category-auth@2.30.6
 - amplify-category-function@2.31.6
 - amplify-category-hosting@2.7.6
 - amplify-category-predictions@2.8.6
 - amplify-category-storage@2.11.6
 - amplify-category-xr@2.8.6
 - amplify-cli-core@1.21.2
 - @aws-amplify/cli@4.50.2
 - amplify-console-hosting@1.8.6
 - amplify-console-integration-tests@1.5.6
 - amplify-container-hosting@1.3.6
 - amplify-dotnet-function-runtime-provider@1.5.4
 - amplify-dotnet-function-template-provider@1.5.6
 - amplify-dynamodb-simulator@1.18.6
 - amplify-e2e-core@1.18.2
 - amplify-e2e-tests@2.39.2
 - amplify-frontend-android@2.15.3
 - amplify-frontend-flutter@0.4.3
 - amplify-frontend-ios@2.19.6
 - amplify-frontend-javascript@2.21.6
 - amplify-go-function-runtime-provider@1.7.6
 - amplify-go-function-template-provider@1.3.7
 - amplify-graphiql-explorer@1.6.0
 - amplify-graphql-docs-generator@2.2.3
 - @aws-amplify/graphql-function-transformer@0.3.0
 - @aws-amplify/graphql-http-transformer@0.3.0
 - @aws-amplify/graphql-model-transformer@0.3.6
 - @aws-amplify/graphql-transformer-core@0.5.0
 - @aws-amplify/graphql-transformer-interfaces@1.5.0
 - amplify-graphql-types-generator@2.8.3
 - amplify-java-function-runtime-provider@1.7.6
 - amplify-migration-tests@2.21.6
 - amplify-nodejs-function-runtime-provider@1.5.5
 - amplify-nodejs-function-template-provider@1.6.6
 - amplify-provider-awscloudformation@4.47.0
 - amplify-python-function-runtime-provider@1.7.6
 - amplify-python-function-template-provider@1.3.9
 - amplify-util-import@1.4.6
 - amplify-util-mock@3.30.6
 - graphql-auth-transformer@6.24.6
 - graphql-connection-transformer@4.21.6
 - graphql-dynamodb-transformer@6.22.6
 - graphql-elasticsearch-transformer@4.11.6
 - graphql-function-transformer@2.5.6
 - graphql-http-transformer@4.17.6
 - graphql-key-transformer@2.23.6
 - graphql-predictions-transformer@2.5.6
 - graphql-relational-schema-transformer@2.17.3
 - graphql-transformer-common@4.19.3
 - graphql-transformer-core@6.28.6
 - graphql-transformers-e2e-tests@6.23.6
 - graphql-versioned-transformer@4.17.6
…7035)

This fixes a scenario in with the Manage - Content section Admin UI no longer functioned in specific scenarios due to authorization errors from the AppSync API.
Issue

If a user deployed an API with models that had less than full @auth operations directives (blank or ["create", "read", "update, "delete"]], the generated schema would not include the @aws_iam directive on the mutations as needed by the Manage - Content functionality.

For instance, if the schema looked like this:

type Post @model @auth(rules: [{allow: public, operations: [read, update]}]) {
      id: ID!
      title: String!
      createdAt: String
      updatedAt: String
  }

The transformed schema would have an update mutation that looked like this

updatePost(input: CreatePostInput!): Post

instead of what it needed to look like to authenticate properly

updatePost(input: CreatePostInput!): Post @aws_api_key @aws_iam'

This would ultimately present itself with the Manage - Content section of the Admin UI failing to initialize DataStore or with failures to delete or update objects on the affected data model.
Fix

Updated the way IAM auth gets added when AdminUI is enabled by ensuring all the the GraphQL
operations for all the type get IAM private authroization added. Update the code to ensure no IAM policy gets added Auth or UnAuth user roles since AdminUI uses a different IAM role to access the types and fields


Unit tests were added for the affected scenarios. Use cases were also tested by using the development branch CLI to push schema.graphql changes directly to a previously broken app. The Manage - Content section was verified to work.
This commit adds a test for get-userpoolgroup-list.ts
* fix: #7243 yaml parsing should support all cfn functions
This commit adds a test for get-plugin-instance extensions.
When a customer selected "don't update secrets" when deploying changes to a containers resource, the existing secrets config was removed rather than retained. This change adds logic to parse the existing secret config and apply it to the updated template
This commit adds logic to rebuild container based APIs during
push if necessary.

Refs: #6684

Co-authored-by: Colin Ihrig <colihrig@amazon.com>
@abhi7cr abhi7cr merged commit 546ecc4 into abhi7cr:master May 5, 2021
@abhi7cr
Copy link
Owner Author

abhi7cr commented May 5, 2021

merge from base repo

abhi7cr pushed a commit that referenced this pull request May 6, 2022
* feat(cli-api): improve add and update api

* Delete sam.schema.json

* Delete cloudformation.schema.json

* remove auto apply authmode code from update api workflow

* remove unused import

* fix lint issues

* relative import

* fix dependencies

* fix lint comments

* remove unused code

* updated v2 templates

* remove unused import

* change to use executeProviderUtils

* fixed formatting

* several minor tweaks to add and update api workflow

* update conflict detection label

* remove app not deployed message

* auto apply auth mode

* auto apply authmode for v2 tranformer

* add type amplify_global to v2 schemas

* Update many-relationship-schema-v2.graphql

* Update single-object-auth-schema-v2.graphql

* Update single-object-schema-v2.graphql

* feat: add @auth (#1)

* feat: add @auth base package with Access Control

* feat: graphql auth v2 add schemaChanges, iam policy generation, and query/read resolvers

* feat: graphql auth v2 add auth on mutation and subscription resolvers

* feat(amplify-category-api): add global sandbox mode directive on schema generation (aws-amplify#8074)

* feat(amplify-category-api): add global sandbox mode directive on schema generation

* test(amplify-e2e-tests): add e2e tests for sandbox mode

* test(amplify-category-api): add unit test for generating sandbox mode directive; rm unused method

* feat(cli): add sandbox mode warning to amplify status (aws-amplify#8078)

* feat(amplify-category-api): prompt api key creation on amplify push (aws-amplify#8124)

* feat(amplify-category-api): prompt api key create when invalid with sandbox mode

* test(amplify-category-api): add unit tests for provider utils

* test(amplify-category-api): fix test for adding api key prompt

* refactor(cli): refactor api key prompt

* refactor(amplify-category-api): add api key with gql compiled

* feat: @model conflict resolution

* auth directive support for index, searchable, predictions, functions, and relational directives (aws-amplify#8146)

* feat: add support for index and updated unit and e2e tests

* feat: directive suport for functions, predictions, searchable, and relational

* test: updated unit tests for updated auth on directives

* @auth support for datastore and add has auth flag (aws-amplify#8168)

* feat: @auth v2 on datastore and updated unit tests
* feat: add hasAuthFlag

* feat(graphql-model-transformer): set up transformer for sandbox mode directive (aws-amplify#8138)

* feat(graphql-model-transformer): add sandbox mode support to model transformer

* refactor(graphql-transformer-core): do not persist sandbox mode meta data

* fix: add command to show access control and field auth evaluation in access control (aws-amplify#8174)

* fix: admin ui app state check and auth transformer index resolver name (aws-amplify#8175)

* fix: has auth typo and qref on field conditions for private rule (aws-amplify#8180)

* fix(graphql-model-transformer): use hasAuth flag when sandbox mode is disabled (aws-amplify#8179)

* fix: update hasMany to use join table name, sync config warning, updated unit test

* fix: add empty payload for sandbox mode

* fix: snapshot test for @searchable

* fix: udpated snapshot for index and relation directives

* fix: use same none datasource name as resolver manager

* fix: iam resolver check and relational payload (aws-amplify#8234)

* fix: add datastore query in config for auth (aws-amplify#8246)

* fix: auth filter expression (aws-amplify#8248)

* fix: update iam auth to include roles in before template (aws-amplify#8259)

* chore: rebase and update auth dependencies

* fix(graphql-model-transformer): iam role name does not exceed 64 characters

* fix: add base e2e tests with auth fixes

Co-authored-by: Danielle Adams <6271256+danielleadams@users.noreply.github.com>
Co-authored-by: lazpavel <85319655+lazpavel@users.noreply.github.com>

* fix: update dependency versions

* feat(amplify-provider-awscloudformation): match env directive field for sandbox mode (#3)

* fix(amplify-provider-awscloudformation): invoke api function from invoker plugin (aws-amplify#8274)

* fix(amplify-provider-awscloudformation): invoke api function from invoker plugin

* fix(graphql-index-transformer): update snapshots for tests

* test(amplify-provider-awscloudformation): fix tests for sandbox helpers

* fix(amplify-provider-awscloudformation): remove sandbox mode directive from schema before transform (aws-amplify#8272)

* chore(graphql-auth-transformer): update deps for auth transformer and api category

* fix(graphql-model-transformer): revert code to master version

* test(graphql-model-transformer): update the snapshot for the amplify/graphql-model-transformer test

* chore: remove showacm as that was for testing purposes only

* test(amplify-e2e-tests): update to use correct helpers

* test(graphql-transformers-e2e-tests): enable sandbox mode on v2 transforms

* test(amplify-e2e-tests): replace updateAPIResolution imports with new methods

* fix: get item query for @model and relational directives

* auto apply auth fix

* auto apply auth modes v2 fix (#4)

* test(amplify-e2e-tests): rm sandbox e2e test

* fix(amplify-provider-awscloudformation): fix api key creation when sandbox mode enable

* test(amplify-e2e-tests): create random app name generator for broken tests

* fix api e2e workflow

* test(amplify-e2e-core): add random app name generator, update snapshots and imports

* chore(graphql-auth-transformer): upgrade deps in auth transformer

* update e2e test to use new api workflow (#5)

* feat(graphql-model-transformer): fix default value e2e test (#6)

* test(amplify-e2e-tests): add missing helper

* e2e fix for auth tests using new api workflow  (aws-amplify#7)

* update e2e test to use new api workflow

* fix(test): update auth tests with new api workflow

* test(amplify-e2e-tests): add missing helper and fix broken test

Co-authored-by: Christopher Sundersingh <sundersc@amazon.com>
Co-authored-by: Christopher Sundersingh <83315412+sundersc@users.noreply.github.com>
Co-authored-by: Josue Ruiz <7465495+SwaySway@users.noreply.github.com>
Co-authored-by: lazpavel <85319655+lazpavel@users.noreply.github.com>
Co-authored-by: Colin Ihrig <colihrig@amazon.com>
abhi7cr pushed a commit that referenced this pull request May 6, 2022
…env paths (aws-amplify#8887)

* test: update migration tests with v5.2 and v6.1

* Test/migration fix (#1)

* ci: remove env variables for migration related tests

* test: migration test fixes

Co-authored-by: SwaySway <7465495+SwaySway@users.noreply.github.com>
Co-authored-by: AmmarKarachi <ammkara@dev-dsk-ammkara-2a-8b7d2720.us-west-2.amazon.com>

* test: update test configs to use v5 & v6, remove latest tests, add version check

* refactor(amplify-migration-tests): update comments

* fix: udpate correct version in allowed version list and correct names in split e2e

Co-authored-by: Ammar <56042290+ammarkarachi@users.noreply.github.com>
Co-authored-by: AmmarKarachi <ammkara@dev-dsk-ammkara-2a-8b7d2720.us-west-2.amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants