Skip to content

Add support for Cosmos field level auth#1468

Merged
tarazou9 merged 36 commits intomainfrom
users/tarazou/CosmosFieldAuth
May 11, 2023
Merged

Add support for Cosmos field level auth#1468
tarazou9 merged 36 commits intomainfrom
users/tarazou/CosmosFieldAuth

Conversation

@tarazou9
Copy link
Copy Markdown
Contributor

@tarazou9 tarazou9 commented May 2, 2023

Why make this change?

What is this change?

  • Enable GraphQLFilterParser for Cosmos. 
  • Resolve WILDCARD and parse all the columns from schema.gql
  • Parse Included and Excluded columns from runtime config by injecting AuthorizationResolver into the CosmosMutationEngine to make a call to check the columns. 

How was this tested?

  • Integration Tests
  • Unit Tests

@Aniruddh25

This comment was marked as outdated.

Comment thread src/Service/Models/GraphQLFilterParsers.cs Outdated
Comment thread src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs Outdated
Comment thread src/Service.Tests/dab-config.CosmosDb_NoSql.json Outdated
Comment thread src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs Outdated
Comment thread src/Service/Resolvers/CosmosMutationEngine.cs
Comment thread src/Service.Tests/CosmosTests/TestBase.cs Outdated
Comment thread src/Service/Services/GraphQLSchemaCreator.cs Outdated
Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for implementing this new feature! Few more concerns then its good to go

Copy link
Copy Markdown
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits on naming/comments to clarify intent.

Comment thread src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs Outdated
Comment thread src/Service.Tests/CosmosTests/QueryFilterTests.cs Outdated
Comment thread src/Service/Models/GraphQLFilterParsers.cs Outdated
Comment thread src/Service/Models/GraphQLFilterParsers.cs Outdated
Comment thread src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs Outdated
Comment thread src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs Outdated
Copy link
Copy Markdown
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last nit, otherwise looks good!

Comment thread src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs Outdated
Comment thread src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs Outdated
Comment thread config-generators/cosmosdb_nosql-commands.txt
Comment thread src/Service.Tests/CosmosTests/TestBase.cs
Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contributions :)

Comment thread src/Service.Tests/CosmosTests/QueryFilterTests.cs Outdated
Comment thread src/Service.Tests/CosmosTests/QueryFilterTests.cs Outdated
Comment thread src/Service/Resolvers/CosmosMutationEngine.cs Outdated
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.

Getting Access forbidden message when trying to use filter on graphql queries

4 participants