Skip to content

Commit 7aa8af0

Browse files
authored
Update default config (#443)
* 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
1 parent 4232373 commit 7aa8af0

File tree

6 files changed

+273
-190
lines changed

6 files changed

+273
-190
lines changed

dev-proxy/dev-proxy.csproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,28 @@
5050
<None Update="devproxyrc.json">
5151
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5252
</None>
53+
<None Update="devproxy-errors.json">
54+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
55+
</None>
5356
<None Update="toggle-proxy.sh">
5457
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5558
</None>
5659
<None Update="picture.jpg">
5760
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
5861
</None>
59-
<None Update="responses.json">
62+
<None Update="trust-cert.sh">
6063
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6164
</None>
62-
<None Update="trust-cert.sh">
65+
<None Update="presets\microsoft-graph.json">
6366
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6467
</None>
65-
<None Update="responses.sample.json">
68+
<None Update="presets\microsoft-graph-rate-limiting.json">
6669
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6770
</None>
68-
<None Update="presets\microsoft-graph.json">
71+
<None Update="presets\microsoft-365.json">
6972
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7073
</None>
71-
<None Update="presets\microsoft-graph-rate-limiting.json">
74+
<None Update="presets\microsoft-365-errors.json">
7275
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7376
</None>
7477
</ItemGroup>

dev-proxy/devproxy-errors.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/errors.schema.json",
3+
"responses": [
4+
{
5+
"statusCode": 400,
6+
"body": {
7+
"message": "Bad Request",
8+
"details": "The server cannot process the request due to invalid syntax."
9+
}
10+
},
11+
{
12+
"statusCode": 401,
13+
"body": {
14+
"message": "Unauthorized",
15+
"details": "The request requires user authentication."
16+
}
17+
},
18+
{
19+
"statusCode": 403,
20+
"body": {
21+
"message": "Forbidden",
22+
"details": "The server understood the request, but refuses to authorize it."
23+
}
24+
},
25+
{
26+
"statusCode": 404,
27+
"body": {
28+
"message": "Not Found",
29+
"details": "The requested resource could not be found."
30+
}
31+
},
32+
{
33+
"statusCode": 418,
34+
"body": {
35+
"message": "I'm a teapot",
36+
"details": "The server refuses the attempt to brew coffee with a teapot."
37+
}
38+
},
39+
{
40+
"statusCode": 429,
41+
"addDynamicRetryAfter": true,
42+
"body": {
43+
"message": "Too Many Requests",
44+
"details": "The user has sent too many requests in a given amount of time (\"rate limiting\")."
45+
}
46+
},
47+
{
48+
"statusCode": 500,
49+
"body": {
50+
"message": "Internal Server Error",
51+
"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."
52+
}
53+
},
54+
{
55+
"statusCode": 503,
56+
"body": {
57+
"message": "Service Unavailable",
58+
"details": "The server is currently unable to handle the request due to a temporary overload or maintenance. Please try again later."
59+
}
60+
}
61+
]
62+
}

dev-proxy/devproxyrc.json

Lines changed: 8 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -2,198 +2,25 @@
22
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/rc.schema.json",
33
"plugins": [
44
{
5-
"name": "DevToolsPlugin",
6-
"enabled": false,
7-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
8-
"configSection": "devTools"
9-
},
10-
{
11-
"name": "LatencyPlugin",
12-
"enabled": false,
13-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
14-
"configSection": "latencyPlugin"
15-
},
16-
{
17-
"name": "RetryAfterPlugin",
18-
"enabled": true,
19-
"pluginPath": "plugins\\dev-proxy-plugins.dll"
20-
},
21-
{
22-
"name": "GraphSelectGuidancePlugin",
23-
"enabled": true,
24-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
25-
"urlsToWatch": [
26-
"https://graph.microsoft.com/v1.0/*",
27-
"https://graph.microsoft.com/beta/*",
28-
"https://graph.microsoft.us/v1.0/*",
29-
"https://graph.microsoft.us/beta/*",
30-
"https://dod-graph.microsoft.us/v1.0/*",
31-
"https://dod-graph.microsoft.us/beta/*",
32-
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
33-
"https://microsoftgraph.chinacloudapi.cn/beta/*"
34-
]
35-
},
36-
{
37-
"name": "ODSPSearchGuidancePlugin",
38-
"enabled": true,
39-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
40-
"urlsToWatch": [
41-
"https://graph.microsoft.com/v1.0/*",
42-
"https://graph.microsoft.com/beta/*",
43-
"https://graph.microsoft.us/v1.0/*",
44-
"https://graph.microsoft.us/beta/*",
45-
"https://dod-graph.microsoft.us/v1.0/*",
46-
"https://dod-graph.microsoft.us/beta/*",
47-
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
48-
"https://microsoftgraph.chinacloudapi.cn/beta/*"
49-
]
50-
},
51-
{
52-
"name": "GraphBetaSupportGuidancePlugin",
53-
"enabled": true,
54-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
55-
"urlsToWatch": [
56-
"https://graph.microsoft.com/beta/*",
57-
"https://graph.microsoft.us/beta/*",
58-
"https://dod-graph.microsoft.us/beta/*",
59-
"https://microsoftgraph.chinacloudapi.cn/beta/*"
60-
]
61-
},
62-
{
63-
"name": "GraphSdkGuidancePlugin",
64-
"enabled": true,
65-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
66-
"urlsToWatch": [
67-
"https://graph.microsoft.com/v1.0/*",
68-
"https://graph.microsoft.com/beta/*",
69-
"https://graph.microsoft.us/v1.0/*",
70-
"https://graph.microsoft.us/beta/*",
71-
"https://dod-graph.microsoft.us/v1.0/*",
72-
"https://dod-graph.microsoft.us/beta/*",
73-
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
74-
"https://microsoftgraph.chinacloudapi.cn/beta/*"
75-
]
76-
},
77-
{
78-
"name": "ODataPagingGuidancePlugin",
79-
"enabled": true,
80-
"pluginPath": "plugins\\dev-proxy-plugins.dll"
81-
},
82-
{
83-
"name": "GraphClientRequestIdGuidancePlugin",
84-
"enabled": true,
85-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
86-
"urlsToWatch": [
87-
"https://graph.microsoft.com/v1.0/*",
88-
"https://graph.microsoft.com/beta/*",
89-
"https://graph.microsoft.us/v1.0/*",
90-
"https://graph.microsoft.us/beta/*",
91-
"https://dod-graph.microsoft.us/v1.0/*",
92-
"https://dod-graph.microsoft.us/beta/*",
93-
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
94-
"https://microsoftgraph.chinacloudapi.cn/beta/*"
95-
]
96-
},
97-
{
98-
"name": "CachingGuidancePlugin",
5+
"name": "GenericRandomErrorPlugin",
996
"enabled": true,
1007
"pluginPath": "plugins\\dev-proxy-plugins.dll",
101-
"configSection": "cachingGuidance"
8+
"configSection": "genericRandomErrorPlugin"
1029
},
10310
{
104-
"name": "RateLimitingPlugin",
105-
"enabled": false,
106-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
107-
"configSection": "rateLimiting"
108-
},
109-
{
110-
"name": "MockResponsePlugin",
111-
"enabled": false,
112-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
113-
"configSection": "mocksPlugin"
114-
},
115-
{
116-
"name": "GraphMockResponsePlugin",
117-
"enabled": true,
118-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
119-
"configSection": "mocksPlugin"
120-
},
121-
{
122-
"name": "GraphRandomErrorPlugin",
123-
"enabled": true,
124-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
125-
"configSection": "graphRandomErrorsPlugin"
126-
},
127-
{
128-
"name": "ExecutionSummaryPlugin",
129-
"enabled": false,
130-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
131-
"configSection": "executionSummaryPlugin"
132-
},
133-
{
134-
"name": "MinimalPermissionsPlugin",
11+
"name": "RetryAfterPlugin",
13512
"enabled": true,
136-
"pluginPath": "plugins\\dev-proxy-plugins.dll",
137-
"configSection": "minimalPermissionsPlugin"
138-
},
139-
{
140-
"name": "MinimalPermissionsGuidancePlugin",
141-
"enabled": false,
142-
"pluginPath": "plugins\\dev-proxy-plugins.dll"
143-
},
144-
{
145-
"name": "MockGeneratorPlugin",
146-
"enabled": false,
147-
"pluginPath": "plugins\\dev-proxy-plugins.dll"
148-
},
149-
{
150-
"name": "OpenApiDocGeneratorPlugin",
151-
"enabled": false,
15213
"pluginPath": "plugins\\dev-proxy-plugins.dll"
15314
}
15415
],
15516
"urlsToWatch": [
156-
"https://graph.microsoft.com/v1.0/*",
157-
"https://graph.microsoft.com/beta/*",
158-
"https://graph.microsoft.us/v1.0/*",
159-
"https://graph.microsoft.us/beta/*",
160-
"https://dod-graph.microsoft.us/v1.0/*",
161-
"https://dod-graph.microsoft.us/beta/*",
162-
"https://microsoftgraph.chinacloudapi.cn/v1.0/*",
163-
"https://microsoftgraph.chinacloudapi.cn/beta/*",
164-
"https://*.sharepoint.*/*_api/*",
165-
"https://*.sharepoint.*/*_vti_bin/*",
166-
"https://*.sharepoint-df.*/*_api/*",
167-
"https://*.sharepoint-df.*/*_vti_bin/*"
17+
"!https://jsonplaceholder.typicode.com/posts/2",
18+
"https://jsonplaceholder.typicode.com/*"
16819
],
169-
"mocksPlugin": {
170-
"mocksFile": "responses.json"
171-
},
172-
"graphRandomErrorsPlugin": {
173-
"allowedErrors": [ 429, 500, 502, 503, 504, 507 ]
174-
},
175-
"executionSummaryPlugin": {
176-
"groupBy": "url"
177-
},
178-
"minimalPermissionsPlugin": {
179-
"type": "delegated"
180-
},
181-
"cachingGuidance": {
182-
"cacheThresholdSeconds": 5
183-
},
184-
"latencyPlugin": {
185-
"minMs": 200,
186-
"maxMs": 10000
187-
},
188-
"devTools": {
189-
"preferredBrowser": "Edge"
190-
},
191-
"rateLimiting": {
192-
"costPerRequest": 2,
193-
"rateLimit": 120,
194-
"retryAfterSeconds": 5
20+
"genericRandomErrorPlugin": {
21+
"errorsFile": "devproxy-errors.json"
19522
},
19623
"rate": 50,
19724
"labelMode": "text",
19825
"logLevel": "info"
199-
}
26+
}
File renamed without changes.

0 commit comments

Comments
 (0)