From 75c7104839372e82cdaa62dcfdd0475665d39869 Mon Sep 17 00:00:00 2001 From: Shubhendu Madhukar Date: Fri, 4 Aug 2023 14:05:38 +0000 Subject: [PATCH] docs: typo/formatting fixes --- docs/available-monitoring.md | 2 +- docs/external-data-source.md | 4 ++-- docs/external-helper.md | 2 +- docs/external-middleware.md | 2 +- docs/folder-structure.md | 2 +- docs/handlebars.md | 6 +++--- docs/mocking-gRPC.md | 4 ++-- docs/openAPI-conversion.md | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/available-monitoring.md b/docs/available-monitoring.md index 52e525e..b25ca2e 100644 --- a/docs/available-monitoring.md +++ b/docs/available-monitoring.md @@ -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. diff --git a/docs/external-data-source.md b/docs/external-data-source.md index 4dd4f99..0ea8b77 100644 --- a/docs/external-data-source.md +++ b/docs/external-data-source.md @@ -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. @@ -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. `;` diff --git a/docs/external-helper.md b/docs/external-helper.md index 83a26c8..ee53b7f 100644 --- a/docs/external-helper.md +++ b/docs/external-helper.md @@ -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: diff --git a/docs/external-middleware.md b/docs/external-middleware.md index 798c97a..b6bac4c 100644 --- a/docs/external-middleware.md +++ b/docs/external-middleware.md @@ -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. diff --git a/docs/folder-structure.md b/docs/folder-structure.md index 84411a2..0de4b43 100644 --- a/docs/folder-structure.md +++ b/docs/folder-structure.md @@ -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. diff --git a/docs/handlebars.md b/docs/handlebars.md index 5d097fc..1f73a40 100644 --- a/docs/handlebars.md +++ b/docs/handlebars.md @@ -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; @@ -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 diff --git a/docs/mocking-gRPC.md b/docs/mocking-gRPC.md index 6d8a9e9..b7a47df 100644 --- a/docs/mocking-gRPC.md +++ b/docs/mocking-gRPC.md @@ -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. @@ -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. diff --git a/docs/openAPI-conversion.md b/docs/openAPI-conversion.md index ca4bc2a..2894d23 100644 --- a/docs/openAPI-conversion.md +++ b/docs/openAPI-conversion.md @@ -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.