Skip to content

Commit b2f8cb4

Browse files
Renames Chaos Proxy to Developer Proxy. Closes #20
1 parent c66ad23 commit b2f8cb4

23 files changed

+76
-76
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Microsoft Graph Chaos Proxy
1+
# Microsoft Graph Developer Proxy
22

33
**Build with Microsoft Graph. Reliably**
44

5-
Microsoft Graph Chaos Proxy allows you to verify that your application, that uses Microsoft Graph, correctly handles errors that can happen when the application is used at scale. With Graph Chaos Proxy you can:
5+
Microsoft Graph Developer Proxy allows you to verify that your application, that uses Microsoft Graph, correctly handles errors that can happen when the application is used at scale. With Graph Developer Proxy you can:
66

77
- **simulate Microsoft Graph API errors**, to verify that your application handles them gracefully when deployed at scale,
88
- **mock Microsoft Graph API responses**, to use your application with test data
@@ -11,9 +11,9 @@ Microsoft Graph Chaos Proxy allows you to verify that your application, that use
1111

1212
API errors are hard to replicate because they occur only in specific circumstances, often when the application is under heavy load. Because developers typically work on their own tenants, they can only verify if their application properly handles errors after the application has been deployed to production and put under heavy load. This makes for a poor developer experience.
1313

14-
With Graph Chaos Proxy you can see how your application responds to different errors that could be returned by the API.
14+
With Graph Developer Proxy you can see how your application responds to different errors that could be returned by the API.
1515

16-
You can test your existing applications without any changes, even if you don't have access to their code and they're not using Microsoft Graph SDKs. Graph Chaos Proxy registers itself as a proxy on your machine and intercepts all network traffic. It passes through all requests and only responds to requests to the Microsoft Graph API.
16+
You can test your existing applications without any changes, even if you don't have access to their code and they're not using Microsoft Graph SDKs. Graph Developer Proxy registers itself as a proxy on your machine and intercepts all network traffic. It passes through all requests and only responds to requests to the Microsoft Graph API.
1717

1818
## Features
1919

@@ -34,42 +34,42 @@ You can test your existing applications without any changes, even if you don't h
3434

3535
## Usage
3636

37-
### Install Graph Chaos Proxy
37+
### Install Graph Developer Proxy
3838

3939
To install the proxy is easy
4040

41-
- Download the latest version of the ZIP file for your operating system from the [Releases](https://github.com/microsoftgraph/msgraph-chaos-proxy/releases) page
41+
- Download the latest version of the ZIP file for your operating system from the [Releases](https://github.com/microsoftgraph/msgraph-developer-proxy/releases) page
4242
- Extract the archive to a folder of your choice
4343

44-
Graph Chaos Proxy doesn't need an installation and you can run it from any location on your machine.
44+
Graph Developer Proxy doesn't need an installation and you can run it from any location on your machine.
4545

4646
> **Tip**
4747
>
48-
> To fully benefit of all features of Graph Chaos Proxy, add its location to the environment path. That way, you'll be able to start it from any directory and will be able to use project-specific mocks.
48+
> To fully benefit of all features of Graph Developer Proxy, add its location to the environment path. That way, you'll be able to start it from any directory and will be able to use project-specific mocks.
4949
5050
### First-time use
5151

5252
#### Windows
5353

54-
When started, Graph Chaos Proxy automatically registers itself as a system-wide proxy on your machine.
54+
When started, Graph Developer Proxy automatically registers itself as a system-wide proxy on your machine.
5555

56-
When you start Graph Chaos Proxy for the first time, you'll be prompted to install a local certificate. This certificate is necessary to decrypt requests to the Microsoft Graph API.
56+
When you start Graph Developer Proxy for the first time, you'll be prompted to install a local certificate. This certificate is necessary to decrypt requests to the Microsoft Graph API.
5757

58-
After installing the certificate, you'll be also prompted to allow Graph Chaos Proxy to communicate on your private and public network.
58+
After installing the certificate, you'll be also prompted to allow Graph Developer Proxy to communicate on your private and public network.
5959

6060
#### macOS
6161

62-
- make the Graph Chaos Proxy binary executable:
63-
- open terminal and change the working directory to the location of Graph Chaos Proxy
64-
- run `chmod +x ./msgraph-chaos-proxy`
65-
- open the location of Graph Chaos Proxy in Finder
66-
- on the keyboard press **Option** and open the context menu of the **msgraph-chaos-proxy** executable. From the context menu, choose **Open**, in the dialog choose **Open**
62+
- make the Graph Developer Proxy binary executable:
63+
- open terminal and change the working directory to the location of Graph Developer Proxy
64+
- run `chmod +x ./msgraph-developer-proxy`
65+
- open the location of Graph Developer Proxy in Finder
66+
- on the keyboard press **Option** and open the context menu of the **msgraph-developer-proxy** executable. From the context menu, choose **Open**, in the dialog choose **Open**
6767
- trust the certificate to decrypt SSL traffic:
6868
- Open **KeyChain Access**
6969
- in the search box, search for **Titanium Root Certificate Authority**
7070
- open the certificate and in the **Trust** section, set **Always Trust**
7171
- close the certificate window and confirm changes
72-
- set Graph Chaos Proxy as your system proxy:
72+
- set Graph Developer Proxy as your system proxy:
7373
- in **Network preferences**, select your adapter and click the **Advanced...** button
7474
- open **Proxies**
7575
- select **Secure Web Proxy (HTTPS)**
@@ -92,17 +92,17 @@ Depending on the configured fail ratio, the proxy will either pass the request t
9292
>
9393
> When closing the proxy, press the Enter key in the proxy's window, so that the proxy unregisters itself from your machine. If you terminate the proxy's process, you will lose network connection. To restore your connection in such case, start the proxy again, and close it by pressing Enter.
9494
95-
### Uninstall Graph Chaos Proxy
95+
### Uninstall Graph Developer Proxy
9696

97-
Remove the folder with proxy from your disk. Graph Chaos Proxy doesn't create any additional files or registry entries (Windows) on your machine. Remove the certificate installed by Graph Chaos Proxy.
97+
Remove the folder with proxy from your disk. Graph Developer Proxy doesn't create any additional files or registry entries (Windows) on your machine. Remove the certificate installed by Graph Developer Proxy.
9898

9999
On macOS remove the **~/.config/rootCert.pfx** file.
100100

101101
## Configuration
102102

103103
### Mock responses
104104

105-
Graph Chaos Proxy offers you the ability to define mock responses to specific Graph API calls. This capability is invaluable if you want to test your application with specific test cases or want to demonstrate your application with a set of data that is often time-sensitive and inconvenient to manage on an actual Microsoft 365 tenant.
105+
Graph Developer Proxy offers you the ability to define mock responses to specific Graph API calls. This capability is invaluable if you want to test your application with specific test cases or want to demonstrate your application with a set of data that is often time-sensitive and inconvenient to manage on an actual Microsoft 365 tenant.
106106

107107
#### Mock responses structure
108108

@@ -321,7 +321,7 @@ for request `GET /v1.0/users/48d31887-5fad-4d73-a9f5-3c356e68a038`, the proxy wo
321321
322322
#### Respond to requests with binary data
323323

324-
For some requests you might want to respond with binary data like documents or images. In Graph Chaos Proxy, you can define a binary response by setting the `responseBody` to a string value that starts with `@` followed by file path relative to the current working directory, for example:
324+
For some requests you might want to respond with binary data like documents or images. In Graph Developer Proxy, you can define a binary response by setting the `responseBody` to a string value that starts with `@` followed by file path relative to the current working directory, for example:
325325

326326
```json
327327
{
@@ -342,7 +342,7 @@ When you call `GET /v1.0/users/[email protected]/photo/$value`, you'll get the ima
342342

343343
### Settings
344344

345-
Graph Chaos Proxy comes with several settings that you can use to control how the proxy should run. You can configure these settings by defining them in the `appsettings.json` file in the proxy's installation folder or using options in the command line.
345+
Graph Developer Proxy comes with several settings that you can use to control how the proxy should run. You can configure these settings by defining them in the `appsettings.json` file in the proxy's installation folder or using options in the command line.
346346

347347
Setting|Description|Command-line option|Allowed values|Default value
348348
--|--|--|--|--
@@ -356,20 +356,20 @@ Setting|Description|Command-line option|Allowed values|Default value
356356
#### Example usage:
357357

358358
```
359-
msgraph-chaos-proxy.exe --port 8080 --failure-rate 50 --no-mocks --allowed-errors 429 503
359+
msgraph-developer-proxy.exe --port 8080 --failure-rate 50 --no-mocks --allowed-errors 429 503
360360
```
361361

362362
Will configure the proxy listening on port 8080 to fail 50% of requests with an http status code of either 429 or 503 and ignore any mock responses that may have been provided in the `responses.json` file
363363

364364
## Frequently Asked Questions
365365

366-
### Does Graph Chaos Proxy upload any data to Microsoft?
366+
### Does Graph Developer Proxy upload any data to Microsoft?
367367

368368
No, it doesn't. While the proxy intercepts all network traffic on your machine, it doesn't upload any data to Microsoft.
369369

370-
### I've got no internet connection after using Graph Chaos Proxy
370+
### I've got no internet connection after using Graph Developer Proxy
371371

372-
If you terminate the Graph Chaos Proxy process, the proxy won't be able to unregister itself and you won't have network connection on your machine. To restore network connection, start the proxy and close it by pressing Enter, which will gracefully close the proxy unregistering it on your machine and restoring the regular network connection.
372+
If you terminate the Graph Developer Proxy process, the proxy won't be able to unregister itself and you won't have network connection on your machine. To restore network connection, start the proxy and close it by pressing Enter, which will gracefully close the proxy unregistering it on your machine and restoring the regular network connection.
373373

374374
### I keep getting 429 responses
375375

msgraph-chaos-proxy/Program.cs

Lines changed: 0 additions & 4 deletions
This file was deleted.

msgraph-chaos-proxy.sln renamed to msgraph-developer-proxy.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.3.32901.215
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "msgraph-chaos-proxy", "msgraph-chaos-proxy\msgraph-chaos-proxy.csproj", "{A1047491-5E52-4755-B5D7-17B3774E35FC}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "msgraph-developer-proxy", "msgraph-developer-proxy\msgraph-developer-proxy.csproj", "{A1047491-5E52-4755-B5D7-17B3774E35FC}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1CC1EC7F-4839-43C8-9980-9BCB19609FA9}"
99
ProjectSection(SolutionItems) = preProject

msgraph-chaos-proxy/.vscode/launch.json renamed to msgraph-developer-proxy/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/bin/Debug/net6.0/msgraph-chaos-proxy.dll",
13+
"program": "${workspaceFolder}/bin/Debug/net6.0/msgraph-developer-proxy.dll",
1414
"args": [],
1515
"cwd": "${workspaceFolder}",
1616
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console

msgraph-chaos-proxy/.vscode/tasks.json renamed to msgraph-developer-proxy/.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "process",
88
"args": [
99
"build",
10-
"${workspaceFolder}/msgraph-chaos-proxy.csproj",
10+
"${workspaceFolder}/msgraph-developer-proxy.csproj",
1111
"/property:GenerateFullPaths=true",
1212
"/consoleloggerparameters:NoSummary"
1313
],
@@ -19,7 +19,7 @@
1919
"type": "process",
2020
"args": [
2121
"publish",
22-
"${workspaceFolder}/msgraph-chaos-proxy.csproj",
22+
"${workspaceFolder}/msgraph-developer-proxy.csproj",
2323
"/property:GenerateFullPaths=true",
2424
"/consoleloggerparameters:NoSummary"
2525
],
@@ -33,7 +33,7 @@
3333
"watch",
3434
"run",
3535
"--project",
36-
"${workspaceFolder}/msgraph-chaos-proxy.csproj"
36+
"${workspaceFolder}/msgraph-developer-proxy.csproj"
3737
],
3838
"problemMatcher": "$msCompile"
3939
}

msgraph-chaos-proxy/ChaosEngine.cs renamed to msgraph-developer-proxy/ChaosEngine.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Titanium.Web.Proxy.Models;
1010
using Titanium.Web.Proxy.Network;
1111

12-
namespace Microsoft.Graph.ChaosProxy {
12+
namespace Microsoft.Graph.DeveloperProxy {
1313
internal enum FailMode {
1414
Throttled,
1515
Random,
@@ -70,14 +70,14 @@ public class ChaosEngine {
7070
}
7171
};
7272

73-
private readonly ChaosProxyConfiguration _config;
73+
private readonly ProxyConfiguration _config;
7474
private readonly Random _random;
7575
private ProxyServer? _proxyServer;
7676
private ExplicitProxyEndPoint? _explicitEndPoint;
7777
private readonly Dictionary<string, DateTime> _throttledRequests;
7878
private readonly ConsoleColor _color;
7979

80-
public ChaosEngine(ChaosProxyConfiguration config) {
80+
public ChaosEngine(ProxyConfiguration config) {
8181
_config = config ?? throw new ArgumentNullException(nameof(config));
8282
_config.InitResponsesWatcher();
8383

@@ -136,7 +136,7 @@ public async Task Run(CancellationToken? cancellationToken) {
136136
}
137137

138138
// wait here (You can use something else as a wait function, I am using this as a demo)
139-
Console.WriteLine("Press Enter to stop the Microsoft Graph Chaos Proxy");
139+
Console.WriteLine("Press Enter to stop the Microsoft Graph Developer Proxy");
140140
Console.ReadLine();
141141

142142
// Unsubscribe & Quit
@@ -263,7 +263,7 @@ private static string GetMoveToSdkUrl(Request request) {
263263
return "https://aka.ms/move-to-graph-js-sdk";
264264
}
265265

266-
private static void ProcessMockResponse(SessionEventArgs e, ResponseComponents responseComponents, ChaosProxyMockResponse matchingResponse) {
266+
private static void ProcessMockResponse(SessionEventArgs e, ResponseComponents responseComponents, ProxyMockResponse matchingResponse) {
267267
if (matchingResponse.ResponseCode is not null) {
268268
responseComponents.ErrorStatus = (HttpStatusCode)matchingResponse.ResponseCode;
269269
}
@@ -304,7 +304,7 @@ private static void ProcessMockResponse(SessionEventArgs e, ResponseComponents r
304304
}
305305
}
306306

307-
private ChaosProxyMockResponse? GetMatchingMockResponse(Request request) {
307+
private ProxyMockResponse? GetMatchingMockResponse(Request request) {
308308
if (_config.NoMocks ||
309309
_config.Responses is null ||
310310
!_config.Responses.Any()) {
@@ -330,7 +330,7 @@ _config.Responses is null ||
330330
return mockResponse;
331331
}
332332

333-
private void UpdateProxyResponse(SessionEventArgs e, ResponseComponents responseComponents, ChaosProxyMockResponse? matchingResponse) {
333+
private void UpdateProxyResponse(SessionEventArgs e, ResponseComponents responseComponents, ProxyMockResponse? matchingResponse) {
334334
if (responseComponents.ErrorStatus == HttpStatusCode.TooManyRequests) {
335335
var retryAfterDate = DateTime.Now.AddSeconds(retryAfterInSeconds);
336336
_throttledRequests[BuildThrottleKey(e.HttpClient.Request)] = retryAfterDate;

msgraph-chaos-proxy/ErrorResponseBody.cs renamed to msgraph-developer-proxy/ErrorResponseBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Text.Json.Serialization;
22

3-
namespace Microsoft.Graph.ChaosProxy {
3+
namespace Microsoft.Graph.DeveloperProxy {
44
internal class ErrorResponseBody {
55
[JsonPropertyName("error")]
66
public ErrorResponseError Error { get; set; }
File renamed without changes.

msgraph-developer-proxy/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using Microsoft.Graph.DeveloperProxy;
2+
using System.CommandLine;
3+
4+
return await new ProxyHost().GetRootCommand().InvokeAsync(args);

0 commit comments

Comments
 (0)