Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/QueryString and Feature/Security #12

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
00dc8ed
Updating the query string lib to handle nested objects in the payload…
RichardTMiles Dec 9, 2019
44398c9
Updating the query string lib to handle nested objects in the payload…
RichardTMiles Dec 9, 2019
db3c44f
exact version of qs
RichardTMiles Dec 9, 2019
75f2603
Added a recursive search option to match and ignore values.
Dec 11, 2019
712c86e
Updating var declaration
Dec 11, 2019
45e83c8
Objects in objects use case bugfix
Dec 11, 2019
9de28b4
Attempting to fix file naming in prior pr and added request payload t…
RichardTMiles Dec 13, 2019
c496147
wrong string concat
RichardTMiles Dec 13, 2019
99d11d2
need a log
RichardTMiles Dec 13, 2019
5526676
need a log
RichardTMiles Dec 13, 2019
70dc1f9
need a log
RichardTMiles Dec 13, 2019
249cfa6
need a log
RichardTMiles Dec 13, 2019
92c3381
gaining on it
RichardTMiles Dec 13, 2019
db2bc57
certs failing and normalized url need fixing
RichardTMiles Feb 6, 2020
f055e88
the stopping of security completely is bad mmk. but the code work in …
RichardTMiles Feb 6, 2020
ad4b66e
Merge pull request #1 from RichardTMiles/feature/certValidations
RichardTMiles Feb 6, 2020
c5e4302
ssl security is now a feature
RichardTMiles Feb 6, 2020
9274289
Merge pull request #2 from RichardTMiles/feature/certValidations
RichardTMiles Feb 6, 2020
a42796a
No idea if this will work
RichardTMiles Feb 6, 2020
f9418b0
working security disable option
RichardTMiles Feb 6, 2020
20f40dc
Merge pull request #3 from RichardTMiles/feature/certValidations
RichardTMiles Feb 6, 2020
d92a6a0
Stable and options
RichardTMiles Feb 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ matchHeaders = ["X-UserName"]
# If you set to true it will match them all. Default is to ignore headers.
# If you prefix a header with @ it will match based on presence of the header
# and not the value of it.
secure = true
# enable and disable ssl security validations for given mapping
matchProps = ["id"]
# Create a whitelist of properties (query/body) to base cache on.
# Or set to false to match no properties. Default is to match all.
matchPropsRecursive = false
# iterate through every object and array in the request boday to find matchProps values
ignoreProps = ["nonce"]
# Create a list of properties to ignore when otherwise matching all.
contentType = "application/json"
Expand Down Expand Up @@ -116,14 +120,15 @@ When AMP receives a request, it maps information from that request into a filena
<dataRoot>/<mappingDir>/<method>/<matchedHeaders*>/<urlPath>--<queryParams>.mock
```

| Part | Note |
|------------------|--------------------------------------------------------------------------------------|
| `dataRoot` | This is the folder set in the configuration, or `data` by default |
| `mappingDir` | This is also a configurable value, usually the same as the base path for the mapping |
| `method` | The HTTP method of the request (GET, POST, PUT, etc) |
| `matchedHeaders` | If `matchHeaders` is configured, will be a folder for each header-value combination |
| `urlPath` | The path of the URL |
| `queryParams` | A combination of query string parameters and body parameters (for POST, PUT) |
| Part | Note |
|------------------------|--------------------------------------------------------------------------------------|
| `dataRoot` | This is the folder set in the configuration, or `data` by default |
| `mappingDir` | This is also a configurable value, usually the same as the base path for the mapping |
| `method` | The HTTP method of the request (GET, POST, PUT, etc) |
| `matchedHeaders` | If `matchHeaders` is configured, will be a folder for each header-value combination |
| `urlPath` | The path of the URL |
| `queryParams` | A combination of query string parameters and body parameters (for POST, PUT) |
| `matchPropsRecursive` | Match deeply nested body parameters or the full query if no queryParams provided |

An example is probably best.

Expand Down Expand Up @@ -164,6 +169,8 @@ In general the format is the status code, blank line, headers (one per line), bl
And example might be:

```
Original request body :: {}

200

Connection: Keep-Alive
Expand Down
Loading