I have…
- [ x ] Read the following guideline: Troubleshooting and Support | Squidex. I understand that my support request might get deleted if I do not follow the guideline.
- [ x ] Used code blocks with ``` to format my code examples like JSON or logs properly.
I’m submitting a…
- [ x ] Documentation issue or request
Current behavior
The main idea is to stop bad actors from collecting information in bulk.
/api/content/<appName>/schemaA?fields=question,answer
bad actor could just remove the params and have access to all data.
Expected behavior
We want to only return certain fields when a GET request is done.
The client site makes a GET request to: /api/content/<appName>/schemaA
We want to hide a field, lets say the category
field from being returned in the batch.
Another GET Request with id
is done but it should return the full object from the schema:
/api/content/<appName>/schemaA?q={filter...
|| /api/content/<appName>/schemaA/{id}
We aren’t too sure how to achieve this with Scripts or Field Rules?
Schema > <schemaA> > scripts
or
Schema > <schemaA> > more > field rules
or is there another way ?
Minimal reproduction of the problem
Environment
App Name:
- Self hosted with docker
- Self hosted with IIS
- [ X ] Self hosted with other version
- Cloud version
Version: [7.5]
Browser:
- Chrome (desktop)
- Chrome (Android)
- Chrome (iOS)
- Firefox
- Safari (desktop)
- Safari (iOS)
- IE
- Edge
Others:
Example:
"SchemaA": {
"fields": [{
"name": "question",
"properties": { ... },
"isLocked": false,
"isHidden": false,
"isDisabled": false,
"partitioning": "invariant"
}, {
"name": "category",
"properties": { ... },
"isLocked": false,
"isHidden": false,
"isDisabled": false,
"partitioning": "invariant"
}, {
"name": "answer",
"properties": { ... },
"isLocked": false,
"isHidden": false,
"isDisabled": false,
"partitioning": "invariant"
}],
}
/schemaA
example of returned object:
{
"total": 19,
"items": [{
"id": "abc",
"data": {
"question": {"iv": "1?"},
"category": {"iv": ["e308"]},//<-- should be hidden/removed from response
"answer": {"iv": "abc"}
},
...
}, {
"id": "def",
"data": {
"question": {"iv": "2?"},
"category": {"iv": ["e302"]},//<-- should be hidden/removed from response
"answer": {"iv": "def"}
},
...
}]
/schemaA/def
{
"id": "def",
"data": {
"question": {"iv": "2?"},
"category": {"iv": ["e302"]},
"answer": {"iv": "def"}
},
...
}