Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhendumadhukar authored Aug 4, 2023
2 parents f389260 + 75c7104 commit d96767f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/available-monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Monitoring might not be of paramount importance when you are running unit tests

To provide the aggregated metrics, Camouflage runs a separate monitoring server, which runs by default on port 5555. The URL `http://localhost:5555/metrics` acts as a scraping endpoint for your Prometheus server. Store this data in Prometheus and then use Grafana to generate your own visualizations. You can install a Prometheus DB and configure it to scrape from `/metrics` endpoint, and use that data to create charts for monitoring your application.

!!!caution
!!!danger

Disable monitoring by setting a negative value to `config.monitoring.port` in config.yaml.

Expand Down
4 changes: 2 additions & 2 deletions docs/external-data-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Camouflage lets you condition your response for a specific set of data. Because we understand that random values don't always fulfill the requirements. Camouflage provides two helpers, `pg` and `csv`, which can be used to connect to a postgres db and csv data file respectively.

!!! caution
!!! danger

Both `pg` and `csv` helpers, rely on code injection for response generation. To use these helpers, the property `injection` needs to be set to `true` in config.yml. Injection can lead to security related issues and should be used judiciously.

Expand Down Expand Up @@ -101,7 +101,7 @@ In that case you'd remove `key` and `value` from the snippet shown above, and si
To get entire data pass `all=true`.
!!!caution
!!!danger
1. Note that, though we are calling it a "c"sv, it's not really comma separated, Camouflage expects the values to be separated by a semicolon. i.e. `;`
Expand Down
2 changes: 1 addition & 1 deletion docs/external-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ HTTP/1.1 200 OK
{{/is}}
```

!!!caution
!!!danger

If you plan to use any external dependencies in your code, you'd need to install them globally on the server Camouflage is hosted on, using `npm i -g package_name`. Before starting Camouflage, run the following command:

Expand Down
2 changes: 1 addition & 1 deletion docs/external-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The variables can be accessed by using `this`, e.g. `this.app`, `this.logger` an
})();
```

!!!caution
!!!danger

If you are using middleware injection, you would be responsible for configuring the mock routes, therefore it is mandatory to include the code `this.app.use(prefix, this.allRoutes)` in your IIFE, where prefix can be a string e.g. "/" or "/api/v1" or any other desired prefix to your mock routes. This would be applicable for all mocks.

Expand Down
2 changes: 1 addition & 1 deletion docs/folder-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Similarly you can create PUT.mock, DELETE.mock etc in your intended path. For wi
naming the files in a certain way. We intend to keep the file names simple and in the format
*${HTTP_METHOD}.mock*

!!! caution
!!! danger

Protocols http, https and http2, share the same mocks directory and folder structure, however folder structure and mocks directory for gRPC and websockets mocks are different. Please refer to the section **Mocking gRPC** if you are planning to create gRPC mocks.

Expand Down
6 changes: 3 additions & 3 deletions docs/handlebars.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ Content-Type: application/json
!!! note
Variables created using `assign` helpers can be accessed using `context.data.root.VARIABLE_NAME` inside the helpers that support code injection (as listed below)

!!! caution
Some of the Camouflage helpers allow (sometimes require) you to write your Javascript code in order to use them. However it's not a great idea to allow such code injections due to security concerns it creates. Camouflage disabled injection by default however you can enable it in config.yml. Following helpers will not work if injection is disabled.
!!! danger
Some of the Camouflage helpers allow (sometimes require) you to write your Javascript code in order to use them. However it's not a great idea to allow such code injections due to security concerns it creates. Camouflage disables injection by default however you can enable it in config.yml. Following helpers will not work if injection is disabled.

- code;
- inject;
Expand Down Expand Up @@ -316,7 +316,7 @@ setCookie(`${prefix}-has-pending-order`, 'true');
setCookie(`${prefix}-cart`, '[{id: 1, name: "prod1"}, {id: 2, name: "prod2"}]');
```

!!! caution
!!! danger
the limit of cookie values in most browsers is 4KB

### Usage in Cypress
Expand Down
4 changes: 2 additions & 2 deletions docs/mocking-gRPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ If you are creating a bidirectional streaming mock, your mock file would contain
}
```

!!! caution
!!! danger

Since BIDI streaming is slightly more complicated to simulate, current implementation of Camouflage only supports the ping-pong model of streaming, i.e. client can send multiple requests as a stream and server will respond to each request with one response as part of a stream. Finally when the client ends the stream, the server will also end the stream. As shown in the example above, the server can also send a response just before ending the stream, but this is optional.

Expand Down Expand Up @@ -133,7 +133,7 @@ Camouflage provides an experimental support to send metadata/trailers with respo
}
```

!!!caution
!!!danger

Since the Camouflage gRPC server needs to register the new services, everytime you add a new protofile, you'd need to restart the Camouflage server. Good news is, you can do so easily by making a get request to /restart endpoint. Though the downtime is minimal (less than a second, we do not recommend restarting the server during a performance test. Note that restart is required only if you add a new protofile. If you have added a new mock file or updated an existing one, a restart is not required.

Expand Down
2 changes: 1 addition & 1 deletion docs/openAPI-conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ If you have access to the OpenAPI specification for the APIs/Endpoints you want
}
```

!!!caution
!!!danger

camoswag currently supports JSON responses only.

0 comments on commit d96767f

Please sign in to comment.