Comments (5)
@rifiles @PatGod Please review the above design and let me know if you see any gaps/issues.
from restler-fuzzer.
@marina-p Thanks, makes sense. Should this be a Swagger annotation (as suggested above) or could this be implemented simply as a new dictionary command?
In other words, does this feature impact the compiler? (If yes, then it should be a new Swagger annotation, otherwise it could/should be a new dictionary option -- OK?)
from restler-fuzzer.
@PatGod Yes, the compiler needs to be updated, because there is no concept of "property name/path" in the grammar today for the user to specify these only to the engine.
As a separate point, these could be specified in the dictionary (and analyzed by the compiler, similar to restler_custom_payload) instead of an annotation, but it's a bit cumbersome because they are on a per request basis, so they actually need to go into the engine settings per_resource_settings
as an inline dictionary. If we supported per-resource settings in the dictionary itself, I think it could go in either dictionary or annotations (and would be easy to support the dictionary case later if we want to add it).
from restler-fuzzer.
@rifiles @PatGod Here's what the dictionary could look like with support for per-resource settings:
"restler_custom_payload_uuid4_suffix": {
"resourceId": "resourceprefix",
"/resource/id": "resourceprefix"
},
"per_resource_settings": {
"/v1/resources/{resourceId}": {
"put": {
"equal_resource_ids": ["resourceId", "/resource/id"]
}
}
}
from restler-fuzzer.
For uuid4 suffix values, the desired behavior already exists in the engine, I believe, without the need for any changes.
If the same uuid4_suffix key is specified in a request, the same value is duplicated each time it's specified in that request.
For instance, in the below scenario, the houseName value in the endpoint and the houseName value in the body will both be the same (example: house1234 and "house1234")
request = requests.Request([
primitives.restler_static_string("PUT "),
primitives.restler_static_string("/"),
primitives.restler_static_string("city"),
primitives.restler_static_string("/"),
primitives.restler_static_string(_city_put_name.reader()),
primitives.restler_static_string("/"),
primitives.restler_static_string("house"),
primitives.restler_static_string("/"),
primitives.restler_custom_payload_uuid4_suffix("houseName"),
primitives.restler_static_string(" HTTP/1.1\r\n"),
primitives.restler_static_string("Accept: application/json\r\n"),
primitives.restler_static_string("Host: restler.unit.test.server.com\r\n"),
primitives.restler_static_string("Content-Type: application/json\r\n"),
primitives.restler_static_string("\r\n"),
primitives.restler_static_string("{"),
primitives.restler_static_string('"house":'),
primitives.restler_custom_payload_uuid4_suffix("houseName", quoted=True),
primitives.restler_static_string("}"),
primitives.restler_refreshable_authentication_token("authentication_token_tag"),
primitives.restler_static_string("\r\n"),
{
'post_send':
{
'parser': parse_cityHouseNamePut,
'dependencies':
[
_city_house_put_name.writer()
]
}
},
The compiler should only need to specify primitives.restler_custom_payload_uuid4_suffix with the same key in multiple places to apply the copied string logic in the engine - no need for an additional id lookup.
However, there is a small bug in the dynamic primitive resolution that needs to be fixed - it currently isn't handling the quoted parameter properly.
from restler-fuzzer.
Related Issues (20)
- refactor compiler configs so strict deserialization can be turned on HOT 2
- Content-Length header is not getting fuzzed based on the list of naughty strings HOT 1
- "Attempting to get resources from GET request..." ignores required GET parameters
- Can't run restler compile
- Ensuring Mandatory Headers for API Access in Restler Requests HOT 1
- How to properly configure and use authentication tokens in Restler? HOT 1
- Improve logging in RESTler compile step in case of a spec issue instead of just failing without and not giving clear indication of which property is problematic HOT 1
- RESTler's attempts to reproduce bugs add extra quotes (") for values sourced from restler_custom_payload
- Automatic inferred dependencies not working
- Trace database requests include authorization token
- Dynamic object encoding is adding extra double quotes when consuming value from other call
- RESTler is logging error for missing parameter in the response even when the parameter is not configured for the specific response code
- RESTler ran forever: "Exhausted collection..." loop prevented RESTler from honoring --time_budget
- Token Refresh Interval is not working under Proxy
- Can RESTler detect other status codes than 500? HOT 1
- Question about "restler_custom_payload_header" HOT 1
- [Feature Request] Improve Annotations to Support Integer Responses
- Handling ByteArray in Request Object During Fuzz Testing: Incorrect JSON Representation Issue
- Authorization using setting 'token_refresh_cmd' not working HOT 2
- Fail to build docker image locally HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restler-fuzzer.