Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions skills/dev-proxy/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: dev-proxy
metadata:
version: 1.0.0
version: 1.1.0
description: "Simulate API failures, mock responses, test rate limiting, and analyze API traffic using Dev Proxy's plugin-based proxy engine. WHEN: 'mock API responses', 'simulate API errors', 'test rate limiting', 'test error handling', 'mock OpenAI responses', 'test AI app', 'analyze API usage', 'configure Dev Proxy', 'install Dev Proxy', 'set up Dev Proxy', 'use Dev Proxy in CI/CD', 'chaos testing for APIs', 'run Dev Proxy in background', 'detached mode', 'run Dev Proxy detached'."
---

Expand Down Expand Up @@ -79,7 +79,7 @@ A quick reference. All configuration details are in [references/configuration.md

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "PluginName",
Expand All @@ -90,7 +90,7 @@ A quick reference. All configuration details are in [references/configuration.md
],
"urlsToWatch": ["https://api.contoso.com/*"],
"pluginConfig": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/pluginname.schema.json"
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/pluginname.schema.json"
}
}
```
Expand Down
10 changes: 5 additions & 5 deletions skills/dev-proxy/references/analyze-api-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Use `OpenApiSpecGeneratorPlugin` to reverse-engineer OpenAPI specs from intercep

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "OpenApiSpecGeneratorPlugin",
Expand All @@ -56,7 +56,7 @@ Use `OpenApiSpecGeneratorPlugin` to reverse-engineer OpenAPI specs from intercep
],
"urlsToWatch": ["https://api.contoso.com/*"],
"openApiSpecGeneratorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/openapispecgeneratorplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/openapispecgeneratorplugin.schema.json",
"specVersion": "v3_0",
"specFormat": "Json",
"includeOptionsRequests": false,
Expand Down Expand Up @@ -349,7 +349,7 @@ Reporter plugins format report output. Always place them AFTER reporting plugins

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{ "name": "ExecutionSummaryPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "executionSummaryPlugin" },
{ "name": "GraphMinimalPermissionsPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "graphMinimalPermissionsPlugin" },
Expand All @@ -369,7 +369,7 @@ Reporter plugins format report output. Always place them AFTER reporting plugins

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{ "name": "ApiCenterOnboardingPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "apiCenterOnboardingPlugin" },
{ "name": "ApiCenterProductionVersionPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "apiCenterProductionVersionPlugin" },
Expand All @@ -385,7 +385,7 @@ Reporter plugins format report output. Always place them AFTER reporting plugins

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{ "name": "UrlDiscoveryPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll" },
{ "name": "OpenApiSpecGeneratorPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "openApiSpecGeneratorPlugin" },
Expand Down
10 changes: 5 additions & 5 deletions skills/dev-proxy/references/ci-cd-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Access via `${{ steps.<step-id>.outputs.proxy-url }}`.
```yaml
- uses: dev-proxy-tools/actions/setup@v1
with:
version: 2.4.0
version: 3.0.0
```

### Multiple Recording Sessions
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:

- uses: dev-proxy-tools/actions/setup@v1
with:
version: 2.4.0
version: 3.0.0

- id: start-proxy
uses: dev-proxy-tools/actions/start@v1
Expand Down Expand Up @@ -182,7 +182,7 @@ No dedicated actions — use script tasks with the Dev Proxy API.
```yaml
variables:
- name: DEV_PROXY_VERSION
value: v2.4.0
value: v3.0.0
Comment thread
garrytrinder marked this conversation as resolved.

steps:
- task: Cache@2
Expand Down Expand Up @@ -233,7 +233,7 @@ pool:

variables:
- name: DEV_PROXY_VERSION
value: v2.4.0
value: v3.0.0
- name: LOG_FILE
value: devproxy.log

Expand Down Expand Up @@ -300,7 +300,7 @@ For any CI system, follow these steps:
### 1. Install with Pinned Version

```bash
bash -c "$(curl -sL https://aka.ms/devproxy/setup.sh)" -- v2.4.0
bash -c "$(curl -sL https://aka.ms/devproxy/setup.sh)" -- v3.0.0
```

### 2. Start in Background with Logging
Expand Down
4 changes: 2 additions & 2 deletions skills/dev-proxy/references/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A configuration file follows a specific property order: `$schema`, then `plugins

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "RetryAfterPlugin",
Expand All @@ -28,7 +28,7 @@ A configuration file follows a specific property order: `$schema`, then `plugins
"https://jsonplaceholder.typicode.com/*"
],
"genericRandomErrorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/genericrandomerrorplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/genericrandomerrorplugin.schema.json",
"errorsFile": "devproxy-errors.json",
"rate": 50
},
Expand Down
4 changes: 2 additions & 2 deletions skills/dev-proxy/references/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ Or with PowerShell:
Pass the version to the setup script:

```bash
bash -c "$(curl -sL https://aka.ms/devproxy/setup.sh)" -- v2.4.0
bash -c "$(curl -sL https://aka.ms/devproxy/setup.sh)" -- v3.0.0
Comment thread
garrytrinder marked this conversation as resolved.
```

With winget:

```console
winget install DevProxy.DevProxy --version 2.4.0 --silent
winget install DevProxy.DevProxy --version 3.0.0 --silent
```

## First Run Setup
Expand Down
57 changes: 46 additions & 11 deletions skills/dev-proxy/references/mock-api-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The most common mocking plugin. Returns predefined responses matched by URL, HTT

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "MockResponsePlugin",
Expand All @@ -31,7 +31,7 @@ The most common mocking plugin. Returns predefined responses matched by URL, HTT
],
"urlsToWatch": ["https://api.contoso.com/*"],
"mocksPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/mockresponseplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/mockresponseplugin.schema.json",
"mocksFile": "mocks.json",
"blockUnmockedRequests": false
}
Expand All @@ -46,7 +46,7 @@ CLI overrides: `--no-mocks` to disable, `--mocks-file <path>` to change mock fil

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/mockresponseplugin.mocksfile.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/mockresponseplugin.mocksfile.schema.json",
"mocks": [
{
"request": {
Expand Down Expand Up @@ -174,7 +174,7 @@ Creates a fully functional CRUD API backed by an in-memory JSON data store. Supp

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "CrudApiPlugin",
Expand All @@ -184,7 +184,7 @@ Creates a fully functional CRUD API backed by an in-memory JSON data store. Supp
}
],
"customersApi": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/crudapiplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/crudapiplugin.schema.json",
"apiFile": "customers-api.json"
}
}
Expand All @@ -194,7 +194,7 @@ Creates a fully functional CRUD API backed by an in-memory JSON data store. Supp

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/crudapiplugin.apifile.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/crudapiplugin.apifile.schema.json",
"baseUrl": "https://api.contoso.com/v1/customers",
"dataFile": "customers-data.json",
"actions": [
Expand Down Expand Up @@ -226,9 +226,44 @@ Creates a fully functional CRUD API backed by an in-memory JSON data store. Supp
- The data file must be a JSON array (can be empty: `[]`).
- Data persists in memory during the Dev Proxy session.

### Entra Auth for CRUD APIs
### Auth for CRUD APIs

Set `"auth": "entra"` in the API file:
CRUD APIs support two built-in authentication modes: API Key and Entra. Set the `auth` property in the API definition file to `"apiKey"` or `"entra"`.

#### API Key Auth

Set `"auth": "apiKey"` and provide `apiKeyAuthConfig`:

```json
{
"baseUrl": "https://api.contoso.com/v1/customers",
"dataFile": "customers-data.json",
"auth": "apiKey",
"apiKeyAuthConfig": {
"apiKey": "my-secret-key",
"headerName": "X-API-Key",
"queryParameterName": "code"
},
"actions": [
{ "action": "getAll" },
{ "action": "create" }
]
}
```

Dev Proxy checks the header first, then the query parameter. If either matches, the request is authorized.

| Property | Required | Default | Description |
|----------|----------|---------|-------------|
| `apiKey` | Yes | — | The valid API key that must be present in the request |
| `headerName` | No | — | HTTP header name to read the API key from |
| `queryParameterName` | No | — | Query parameter name to read the API key from |

At least one of `headerName` or `queryParameterName` must be specified — omitting both means no request can be authorized. API Key auth applies to all actions and cannot be configured per-action.

#### Entra Auth

Set `"auth": "entra"` and provide `entraAuthConfig`:

```json
{
Expand Down Expand Up @@ -266,7 +301,7 @@ Mocks STDIO communication for MCP servers and STDIO-based apps. Use with `devpro

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "MockStdioResponsePlugin",
Expand All @@ -276,7 +311,7 @@ Mocks STDIO communication for MCP servers and STDIO-based apps. Use with `devpro
}
],
"mockStdioResponsePlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/mockstdioresponseplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/mockstdioresponseplugin.schema.json",
"mocksFile": "stdio-mocks.json",
"blockUnmockedRequests": false
}
Expand All @@ -287,7 +322,7 @@ Mocks STDIO communication for MCP servers and STDIO-based apps. Use with `devpro

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/mockstdioresponseplugin.mocksfile.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/mockstdioresponseplugin.mocksfile.schema.json",
"mocks": [
{
"request": { "bodyFragment": "initialize" },
Expand Down
26 changes: 13 additions & 13 deletions skills/dev-proxy/references/test-api-resilience.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Randomly fails requests with errors from a configured file. Works with any API.

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "GenericRandomErrorPlugin",
Expand All @@ -21,7 +21,7 @@ Randomly fails requests with errors from a configured file. Works with any API.
],
"urlsToWatch": ["https://api.contoso.com/*"],
"genericRandomErrorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/genericrandomerrorplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/genericrandomerrorplugin.schema.json",
"errorsFile": "errors.json",
"rate": 50,
"retryAfterInSeconds": 5
Expand All @@ -41,7 +41,7 @@ CLI: `devproxy --failure-rate 80` overrides `rate`.

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/genericrandomerrorplugin.errorsfile.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/genericrandomerrorplugin.errorsfile.schema.json",
"errors": [
{
"statusCode": 429,
Expand Down Expand Up @@ -70,7 +70,7 @@ When `addDynamicRetryAfter: true`, Dev Proxy auto-calculates the Retry-After val

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/genericrandomerrorplugin.errorsfile.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/genericrandomerrorplugin.errorsfile.schema.json",
"errors": [
{ "statusCode": 400, "body": { "error": { "code": "BadRequest", "message": "The request was malformed or contains invalid parameters." } } },
{ "statusCode": 401, "body": { "error": { "code": "Unauthorized", "message": "Authentication required." } } },
Expand All @@ -89,7 +89,7 @@ When `addDynamicRetryAfter: true`, Dev Proxy auto-calculates the Retry-After val

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/genericrandomerrorplugin.errorsfile.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/genericrandomerrorplugin.errorsfile.schema.json",
"errors": [
{ "statusCode": 429, "headers": [{ "name": "Retry-After", "value": "@dynamic" }, { "name": "Content-Type", "value": "application/json" }], "body": { "error": { "message": "Rate limit reached for default-gpt-4 in organization org-xxx on tokens per min.", "type": "tokens", "param": null, "code": "rate_limit_exceeded" } }, "addDynamicRetryAfter": true },
{ "statusCode": 429, "body": { "error": { "message": "The engine is currently overloaded, please try again later.", "type": "server_error", "param": null, "code": null } } },
Expand All @@ -105,7 +105,7 @@ Fails Microsoft Graph requests with Graph-specific error responses. Supports bat

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "GraphRandomErrorPlugin",
Expand All @@ -119,7 +119,7 @@ Fails Microsoft Graph requests with Graph-specific error responses. Supports bat
"https://graph.microsoft.com/beta/*"
],
"graphRandomErrorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/graphrandomerrorplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/graphrandomerrorplugin.schema.json",
"allowedErrors": [429, 500, 502, 503, 504, 507],
"rate": 50
}
Expand Down Expand Up @@ -163,7 +163,7 @@ Simulates rate-limit behavior with configurable headers, thresholds, and respons

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "RateLimitingPlugin",
Expand All @@ -173,7 +173,7 @@ Simulates rate-limit behavior with configurable headers, thresholds, and respons
}
],
"rateLimiting": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/ratelimitingplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/ratelimitingplugin.schema.json",
"costPerRequest": 2,
"rateLimit": 120,
"resetTimeWindowSeconds": 60,
Expand Down Expand Up @@ -271,7 +271,7 @@ Adds random delay to responses. Works with both HTTP and STDIO.

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{
"name": "LatencyPlugin",
Expand All @@ -281,7 +281,7 @@ Adds random delay to responses. Works with both HTTP and STDIO.
}
],
"latencyPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/latencyplugin.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/latencyplugin.schema.json",
"minMs": 200,
"maxMs": 10000
}
Expand Down Expand Up @@ -311,7 +311,7 @@ devproxy config get openai-throttling

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{ "name": "LatencyPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "latencyPlugin" },
{ "name": "RateLimitingPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "rateLimiting" },
Expand All @@ -328,7 +328,7 @@ devproxy config get openai-throttling

```json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v3.0.0/rc.schema.json",
"plugins": [
{ "name": "RetryAfterPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll" },
{ "name": "GraphRandomErrorPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "graphRandomErrorPlugin" },
Expand Down
Loading