Skip to content

Commit

Permalink
Update default config (microsoft#443)
Browse files Browse the repository at this point in the history
* Update default config

* Shorten file name

* Remove ProjectExtensions

* Add global settings

* Update plugin paths

* Update default config

* Shorten file name

* Remove ProjectExtensions

* Add global settings

* Update plugin paths

* Fix comments
  • Loading branch information
garrytrinder authored Dec 20, 2023
1 parent 4232373 commit 7aa8af0
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 190 deletions.
13 changes: 8 additions & 5 deletions dev-proxy/dev-proxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,28 @@
<None Update="devproxyrc.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="devproxy-errors.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="toggle-proxy.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="picture.jpg">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="responses.json">
<None Update="trust-cert.sh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="trust-cert.sh">
<None Update="presets\microsoft-graph.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="responses.sample.json">
<None Update="presets\microsoft-graph-rate-limiting.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="presets\microsoft-graph.json">
<None Update="presets\microsoft-365.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="presets\microsoft-graph-rate-limiting.json">
<None Update="presets\microsoft-365-errors.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
62 changes: 62 additions & 0 deletions dev-proxy/devproxy-errors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/errors.schema.json",
"responses": [
{
"statusCode": 400,
"body": {
"message": "Bad Request",
"details": "The server cannot process the request due to invalid syntax."
}
},
{
"statusCode": 401,
"body": {
"message": "Unauthorized",
"details": "The request requires user authentication."
}
},
{
"statusCode": 403,
"body": {
"message": "Forbidden",
"details": "The server understood the request, but refuses to authorize it."
}
},
{
"statusCode": 404,
"body": {
"message": "Not Found",
"details": "The requested resource could not be found."
}
},
{
"statusCode": 418,
"body": {
"message": "I'm a teapot",
"details": "The server refuses the attempt to brew coffee with a teapot."
}
},
{
"statusCode": 429,
"addDynamicRetryAfter": true,
"body": {
"message": "Too Many Requests",
"details": "The user has sent too many requests in a given amount of time (\"rate limiting\")."
}
},
{
"statusCode": 500,
"body": {
"message": "Internal Server Error",
"details": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."
}
},
{
"statusCode": 503,
"body": {
"message": "Service Unavailable",
"details": "The server is currently unable to handle the request due to a temporary overload or maintenance. Please try again later."
}
}
]
}
189 changes: 8 additions & 181 deletions dev-proxy/devproxyrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,198 +2,25 @@
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/rc.schema.json",
"plugins": [
{
"name": "DevToolsPlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "devTools"
},
{
"name": "LatencyPlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "latencyPlugin"
},
{
"name": "RetryAfterPlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll"
},
{
"name": "GraphSelectGuidancePlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com/v1.0/*",
"https://graph.microsoft.com/beta/*",
"https://graph.microsoft.us/v1.0/*",
"https://graph.microsoft.us/beta/*",
"https://dod-graph.microsoft.us/v1.0/*",
"https://dod-graph.microsoft.us/beta/*",
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
"https://microsoftgraph.chinacloudapi.cn/beta/*"
]
},
{
"name": "ODSPSearchGuidancePlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com/v1.0/*",
"https://graph.microsoft.com/beta/*",
"https://graph.microsoft.us/v1.0/*",
"https://graph.microsoft.us/beta/*",
"https://dod-graph.microsoft.us/v1.0/*",
"https://dod-graph.microsoft.us/beta/*",
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
"https://microsoftgraph.chinacloudapi.cn/beta/*"
]
},
{
"name": "GraphBetaSupportGuidancePlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com/beta/*",
"https://graph.microsoft.us/beta/*",
"https://dod-graph.microsoft.us/beta/*",
"https://microsoftgraph.chinacloudapi.cn/beta/*"
]
},
{
"name": "GraphSdkGuidancePlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com/v1.0/*",
"https://graph.microsoft.com/beta/*",
"https://graph.microsoft.us/v1.0/*",
"https://graph.microsoft.us/beta/*",
"https://dod-graph.microsoft.us/v1.0/*",
"https://dod-graph.microsoft.us/beta/*",
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
"https://microsoftgraph.chinacloudapi.cn/beta/*"
]
},
{
"name": "ODataPagingGuidancePlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll"
},
{
"name": "GraphClientRequestIdGuidancePlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com/v1.0/*",
"https://graph.microsoft.com/beta/*",
"https://graph.microsoft.us/v1.0/*",
"https://graph.microsoft.us/beta/*",
"https://dod-graph.microsoft.us/v1.0/*",
"https://dod-graph.microsoft.us/beta/*",
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
"https://microsoftgraph.chinacloudapi.cn/beta/*"
]
},
{
"name": "CachingGuidancePlugin",
"name": "GenericRandomErrorPlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "cachingGuidance"
"configSection": "genericRandomErrorPlugin"
},
{
"name": "RateLimitingPlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "rateLimiting"
},
{
"name": "MockResponsePlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "mocksPlugin"
},
{
"name": "GraphMockResponsePlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "mocksPlugin"
},
{
"name": "GraphRandomErrorPlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "graphRandomErrorsPlugin"
},
{
"name": "ExecutionSummaryPlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "executionSummaryPlugin"
},
{
"name": "MinimalPermissionsPlugin",
"name": "RetryAfterPlugin",
"enabled": true,
"pluginPath": "plugins\\dev-proxy-plugins.dll",
"configSection": "minimalPermissionsPlugin"
},
{
"name": "MinimalPermissionsGuidancePlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll"
},
{
"name": "MockGeneratorPlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll"
},
{
"name": "OpenApiDocGeneratorPlugin",
"enabled": false,
"pluginPath": "plugins\\dev-proxy-plugins.dll"
}
],
"urlsToWatch": [
"https://graph.microsoft.com/v1.0/*",
"https://graph.microsoft.com/beta/*",
"https://graph.microsoft.us/v1.0/*",
"https://graph.microsoft.us/beta/*",
"https://dod-graph.microsoft.us/v1.0/*",
"https://dod-graph.microsoft.us/beta/*",
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
"https://microsoftgraph.chinacloudapi.cn/beta/*",
"https://*.sharepoint.*/*_api/*",
"https://*.sharepoint.*/*_vti_bin/*",
"https://*.sharepoint-df.*/*_api/*",
"https://*.sharepoint-df.*/*_vti_bin/*"
"!https://jsonplaceholder.typicode.com/posts/2",
"https://jsonplaceholder.typicode.com/*"
],
"mocksPlugin": {
"mocksFile": "responses.json"
},
"graphRandomErrorsPlugin": {
"allowedErrors": [ 429, 500, 502, 503, 504, 507 ]
},
"executionSummaryPlugin": {
"groupBy": "url"
},
"minimalPermissionsPlugin": {
"type": "delegated"
},
"cachingGuidance": {
"cacheThresholdSeconds": 5
},
"latencyPlugin": {
"minMs": 200,
"maxMs": 10000
},
"devTools": {
"preferredBrowser": "Edge"
},
"rateLimiting": {
"costPerRequest": 2,
"rateLimit": 120,
"retryAfterSeconds": 5
"genericRandomErrorPlugin": {
"errorsFile": "devproxy-errors.json"
},
"rate": 50,
"labelMode": "text",
"logLevel": "info"
}
}
File renamed without changes.
Loading

0 comments on commit 7aa8af0

Please sign in to comment.