Commit b21a924
authored
Hot Patch for March Release (#1448)
## Why make this change?
- Closes this issue referenced here
#1423. Additional
issue related to this change
#597
- Cosmos DB currently doesn't support field level authorization, it's
expected that we are not honoring ```operationToColumnMap.Excluded```
and ```operationToColumnMap.Included``` and by introducing field level
auth check into the ```GQLFilterParser``` [recent
update](#1407) results the
issue that we are seeing.
- Cosmos have tests to exercise the filter parser, the reason the tests
didn't catch this issue is because the changes here [added
lines](https://github.com/Azure/data-api-builder/blob/1431ffc8c11bcd80f62d51c0c0fd6f15383b147a/src/Service.Tests/CosmosTests/TestBase.cs#L77-L82)
that's added in this PR [recent
update](#1407), this mocks
up the field auth check to always return true for all Cosmos filter
tests.
- ```CosmosMetadataProvider``` does not translate a field wild card (*)
or list of hardcoded include columns to the list of AllowedFields in the
engine's ```AuthorizationResolver``` currently, but we can add a pass
through to the ```TryGetExposedColumnName``` as suggested so it doesn't
throw a ```NotImplementedException``` when user accidently passed in the
fields settings in the Cosmos configuration file.
## What is this change?
- Address this by skipping the field auth check inside of the
GQLFilterParser when the database type is Cosmos
## How was this tested?
- [ x ] Integration Tests
- [ x ] Unit Tests
## Sample Request(s)
```json
query planets {
planets (filter: {id: {eq: 1000}}) {
items {
id
}
}
}
```1 parent 32fc03f commit b21a924
File tree
4 files changed
+60
-4
lines changed- src
- Service.Tests
- Configuration
- CosmosTests
- Service
- Models
- Services/MetadataProviders
4 files changed
+60
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
303 | 320 | | |
304 | 321 | | |
305 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
59 | 96 | | |
60 | 97 | | |
61 | 98 | | |
| |||
170 | 207 | | |
171 | 208 | | |
172 | 209 | | |
173 | | - | |
| 210 | + | |
| 211 | + | |
174 | 212 | | |
175 | 213 | | |
176 | 214 | | |
| |||
0 commit comments