From 11b8e2b32e89a499e5ddae670fbfc7b7c954afe1 Mon Sep 17 00:00:00 2001 From: Waldek Mastykarz Date: Fri, 2 May 2025 11:45:35 +0200 Subject: [PATCH 1/2] Updates version to v0.28.0 --- Dockerfile | 2 +- Dockerfile_beta | 2 +- .../dev-proxy-abstractions.csproj | 2 +- dev-proxy-plugins/Mocks/MockResponsePlugin.cs | 2 +- dev-proxy-plugins/dev-proxy-plugins.csproj | 2 +- dev-proxy/config/m365-mocks.json | 2 +- dev-proxy/config/m365.json | 18 +- .../config/microsoft-graph-rate-limiting.json | 2 +- dev-proxy/config/microsoft-graph.json | 6 +- dev-proxy/config/spo-csom-types.json | 2 +- dev-proxy/dev-proxy.csproj | 2 +- dev-proxy/devproxy-errors.json | 2 +- dev-proxy/devproxyrc.json | 4 +- install-beta.iss | 4 +- install.iss | 4 +- ...centerminimalpermissionsplugin.schema.json | 34 ++++ .../apicenteronboardingplugin.schema.json | 37 ++++ ...icenterproductionversionplugin.schema.json | 33 ++++ schemas/v0.28.0/authplugin.schema.json | 133 +++++++++++++ .../v0.28.0/cachingguidanceplugin.schema.json | 16 ++ .../v0.28.0/crudapiplugin.apifile.schema.json | 151 ++++++++++++++ schemas/v0.28.0/crudapiplugin.schema.json | 19 ++ schemas/v0.28.0/devtoolsplugin.schema.json | 21 ++ .../executionsummaryplugin.schema.json | 20 ++ ...icrandomerrorplugin.errorsfile.schema.json | 103 ++++++++++ .../genericrandomerrorplugin.schema.json | 30 +++ ...nimalpermissionsguidanceplugin.schema.json | 19 ++ .../graphminimalpermissionsplugin.schema.json | 20 ++ .../graphrandomerrorplugin.schema.json | 32 +++ .../httpfilegeneratorplugin.schema.json | 16 ++ schemas/v0.28.0/latencyplugin.schema.json | 23 +++ .../minimalcsompermissions.types.schema.json | 58 ++++++ .../minimalcsompermissionsplugin.schema.json | 16 ++ ...nimalpermissionsguidanceplugin.schema.json | 19 ++ .../minimalpermissionsplugin.schema.json | 19 ++ .../mockrequestplugin.mockfile.schema.json | 70 +++++++ schemas/v0.28.0/mockrequestplugin.schema.json | 19 ++ .../mockresponseplugin.mocksfile.schema.json | 104 ++++++++++ .../v0.28.0/mockresponseplugin.schema.json | 19 ++ .../openapispecgeneratorplugin.schema.json | 32 +++ ...itingplugin.customresponsefile.schema.json | 46 +++++ .../v0.28.0/ratelimitingplugin.schema.json | 69 +++++++ schemas/v0.28.0/rc.schema.json | 187 ++++++++++++++++++ .../rewriteplugin.rewritesfile.schema.json | 50 +++++ schemas/v0.28.0/rewriteplugin.schema.json | 19 ++ .../typespecgeneratorplugin.schema.json | 16 ++ scripts/Dockerfile_local | 2 +- scripts/local-setup.ps1 | 2 +- scripts/version.ps1 | 2 +- 49 files changed, 1481 insertions(+), 31 deletions(-) create mode 100644 schemas/v0.28.0/apicenterminimalpermissionsplugin.schema.json create mode 100644 schemas/v0.28.0/apicenteronboardingplugin.schema.json create mode 100644 schemas/v0.28.0/apicenterproductionversionplugin.schema.json create mode 100644 schemas/v0.28.0/authplugin.schema.json create mode 100644 schemas/v0.28.0/cachingguidanceplugin.schema.json create mode 100644 schemas/v0.28.0/crudapiplugin.apifile.schema.json create mode 100644 schemas/v0.28.0/crudapiplugin.schema.json create mode 100644 schemas/v0.28.0/devtoolsplugin.schema.json create mode 100644 schemas/v0.28.0/executionsummaryplugin.schema.json create mode 100644 schemas/v0.28.0/genericrandomerrorplugin.errorsfile.schema.json create mode 100644 schemas/v0.28.0/genericrandomerrorplugin.schema.json create mode 100644 schemas/v0.28.0/graphminimalpermissionsguidanceplugin.schema.json create mode 100644 schemas/v0.28.0/graphminimalpermissionsplugin.schema.json create mode 100644 schemas/v0.28.0/graphrandomerrorplugin.schema.json create mode 100644 schemas/v0.28.0/httpfilegeneratorplugin.schema.json create mode 100644 schemas/v0.28.0/latencyplugin.schema.json create mode 100644 schemas/v0.28.0/minimalcsompermissions.types.schema.json create mode 100644 schemas/v0.28.0/minimalcsompermissionsplugin.schema.json create mode 100644 schemas/v0.28.0/minimalpermissionsguidanceplugin.schema.json create mode 100644 schemas/v0.28.0/minimalpermissionsplugin.schema.json create mode 100644 schemas/v0.28.0/mockrequestplugin.mockfile.schema.json create mode 100644 schemas/v0.28.0/mockrequestplugin.schema.json create mode 100644 schemas/v0.28.0/mockresponseplugin.mocksfile.schema.json create mode 100644 schemas/v0.28.0/mockresponseplugin.schema.json create mode 100644 schemas/v0.28.0/openapispecgeneratorplugin.schema.json create mode 100644 schemas/v0.28.0/ratelimitingplugin.customresponsefile.schema.json create mode 100644 schemas/v0.28.0/ratelimitingplugin.schema.json create mode 100644 schemas/v0.28.0/rc.schema.json create mode 100644 schemas/v0.28.0/rewriteplugin.rewritesfile.schema.json create mode 100644 schemas/v0.28.0/rewriteplugin.schema.json create mode 100644 schemas/v0.28.0/typespecgeneratorplugin.schema.json diff --git a/Dockerfile b/Dockerfile index 9cef2deb..575c90bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:24.04 -ARG DEVPROXY_VERSION=0.25.0 +ARG DEVPROXY_VERSION=0.28.0 ARG USERNAME=devproxy ENV DEVPROXY_VERSION=${DEVPROXY_VERSION} diff --git a/Dockerfile_beta b/Dockerfile_beta index 3b4caa9f..7f9ea150 100644 --- a/Dockerfile_beta +++ b/Dockerfile_beta @@ -1,6 +1,6 @@ FROM ubuntu:24.04 -ARG DEVPROXY_VERSION=0.25.0 +ARG DEVPROXY_VERSION=0.28.0 ARG USERNAME=devproxy ENV DEVPROXY_VERSION=${DEVPROXY_VERSION} diff --git a/dev-proxy-abstractions/dev-proxy-abstractions.csproj b/dev-proxy-abstractions/dev-proxy-abstractions.csproj index 7c73f108..75e457f4 100644 --- a/dev-proxy-abstractions/dev-proxy-abstractions.csproj +++ b/dev-proxy-abstractions/dev-proxy-abstractions.csproj @@ -5,7 +5,7 @@ DevProxy.Abstractions enable enable - 0.27.0 + 0.28.0 false true diff --git a/dev-proxy-plugins/Mocks/MockResponsePlugin.cs b/dev-proxy-plugins/Mocks/MockResponsePlugin.cs index 605fe606..a6875940 100644 --- a/dev-proxy-plugins/Mocks/MockResponsePlugin.cs +++ b/dev-proxy-plugins/Mocks/MockResponsePlugin.cs @@ -28,7 +28,7 @@ public class MockResponseConfiguration public bool BlockUnmockedRequests { get; set; } = false; [JsonPropertyName("$schema")] - public string Schema { get; set; } = "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/mockresponseplugin.mocksfile.schema.json"; + public string Schema { get; set; } = "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/mockresponseplugin.mocksfile.schema.json"; public IEnumerable Mocks { get; set; } = []; } diff --git a/dev-proxy-plugins/dev-proxy-plugins.csproj b/dev-proxy-plugins/dev-proxy-plugins.csproj index a05ff5a1..718fbe6a 100644 --- a/dev-proxy-plugins/dev-proxy-plugins.csproj +++ b/dev-proxy-plugins/dev-proxy-plugins.csproj @@ -6,7 +6,7 @@ enable true OnOutputUpdated - 0.27.0 + 0.28.0 false true diff --git a/dev-proxy/config/m365-mocks.json b/dev-proxy/config/m365-mocks.json index 584496ad..f10f1b3a 100644 --- a/dev-proxy/config/m365-mocks.json +++ b/dev-proxy/config/m365-mocks.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/mockresponseplugin.mocksfile.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/mockresponseplugin.mocksfile.schema.json", "mocks": [ { "request": { diff --git a/dev-proxy/config/m365.json b/dev-proxy/config/m365.json index b37e7a59..4615b990 100644 --- a/dev-proxy/config/m365.json +++ b/dev-proxy/config/m365.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rc.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/rc.schema.json", "plugins": [ { "name": "DevToolsPlugin", @@ -173,11 +173,11 @@ "https://*.sharepoint-df.*/*_vti_bin/*" ], "mocksPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/mockresponseplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/mockresponseplugin.schema.json", "mocksFile": "m365-mocks.json" }, "graphRandomErrorsPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/graphrandomerrorplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/graphrandomerrorplugin.schema.json", "allowedErrors": [ 429, 500, @@ -189,28 +189,28 @@ "rate": 50 }, "executionSummaryPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/executionsummaryplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/executionsummaryplugin.schema.json", "groupBy": "url" }, "graphMinimalPermissionsPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/graphminimalpermissionsplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/graphminimalpermissionsplugin.schema.json", "type": "delegated" }, "cachingGuidance": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/cachingguidanceplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/cachingguidanceplugin.schema.json", "cacheThresholdSeconds": 5 }, "latencyPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/latencyplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/latencyplugin.schema.json", "minMs": 200, "maxMs": 10000 }, "devTools": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/devtoolsplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/devtoolsplugin.schema.json", "preferredBrowser": "Edge" }, "rateLimiting": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/ratelimitingplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/ratelimitingplugin.schema.json", "costPerRequest": 2, "rateLimit": 120, "retryAfterSeconds": 5 diff --git a/dev-proxy/config/microsoft-graph-rate-limiting.json b/dev-proxy/config/microsoft-graph-rate-limiting.json index d8a2949e..ebe53b64 100644 --- a/dev-proxy/config/microsoft-graph-rate-limiting.json +++ b/dev-proxy/config/microsoft-graph-rate-limiting.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rc.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/rc.schema.json", "plugins": [ { "name": "RateLimitingPlugin", diff --git a/dev-proxy/config/microsoft-graph.json b/dev-proxy/config/microsoft-graph.json index e1b1e531..a2febdea 100644 --- a/dev-proxy/config/microsoft-graph.json +++ b/dev-proxy/config/microsoft-graph.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rc.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/rc.schema.json", "plugins": [ { "name": "GraphSelectGuidancePlugin", @@ -67,7 +67,7 @@ "https://microsoftgraph.chinacloudapi.cn/beta/*" ], "graphRandomErrorsPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/graphrandomerrorplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/graphrandomerrorplugin.schema.json", "allowedErrors": [ 429, 500, @@ -79,7 +79,7 @@ "rate": 50 }, "executionSummaryPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/executionsummaryplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/executionsummaryplugin.schema.json", "groupBy": "url" }, "labelMode": "text", diff --git a/dev-proxy/config/spo-csom-types.json b/dev-proxy/config/spo-csom-types.json index 12163a9d..6086ad43 100644 --- a/dev-proxy/config/spo-csom-types.json +++ b/dev-proxy/config/spo-csom-types.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/minimalcsompermissions.types.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/minimalcsompermissions.types.schema.json", "types": { "268004ae-ef6b-4e9b-8425-127220d84719": "Microsoft.Online.SharePoint.TenantAdministration.Tenant", "3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a": "Microsoft.SharePoint.Client.RequestContext" diff --git a/dev-proxy/dev-proxy.csproj b/dev-proxy/dev-proxy.csproj index 73a02eac..29d9c7c7 100644 --- a/dev-proxy/dev-proxy.csproj +++ b/dev-proxy/dev-proxy.csproj @@ -8,7 +8,7 @@ enable LICENSE Dev Proxy - 0.27.0 + 0.28.0 .NET Foundation Dev Proxy devproxy diff --git a/dev-proxy/devproxy-errors.json b/dev-proxy/devproxy-errors.json index 4aa54ee2..c5b222be 100644 --- a/dev-proxy/devproxy-errors.json +++ b/dev-proxy/devproxy-errors.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/genericrandomerrorplugin.errorsfile.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/genericrandomerrorplugin.errorsfile.schema.json", "errors": [ { "request": { diff --git a/dev-proxy/devproxyrc.json b/dev-proxy/devproxyrc.json index 1aced215..5a42bd1c 100644 --- a/dev-proxy/devproxyrc.json +++ b/dev-proxy/devproxyrc.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rc.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/rc.schema.json", "plugins": [ { "name": "RetryAfterPlugin", @@ -17,7 +17,7 @@ "https://jsonplaceholder.typicode.com/*" ], "genericRandomErrorPlugin": { - "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/genericrandomerrorplugin.schema.json", + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/genericrandomerrorplugin.schema.json", "errorsFile": "devproxy-errors.json", "rate": 50 }, diff --git a/install-beta.iss b/install-beta.iss index d4044c26..09d58b0c 100644 --- a/install-beta.iss +++ b/install-beta.iss @@ -3,8 +3,8 @@ #define MyAppName "Dev Proxy Beta" ; for local use only. In production replaced by a command line arg -#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.27.0-beta.1" -#define MyAppVersion "0.27.0-beta.1" +#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.28.0-beta.1" +#define MyAppVersion "0.28.0-beta.1" #define MyAppPublisher ".NET Foundation" #define MyAppURL "https://aka.ms/devproxy" diff --git a/install.iss b/install.iss index 4fe1cfa4..20fa9c78 100644 --- a/install.iss +++ b/install.iss @@ -3,8 +3,8 @@ #define MyAppName "Dev Proxy" ; for local use only. In production replaced by a command line arg -#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.27.0" -#define MyAppVersion "0.27.0" +#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.28.0" +#define MyAppVersion "0.28.0" #define MyAppPublisher ".NET Foundation" #define MyAppURL "https://aka.ms/devproxy" diff --git a/schemas/v0.28.0/apicenterminimalpermissionsplugin.schema.json b/schemas/v0.28.0/apicenterminimalpermissionsplugin.schema.json new file mode 100644 index 00000000..9350a97b --- /dev/null +++ b/schemas/v0.28.0/apicenterminimalpermissionsplugin.schema.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy ApiCenterMinimalPermissionsPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "resourceGroupName": { + "type": "string", + "description": "Name of the resource group where the Azure API Center is located." + }, + "serviceName": { + "type": "string", + "description": "Name of the Azure API Center instance that Dev Proxy should use to check if the APIs used in the app are registered." + }, + "subscriptionId": { + "type": "string", + "description": "ID of the Azure subscription where the Azure API Center instance is located." + }, + "workspace": { + "type": "string", + "description": "Name of the Azure API Center workspace to use. Default is 'default'.", + "default": "default" + } + }, + "required": [ + "resourceGroupName", + "serviceName", + "subscriptionId" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/apicenteronboardingplugin.schema.json b/schemas/v0.28.0/apicenteronboardingplugin.schema.json new file mode 100644 index 00000000..ee3bde34 --- /dev/null +++ b/schemas/v0.28.0/apicenteronboardingplugin.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy ApiCenterOnboardingPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "createApicEntryForNewApis": { + "type": "boolean", + "description": "Set to true to have Dev Proxy create new API entries for APIs detected but not yet registered in API Center. When false, Dev Proxy only lists unregistered APIs. Default is true." + }, + "resourceGroupName": { + "type": "string", + "description": "Name of the resource group where the Azure API Center is located." + }, + "serviceName": { + "type": "string", + "description": "Name of the Azure API Center instance that Dev Proxy should use to check if the APIs used in the app are registered." + }, + "subscriptionId": { + "type": "string", + "description": "ID of the Azure subscription where the Azure API Center instance is located." + }, + "workspace": { + "type": "string", + "description": "Name of the Azure API Center workspace to use. Default is 'default'." + } + }, + "required": [ + "resourceGroupName", + "serviceName", + "subscriptionId" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/apicenterproductionversionplugin.schema.json b/schemas/v0.28.0/apicenterproductionversionplugin.schema.json new file mode 100644 index 00000000..ce726153 --- /dev/null +++ b/schemas/v0.28.0/apicenterproductionversionplugin.schema.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy ApiCenterProductionVersionPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "resourceGroupName": { + "type": "string", + "description": "Name of the resource group where the Azure API Center is located." + }, + "serviceName": { + "type": "string", + "description": "Name of the Azure API Center instance that Dev Proxy should use to check if the APIs used in the app are registered." + }, + "subscriptionId": { + "type": "string", + "description": "ID of the Azure subscription where the Azure API Center instance is located." + }, + "workspace": { + "type": "string", + "description": "Name of the Azure API Center workspace to use. Default is 'default'." + } + }, + "required": [ + "resourceGroupName", + "serviceName", + "subscriptionId" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/authplugin.schema.json b/schemas/v0.28.0/authplugin.schema.json new file mode 100644 index 00000000..900d07ae --- /dev/null +++ b/schemas/v0.28.0/authplugin.schema.json @@ -0,0 +1,133 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy AuthPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "apiKey": { + "type": "object", + "description": "Configuration for API key authentication and authorization.", + "properties": { + "allowedKeys": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed API keys." + }, + "parameters": { + "type": "array", + "description": "List of parameters that contain the API key.", + "items": { + "type": "object", + "properties": { + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ], + "description": "Where the parameter is expected to be found. Allowed values: header, query, cookie." + }, + "name": { + "type": "string", + "description": "Name of the parameter." + } + }, + "required": [ + "in", + "name" + ] + } + } + }, + "required": [ + "allowedKeys", + "parameters" + ] + }, + "oauth2": { + "type": "object", + "description": "Configuration for OAuth2 authentication and authorization.", + "properties": { + "metadataUrl": { + "type": "string", + "description": "URL to the OpenID Connect metadata document." + }, + "allowedApplications": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed application IDs. Leave empty to not validate the application (appid or azp claim) for which the token is issued." + }, + "allowedAudiences": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed audiences. Leave empty to not validate the audience (aud claim) for which the token is issued." + }, + "allowedPrincipals": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed principals. Leave empty to not validate the principal (oid claim) for which the token is issued." + }, + "allowedTenants": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed tenants. Leave empty to not validate the tenant (tid claim) for which the token is issued." + }, + "issuer": { + "type": "string", + "description": "Allowed token issuer. Leave empty to not validate the token issuer." + }, + "roles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed roles. Leave empty to not validate the roles (roles claim) on the token." + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed scopes. Leave empty to not validate the scopes (scp claim) on the token." + }, + "validateLifetime": { + "type": "boolean", + "description": "Set to false to disable validating the token lifetime. Default is true." + }, + "validateSigningKey": { + "type": "boolean", + "description": "Set to false to disable validating the token signature. Default is true." + } + }, + "required": [ + "metadataUrl" + ] + }, + "type": { + "type": "string", + "enum": [ + "apiKey", + "oauth2" + ], + "description": "Type of authentication and authorization that Dev Proxy should use. Allowed values: apiKey, oauth2." + } + }, + "required": [ + "type" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/cachingguidanceplugin.schema.json b/schemas/v0.28.0/cachingguidanceplugin.schema.json new file mode 100644 index 00000000..18116180 --- /dev/null +++ b/schemas/v0.28.0/cachingguidanceplugin.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy CachingGuidancePlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "cacheThresholdSeconds": { + "type": "integer", + "description": "The number of seconds between the same request that triggers the guidance warning. Default is 5." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/crudapiplugin.apifile.schema.json b/schemas/v0.28.0/crudapiplugin.apifile.schema.json new file mode 100644 index 00000000..ebddf650 --- /dev/null +++ b/schemas/v0.28.0/crudapiplugin.apifile.schema.json @@ -0,0 +1,151 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "CRUD API plugin API definition", + "description": "API definition for use with the CRUD API Dev Proxy plugin", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "baseUrl": { + "type": "string", + "description": "Base URL where Dev Proxy exposes the API. Dev Proxy prepends this base URL to the URLs defined in actions." + }, + "dataFile": { + "type": "string", + "description": "Path to the file that contains the data for the API. The file must define a JSON array." + }, + "actions": { + "type": "array", + "description": "List of actions that the API supports. Each action defines how Dev Proxy interacts with the data.", + "items": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "create", + "getAll", + "getOne", + "getMany", + "merge", + "update", + "delete" + ], + "description": "Defines the type of action. Possible values: getAll, getOne, getMany, create, merge, update, delete." + }, + "url": { + "type": "string", + "description": "URL where Dev Proxy exposes the action. Appended to the baseUrl. Can contain parameters in curly braces." + }, + "query": { + "type": "string", + "description": "JSONPath query (using Newtonsoft.Json) that Dev Proxy uses to find the data in the data file. Parameters can be referenced using curly braces." + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE" + ], + "description": "HTTP method that Dev Proxy uses to expose the action. Defaults depend on the action type." + }, + "auth": { + "type": "string", + "enum": [ + "none", + "entra" + ], + "description": "Determines if the action is secured. Allowed values: none, entra. Default is none." + }, + "entraAuthConfig": { + "type": "object", + "description": "Configuration for Microsoft Entra authentication for this action. Overrides the root entraAuthConfig if specified.", + "properties": { + "audience": { + "type": "string", + "description": "Valid audience for the token. If specified, the token's audience must match." + }, + "issuer": { + "type": "string", + "description": "Valid token issuer. If specified, the token's issuer must match." + }, + "scopes": { + "type": "array", + "items": { "type": "string" }, + "description": "Array of valid scopes. At least one must be present in the token." + }, + "roles": { + "type": "array", + "items": { "type": "string" }, + "description": "Array of valid roles. At least one must be present in the token." + }, + "validateLifetime": { + "type": "boolean", + "description": "Set to true to validate that the token hasn't expired." + }, + "validateSigningKey": { + "type": "boolean", + "description": "Set to true to validate the token's signature." + } + } + } + }, + "required": [ + "action" + ], + "additionalProperties": false + } + }, + "auth": { + "type": "string", + "enum": [ + "none", + "entra" + ], + "description": "Determines if the API is secured. Allowed values: none, entra. Default is none." + }, + "entraAuthConfig": { + "type": "object", + "description": "Configuration for Microsoft Entra authentication. Applies to all actions unless overridden at the action level.", + "properties": { + "audience": { + "type": "string", + "description": "Valid audience for the token. If specified, the token's audience must match." + }, + "issuer": { + "type": "string", + "description": "Valid token issuer. If specified, the token's issuer must match." + }, + "scopes": { + "type": "array", + "items": { "type": "string" }, + "description": "Array of valid scopes. At least one must be present in the token." + }, + "roles": { + "type": "array", + "items": { "type": "string" }, + "description": "Array of valid roles. At least one must be present in the token." + }, + "validateLifetime": { + "type": "boolean", + "description": "Set to true to validate that the token hasn't expired. Default is false." + }, + "validateSigningKey": { + "type": "boolean", + "description": "Set to true to validate the token's signature. Default is false." + } + } + } + }, + "required": [ + "baseUrl", + "dataFile", + "actions" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/crudapiplugin.schema.json b/schemas/v0.28.0/crudapiplugin.schema.json new file mode 100644 index 00000000..b3ad667c --- /dev/null +++ b/schemas/v0.28.0/crudapiplugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy CrudApiPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "apiFile": { + "type": "string", + "description": "Path to the file that contains the definition of the CRUD API." + }, + "required": [ + "apiFile" + ] + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/devtoolsplugin.schema.json b/schemas/v0.28.0/devtoolsplugin.schema.json new file mode 100644 index 00000000..e451af1f --- /dev/null +++ b/schemas/v0.28.0/devtoolsplugin.schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy DevToolsPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "preferredBrowser": { + "type": "string", + "enum": [ + "Edge", + "EdgeDev", + "Chrome" + ], + "description": "Which browser to use to launch Dev Tools. Supported values: Edge, EdgeDev, Chrome. Default: Edge." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/executionsummaryplugin.schema.json b/schemas/v0.28.0/executionsummaryplugin.schema.json new file mode 100644 index 00000000..e370b052 --- /dev/null +++ b/schemas/v0.28.0/executionsummaryplugin.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy ExecutionSummaryPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "groupBy": { + "type": "string", + "enum": [ + "url", + "messageType" + ], + "description": "How proxy should group the information in the summary. Available options: url, messageType. Default: url." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/genericrandomerrorplugin.errorsfile.schema.json b/schemas/v0.28.0/genericrandomerrorplugin.errorsfile.schema.json new file mode 100644 index 00000000..79d12429 --- /dev/null +++ b/schemas/v0.28.0/genericrandomerrorplugin.errorsfile.schema.json @@ -0,0 +1,103 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy GenericRandomErrorPlugin responses", + "description": "Error responses for the Dev Proxy GenericRandomErrorPlugin", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "errors": { + "type": "array", + "description": "List of error response definitions to simulate. Each entry defines a request pattern and possible error responses.", + "items": { + "type": "object", + "properties": { + "request": { + "type": "object", + "description": "Request pattern to match for simulating an error.", + "properties": { + "url": { + "type": "string", + "description": "URL pattern to match for the request. Supports wildcards." + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "HTTP method to match for the request. Optional." + }, + "bodyFragment": { + "type": "string", + "description": "Fragment of the request body to match. Optional." + } + }, + "required": [ + "url" + ] + }, + "responses": { + "type": "array", + "description": "Possible error responses to return for the matched request.", + "items": { + "type": "object", + "properties": { + "body": { + "type": [ + "object", + "array", + "string" + ], + "description": "Response body to return. Can be an object, array, or string." + }, + "statusCode": { + "type": "integer", + "description": "HTTP status code to return." + }, + "headers": { + "type": "array", + "description": "List of headers to include in the response.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name." + }, + "value": { + "type": "string", + "description": "Header value." + } + }, + "required": [ + "name", + "value" + ] + } + } + } + } + } + }, + "required": [ + "request", + "responses" + ] + } + } + }, + "required": [ + "errors" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/genericrandomerrorplugin.schema.json b/schemas/v0.28.0/genericrandomerrorplugin.schema.json new file mode 100644 index 00000000..ec9facf0 --- /dev/null +++ b/schemas/v0.28.0/genericrandomerrorplugin.schema.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy GenericRandomErrorPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "errorsFile": { + "type": "string", + "description": "Path to the file that contains error responses." + }, + "rate": { + "type": "number", + "minimum": 0, + "maximum": 100, + "description": "The percentage of requests to fail with a random error. Value between 0 and 100." + }, + "retryAfterInSeconds": { + "type": "integer", + "minimum": 1, + "description": "The number of seconds to wait before retrying the request. Included on the Retry-After response header for dynamic throttling. Default: 5." + } + }, + "required": [ + "errorsFile" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/graphminimalpermissionsguidanceplugin.schema.json b/schemas/v0.28.0/graphminimalpermissionsguidanceplugin.schema.json new file mode 100644 index 00000000..3dbcc4a3 --- /dev/null +++ b/schemas/v0.28.0/graphminimalpermissionsguidanceplugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy GraphMinimalPermissionsGuidancePlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "Reference to the JSON schema definition." + }, + "permissionsToIgnore": { + "type": "array", + "description": "The scopes to ignore and not include in the report. Default: ['profile', 'openid', 'offline_access', 'email'].", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/graphminimalpermissionsplugin.schema.json b/schemas/v0.28.0/graphminimalpermissionsplugin.schema.json new file mode 100644 index 00000000..99c53518 --- /dev/null +++ b/schemas/v0.28.0/graphminimalpermissionsplugin.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy GraphMinimalPermissionsPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "Reference to the JSON schema definition." + }, + "type": { + "type": "string", + "enum": [ + "Delegated", + "Application" + ], + "description": "Determines which type of permission scopes to return. Can be 'Delegated' or 'Application'. Default: 'Delegated'." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/graphrandomerrorplugin.schema.json b/schemas/v0.28.0/graphrandomerrorplugin.schema.json new file mode 100644 index 00000000..e74fae9d --- /dev/null +++ b/schemas/v0.28.0/graphrandomerrorplugin.schema.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy GraphRandomErrorPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "Reference to the JSON schema definition." + }, + "allowedErrors": { + "type": "array", + "description": "Array of HTTP status codes (integers between 400 and 599) that the plugin can use to simulate errors. For example, [429] to simulate throttling.", + "items": { + "type": "integer", + "minimum": 400, + "maximum": 599 + } + }, + "rate": { + "type": "number", + "minimum": 0, + "maximum": 100, + "description": "The percentage (0-100) of requests that should be failed with a random error." + }, + "retryAfterInSeconds": { + "type": "integer", + "minimum": 0, + "description": "The number of seconds to set in the Retry-After header for throttling responses." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/httpfilegeneratorplugin.schema.json b/schemas/v0.28.0/httpfilegeneratorplugin.schema.json new file mode 100644 index 00000000..f25784f1 --- /dev/null +++ b/schemas/v0.28.0/httpfilegeneratorplugin.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy HttpFileGeneratorPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "Reference to the JSON schema definition." + }, + "includeOptionsRequests": { + "type": "boolean", + "description": "Determines whether to include OPTIONS requests in the generated HTTP file. Default: false." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/latencyplugin.schema.json b/schemas/v0.28.0/latencyplugin.schema.json new file mode 100644 index 00000000..9ae17e4f --- /dev/null +++ b/schemas/v0.28.0/latencyplugin.schema.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy LatencyPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "Reference to the JSON schema definition." + }, + "minMs": { + "type": "integer", + "minimum": 0, + "description": "The minimum amount of delay (in milliseconds) added to a request. Default: 0." + }, + "maxMs": { + "type": "integer", + "minimum": 0, + "maximum": 10000, + "description": "The maximum amount of delay (in milliseconds) added to a request. Max value is 10000 (10 seconds). Default: 5000." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/minimalcsompermissions.types.schema.json b/schemas/v0.28.0/minimalcsompermissions.types.schema.json new file mode 100644 index 00000000..c212cdb5 --- /dev/null +++ b/schemas/v0.28.0/minimalcsompermissions.types.schema.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SharePoint CSOM Types and Permissions Schema", + "description": "Schema for defining SharePoint CSOM types, return types, and their required permissions", + "type": "object", + "required": ["types", "returnTypes", "actions"], + "properties": { + "$schema": { + "type": "string", + "description": "Reference to the JSON schema definition." + }, + "types": { + "type": "object", + "description": "Mapping of GUIDs to their corresponding SharePoint CSOM types. Used for readability and easier mapping.", + "patternProperties": { + "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$": { + "type": "string", + "description": "Fully qualified name of a SharePoint CSOM type." + } + } + }, + "returnTypes": { + "type": "object", + "description": "Mapping of method signatures to their return types. Used to traverse the CSOM API hierarchy.", + "patternProperties": { + "^[A-Za-z0-9.]+\\.[A-Za-z0-9.]+$": { + "type": "string", + "description": "Fully qualified name of the return type." + } + } + }, + "actions": { + "type": "object", + "description": "Mapping of method signatures to their required permissions. Each action lists the delegated and application permissions needed, sorted by least privilege first.", + "patternProperties": { + "^[A-Za-z0-9.]+\\.[A-Za-z0-9.]+$": { + "type": "object", + "properties": { + "delegated": { + "type": "array", + "description": "Required delegated permissions.", + "items": { + "type": "string" + } + }, + "application": { + "type": "array", + "description": "Required application permissions.", + "items": { + "type": "string" + } + } + } + } + } + } + } +} diff --git a/schemas/v0.28.0/minimalcsompermissionsplugin.schema.json b/schemas/v0.28.0/minimalcsompermissionsplugin.schema.json new file mode 100644 index 00000000..f4b3eba1 --- /dev/null +++ b/schemas/v0.28.0/minimalcsompermissionsplugin.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy MinimalCsomPermissionsPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "Reference to the JSON schema definition." + }, + "typesFilePath": { + "type": "string", + "description": "Path to the file that lists permissions required to call SharePoint CSOM APIs. Default: ~appFolder/config/spo-csom-types.json." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/minimalpermissionsguidanceplugin.schema.json b/schemas/v0.28.0/minimalpermissionsguidanceplugin.schema.json new file mode 100644 index 00000000..67849ad6 --- /dev/null +++ b/schemas/v0.28.0/minimalpermissionsguidanceplugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy MinimalPermissionsGuidancePlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "apiSpecsFolderPath": { + "type": "string", + "description": "Relative or absolute path to the folder with API specs. Used to compare JWT token permissions against minimal required scopes." + } + }, + "required": [ + "apiSpecsFolderPath" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/minimalpermissionsplugin.schema.json b/schemas/v0.28.0/minimalpermissionsplugin.schema.json new file mode 100644 index 00000000..e70bc69e --- /dev/null +++ b/schemas/v0.28.0/minimalpermissionsplugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy MinimalPermissionsPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "apiSpecsFolderPath": { + "type": "string", + "description": "Relative or absolute path to the folder with API specs. Used to determine minimal permissions required for API calls." + } + }, + "required": [ + "apiSpecsFolderPath" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/mockrequestplugin.mockfile.schema.json b/schemas/v0.28.0/mockrequestplugin.mockfile.schema.json new file mode 100644 index 00000000..aa5b3ee4 --- /dev/null +++ b/schemas/v0.28.0/mockrequestplugin.mockfile.schema.json @@ -0,0 +1,70 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy MockRequestPlugin mocks", + "description": "Mock request for the Dev Proxy MockRequestPlugin", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "request": { + "type": "object", + "description": "The request to issue.", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "URL to call." + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "HTTP method to use (default: POST)." + }, + "body": { + "type": "object", + "description": "Body of the request (object or string)." + }, + "headers": { + "type": "array", + "description": "Array of request headers (name/value pairs).", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Request header name." + }, + "value": { + "type": "string", + "description": "Request header value." + } + }, + "required": [ + "name", + "value" + ] + } + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "request" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/mockrequestplugin.schema.json b/schemas/v0.28.0/mockrequestplugin.schema.json new file mode 100644 index 00000000..08355e53 --- /dev/null +++ b/schemas/v0.28.0/mockrequestplugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy MockRequestPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "mockFile": { + "type": "string", + "description": "Path to the file containing the mock request." + } + }, + "required": [ + "mockFile" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/mockresponseplugin.mocksfile.schema.json b/schemas/v0.28.0/mockresponseplugin.mocksfile.schema.json new file mode 100644 index 00000000..5f2478a3 --- /dev/null +++ b/schemas/v0.28.0/mockresponseplugin.mocksfile.schema.json @@ -0,0 +1,104 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy MockResponsePlugin mocks", + "description": "Mocks for the Dev Proxy MockResponsePlugin", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "mocks": { + "type": "array", + "description": "Array of mock definitions.", + "items": { + "type": "object", + "properties": { + "request": { + "type": "object", + "description": "The request to match.", + "properties": { + "url": { + "type": "string", + "description": "The URL to match. Supports wildcards." + }, + "method": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "HTTP method to match." + }, + "nth": { + "type": "integer", + "description": "(Optional) Match the nth occurrence of the request." + }, + "bodyFragment": { + "type": "string", + "description": "(Optional) A fragment of the request body to match." + } + }, + "required": [ + "url" + ] + }, + "response": { + "type": "object", + "description": "The response to return.", + "properties": { + "body": { + "type": [ + "object", + "array", + "string" + ], + "description": "The response body (object, array, or string; can reference a file with '@filename')." + }, + "statusCode": { + "type": "integer", + "description": "HTTP status code to return." + }, + "headers": { + "type": "array", + "description": "Array of response headers (name/value pairs).", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name." + }, + "value": { + "type": "string", + "description": "Header value." + } + }, + "required": [ + "name", + "value" + ] + } + } + } + } + }, + "required": [ + "request", + "response" + ] + } + } + }, + "required": [ + "mocks" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/mockresponseplugin.schema.json b/schemas/v0.28.0/mockresponseplugin.schema.json new file mode 100644 index 00000000..e091ae98 --- /dev/null +++ b/schemas/v0.28.0/mockresponseplugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy MockResponsePlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "mocksFile": { + "type": "string", + "description": "Path to the file containing the mock responses." + } + }, + "required": [ + "mocksFile" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/openapispecgeneratorplugin.schema.json b/schemas/v0.28.0/openapispecgeneratorplugin.schema.json new file mode 100644 index 00000000..44a862cc --- /dev/null +++ b/schemas/v0.28.0/openapispecgeneratorplugin.schema.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy OpenApiSpecGeneratorPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The JSON schema reference for validation." + }, + "includeOptionsRequests": { + "type": "boolean", + "description": "Determines whether to include OPTIONS requests in the generated OpenAPI spec. Default: false." + }, + "specVersion": { + "type": "string", + "enum": [ + "v2_0", + "v3_0" + ], + "description": "Specifies the OpenAPI spec version to generate. Allowed values: 'v2_0' or 'v3_0'. Default: 'v3_0'." + }, + "specFormat": { + "type": "string", + "enum": [ + "Json", + "Yaml" + ], + "description": "Specifies the format of the generated OpenAPI spec. Allowed values: 'Json' or 'Yaml'. Default: 'Json'." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/ratelimitingplugin.customresponsefile.schema.json b/schemas/v0.28.0/ratelimitingplugin.customresponsefile.schema.json new file mode 100644 index 00000000..fa1b2b38 --- /dev/null +++ b/schemas/v0.28.0/ratelimitingplugin.customresponsefile.schema.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy RateLimitingPlugin response", + "description": "Mock for the Dev Proxy RateLimitingPlugin", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The URL of the JSON schema used to validate this custom response file." + }, + "body": { + "type": [ + "object", + "array", + "string" + ], + "description": "The body of the custom response returned when the rate limit is exceeded. Can be an object, array, or string." + }, + "statusCode": { + "type": "integer", + "description": "HTTP status code to return when the rate limit is exceeded (e.g., 403)." + }, + "headers": { + "type": "array", + "description": "List of headers to include in the custom response.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name." + }, + "value": { + "type": "string", + "description": "Header value." + } + }, + "required": [ + "name", + "value" + ] + } + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/ratelimitingplugin.schema.json b/schemas/v0.28.0/ratelimitingplugin.schema.json new file mode 100644 index 00000000..62b1422a --- /dev/null +++ b/schemas/v0.28.0/ratelimitingplugin.schema.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy RateLimitingPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The URL of the JSON schema used to validate this configuration file." + }, + "headerLimit": { + "type": "string", + "description": "Name of the response header that communicates the rate-limiting limit (e.g., 'RateLimit-Limit')." + }, + "headerRemaining": { + "type": "string", + "description": "Name of the response header that communicates the remaining number of resources before the reset (e.g., 'RateLimit-Remaining')." + }, + "headerReset": { + "type": "string", + "description": "Name of the response header that communicates the time remaining until the reset (e.g., 'RateLimit-Reset')." + }, + "headerRetryAfter": { + "type": "string", + "description": "Name of the response header that communicates the retry-after period (e.g., 'Retry-After')." + }, + "costPerRequest": { + "type": "integer", + "minimum": 1, + "description": "How many resources a single request costs." + }, + "resetTimeWindowSeconds": { + "type": "integer", + "minimum": 1, + "description": "How long in seconds until the next rate limit reset." + }, + "warningThresholdPercent": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "description": "The percentage of the rate limit after which warning headers are returned." + }, + "rateLimit": { + "type": "integer", + "minimum": 1, + "description": "Number of resources allowed per time window." + }, + "whenLimitExceeded": { + "type": "string", + "enum": [ + "Throttle", + "Custom" + ], + "description": "Behavior when the rate limit is exceeded: 'Throttle' (default throttling) or 'Custom' (custom response)." + }, + "resetFormat": { + "type": "string", + "enum": [ + "SecondsLeft", + "UtcEpochSeconds" + ], + "description": "Format for the reset header: 'SecondsLeft' (seconds until reset) or 'UtcEpochSeconds' (UTC epoch seconds)." + }, + "customResponseFile": { + "type": "string", + "description": "Path to a file containing a custom error response to use when the rate limit is exceeded." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/rc.schema.json b/schemas/v0.28.0/rc.schema.json new file mode 100644 index 00000000..978808da --- /dev/null +++ b/schemas/v0.28.0/rc.schema.json @@ -0,0 +1,187 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy config", + "description": "Configuration for Dev Proxy", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The URL of the JSON schema used to validate this configuration file. Should match the Dev Proxy version." + }, + "apiPort": { + "type": "number", + "minimum": 0, + "maximum": 65535, + "description": "Port for the Dev Proxy API server." + }, + "asSystemProxy": { + "type": "boolean", + "description": "Whether to set Dev Proxy as the system proxy." + }, + "filterByHeaders": { + "type": "array", + "description": "List of headers to filter requests by. Each object specifies a header name and value.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name to filter by." + }, + "value": { + "type": "string", + "description": "Header value to filter by." + } + }, + "required": [ + "name", + "value" + ] + } + }, + "ipAddress": { + "type": "string", + "format": "ipv4", + "description": "IP address for Dev Proxy to listen on." + }, + "languageModel": { + "type": "object", + "description": "Configuration for using a local language model with Dev Proxy.", + "properties": { + "cacheResponses": { + "type": "boolean", + "description": "Whether to cache responses from the language model." + }, + "client": { + "type": "string", + "enum": [ + "LMStudio", + "Ollama" + ], + "description": "The client to use for the local language model." + }, + "enabled": { + "type": "boolean", + "description": "Whether the language model integration is enabled." + }, + "model": { + "type": "string", + "description": "The name of the language model to use." + }, + "url": { + "type": "string", + "description": "URL of the local language model server." + } + } + }, + "logLevel": { + "type": "string", + "enum": [ + "debug", + "information", + "warning", + "error", + "trace" + ], + "description": "The minimum log level for Dev Proxy output." + }, + "newVersionNotification": { + "type": "string", + "enum": [ + "none", + "stable", + "beta" + ], + "description": "Controls notifications about new Dev Proxy versions." + }, + "plugins": { + "type": "array", + "description": "List of plugins to load. Each object defines a plugin instance.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the plugin." + }, + "enabled": { + "type": "boolean", + "description": "Whether the plugin is enabled." + }, + "pluginPath": { + "type": "string", + "description": "Path to the plugin DLL." + }, + "configSection": { + "type": "string", + "description": "Name of the configuration section for this plugin instance." + }, + "urlsToWatch": { + "type": "array", + "description": "List of URL patterns for the plugin to watch.", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "enabled", + "pluginPath" + ] + } + }, + "port": { + "type": "number", + "minimum": 0, + "maximum": 65535, + "description": "Port for Dev Proxy to listen on." + }, + "record": { + "type": "boolean", + "description": "Whether to record requests and responses." + }, + "showSkipMessages": { + "type": "boolean", + "description": "Show messages for skipped requests." + }, + "urlsToWatch": { + "type": "array", + "description": "List of URL patterns for Dev Proxy to intercept.", + "items": { + "type": "string" + } + }, + "validateSchemas": { + "type": "boolean", + "description": "Whether to validate configuration files against their schemas." + }, + "watchPids": { + "type": "array", + "description": "List of process IDs to watch for network traffic.", + "items": { + "type": "number" + } + }, + "watchProcessNames": { + "type": "array", + "description": "List of process names to watch for network traffic.", + "items": { + "type": "string" + } + }, + "showTimestamps": { + "type": "boolean", + "description": "Show timestamps in log output." + }, + "timeout": { + "type": "number", + "minimum": 1, + "description": "Timeout in seconds for requests passing through Dev Proxy." + } + }, + "required": [ + "plugins" + ], + "additionalProperties": true +} \ No newline at end of file diff --git a/schemas/v0.28.0/rewriteplugin.rewritesfile.schema.json b/schemas/v0.28.0/rewriteplugin.rewritesfile.schema.json new file mode 100644 index 00000000..c4ef5a6d --- /dev/null +++ b/schemas/v0.28.0/rewriteplugin.rewritesfile.schema.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy RewritePlugin rewrite rules", + "description": "Rewrite rules for the Dev Proxy RewritePlugin", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The URL of the JSON schema used to validate this rewrite rules file." + }, + "rewrites": { + "type": "array", + "description": "Array of rewrite rule objects that define the list of rewrite rules the RewritePlugin applies.", + "items": { + "type": "object", + "properties": { + "in": { + "type": "object", + "description": "Pattern to match the incoming request.", + "properties": { + "url": { + "type": "string", + "pattern": "^.+$", + "description": "Regular expression to match the incoming request URL." + } + }, + "required": ["url"] + }, + "out": { + "type": "object", + "description": "Pattern to rewrite the request.", + "properties": { + "url": { + "type": "string", + "pattern": "^.*$", + "description": "URL to rewrite the request to. Can use capture groups from the 'in' pattern." + } + }, + "required": ["url"] + } + }, + "required": ["in", "out"] + } + } + }, + "required": [ + "rewrites" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/rewriteplugin.schema.json b/schemas/v0.28.0/rewriteplugin.schema.json new file mode 100644 index 00000000..6cf593e9 --- /dev/null +++ b/schemas/v0.28.0/rewriteplugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy RewritePlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The URL of the JSON schema used to validate this configuration file." + }, + "rewritesFile": { + "type": "string", + "description": "Path to the file containing rewrite definitions (e.g., 'rewrites.json')." + } + }, + "required": [ + "rewritesFile" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schemas/v0.28.0/typespecgeneratorplugin.schema.json b/schemas/v0.28.0/typespecgeneratorplugin.schema.json new file mode 100644 index 00000000..db770ca4 --- /dev/null +++ b/schemas/v0.28.0/typespecgeneratorplugin.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Dev Proxy TypeSpecGeneratorPlugin config schema", + "type": "object", + "properties": { + "$schema": { + "type": "string", + "description": "The URL of the JSON schema used to validate this configuration file." + }, + "ignoreResponseTypes": { + "type": "boolean", + "description": "Determines whether to generate types for API responses (false) or to set them to 'string' (true)." + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/scripts/Dockerfile_local b/scripts/Dockerfile_local index 9bcbcf2e..a1f532ee 100644 --- a/scripts/Dockerfile_local +++ b/scripts/Dockerfile_local @@ -1,6 +1,6 @@ FROM ubuntu:24.04 -ARG DEVPROXY_VERSION=0.27.0-beta.1 +ARG DEVPROXY_VERSION=0.28.0-beta.1 ARG USERNAME=devproxy ENV DEVPROXY_VERSION=${DEVPROXY_VERSION} diff --git a/scripts/local-setup.ps1 b/scripts/local-setup.ps1 index 908b4e29..cbe2d747 100644 --- a/scripts/local-setup.ps1 +++ b/scripts/local-setup.ps1 @@ -2,7 +2,7 @@ # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. -$versionString = "v0.27.0-beta.1" +$versionString = "v0.28.0-beta.1" $version = $versionString.Substring(1) $isBeta = $version.Contains("-beta") diff --git a/scripts/version.ps1 b/scripts/version.ps1 index b24ea09f..3d5006a1 100644 --- a/scripts/version.ps1 +++ b/scripts/version.ps1 @@ -2,4 +2,4 @@ # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. -$script:versionString = "v0.27.0-beta.1" +$script:versionString = "v0.28.0-beta.1" From d591c42ef1e4e09378dec734a9000ecfd4411843 Mon Sep 17 00:00:00 2001 From: Waldek Mastykarz Date: Tue, 6 May 2025 07:50:08 +0200 Subject: [PATCH 2/2] Update rc.schema.json --- schemas/v0.28.0/rc.schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schemas/v0.28.0/rc.schema.json b/schemas/v0.28.0/rc.schema.json index 978808da..0ff81cf5 100644 --- a/schemas/v0.28.0/rc.schema.json +++ b/schemas/v0.28.0/rc.schema.json @@ -55,8 +55,8 @@ "client": { "type": "string", "enum": [ - "LMStudio", - "Ollama" + "Ollama", + "OpenAI" ], "description": "The client to use for the local language model." }, @@ -184,4 +184,4 @@ "plugins" ], "additionalProperties": true -} \ No newline at end of file +}