Skip to content

Fix issue when graphql is true and include permission is WILDCARD#1501

Merged
tarazou9 merged 9 commits intomainfrom
usrs/tarazou/fieldAuthNoSingularType
May 24, 2023
Merged

Fix issue when graphql is true and include permission is WILDCARD#1501
tarazou9 merged 9 commits intomainfrom
usrs/tarazou/fieldAuthNoSingularType

Conversation

@tarazou9
Copy link
Copy Markdown
Contributor

Why make this change?

What is this change?

  • Reason for causing this is because GraphQLSingularTypeToEntityNameMap in RuntimeConfig.cs is not adding the entity type when there is no singular type passed in, and for WILDCARD permission check, the AuthorizationResolver is retrieving all the fields columns using the GraphQLSingularTypeToEntityNameMap keys.

How was this tested?

  • Integration Tests

Comment thread config-generators/cosmosdb_nosql-commands.txt Outdated
Comment thread src/Service.Tests/dab-config.CosmosDb_NoSql.json
Comment thread src/Service.Tests/CosmosTests/QueryFilterTests.cs Outdated
Comment thread src/Service.Tests/dab-config.CosmosDb_NoSql.json
Comment thread config-generators/cosmosdb_nosql-commands.txt Outdated
@aaronpowell
Copy link
Copy Markdown
Contributor

I feel like #1402 will tackle this as it is more aggressive in the way that it sets the singular name, resulting in the RuntimeConfig always having a defined singular name, rather than having to rely on additional mapping data structures.

Comment thread src/Service.Tests/CosmosTests/QueryFilterTests.cs
Comment thread src/Service.Tests/CosmosTests/QueryFilterTests.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 fix and testing all other scenarios!

Comment thread config-generators/cosmosdb_nosql-commands.txt
Copy link
Copy Markdown
Contributor

@abhishekkumams abhishekkumams 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 @tarazou9 for addressing the change quickly.

@tarazou9 tarazou9 enabled auto-merge (squash) May 24, 2023 13:55
@tarazou9 tarazou9 merged commit 5686386 into main May 24, 2023
@tarazou9 tarazou9 deleted the usrs/tarazou/fieldAuthNoSingularType branch May 24, 2023 14:20
tarazou9 added a commit that referenced this pull request May 24, 2023
## Why make this change?

- This is for cherry-pick the bug fix from main into the release 0.7

## What is this change?

Here is the PR merged in main for the fix. 
#1501
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

6 participants