Skip to content

Instantly share code, notes, and snippets.

View waldekmastykarz's full-sized avatar
🥑
Microsoft 365

Waldek Mastykarz waldekmastykarz

🥑
Microsoft 365
View GitHub Profile
@waldekmastykarz
waldekmastykarz / toggle-proxy.sh
Created December 11, 2023 19:00
Toggle macOS proxy settings
#!/bin/bash
arg1=$1
# Get the list of network services
network_services=$(networksetup -listallnetworkservices | tail -n +2)
if [[ "$arg1" == "on" ]]; then
while IFS= read -r service; do
networksetup -setwebproxy "$service" 127.0.0.1 8000
@waldekmastykarz
waldekmastykarz / build.sh
Created October 31, 2023 08:27
Build m365proxy locally
# stop on the first error
set -e
architecture="osx-x64"
release="m365-developer-proxy-$architecture-local"
# Clean
rm -rf ./$release
# Publish
@waldekmastykarz
waldekmastykarz / ContentService.cs
Created October 12, 2023 09:07
Build Microsoft Graph connector article - ContentService.cs
using Markdig;
using Microsoft.Graph.Models.ExternalConnectors;
using YamlDotNet.Serialization;
// [...] trimmed for brevity
static class ContentService
{
static IEnumerable<BlogPost> Extract()
{
@waldekmastykarz
waldekmastykarz / ConnectionService.cs
Created October 12, 2023 09:00
Build Microsoft Graph connector article - ConnectionService.cs
static class ConnectionService
{
async static Task CreateConnection()
{
await GraphService.Client.External.Connections
.PostAsync(ConnectionConfiguration.ExternalConnection);
}
async static Task CreateSchema()
{
@waldekmastykarz
waldekmastykarz / ConnectionConfiguration.cs
Last active October 12, 2023 09:01
Build Microsoft Graph connector article - ConnectionConfiguration.cs
using System.Text.Json;
using Microsoft.Graph.Models;
using Microsoft.Graph.Models.ExternalConnectors;
static class ConnectionConfiguration
{
public static ExternalConnection ExternalConnection
{
get
{
@waldekmastykarz
waldekmastykarz / m365proxy-latency.json
Created September 25, 2023 13:11
Sample simulation of latency on Microsoft Graph API requests using Microsoft 365 Developer Proxy
{
"plugins": [
{
"name": "LatencyPlugin",
"enabled": true,
"pluginPath": "~appFolder\\plugins\\m365-developer-proxy-plugins.dll",
"configSection": "latencyPlugin"
}
],
"urlsToWatch": [
@waldekmastykarz
waldekmastykarz / github-config.json
Last active September 3, 2023 10:21
GitHub m365proxy preset
{
"plugins": [
{
"name": "RateLimitingPlugin",
"enabled": true,
"pluginPath": "plugins\\m365-developer-proxy-plugins.dll",
"configSection": "rateLimiting"
}
],
"urlsToWatch": [
@waldekmastykarz
waldekmastykarz / release.txt
Last active April 28, 2025 08:52
devproxy
<html>
<head>
<title>v0.27.0</title>
</head>
<body>
<h1>v0.27.0</h1>
<h2>Add schema for the MinimalPermissionsGuidancePlugin</h2>
<p>No description provided.</p>
,
@waldekmastykarz
waldekmastykarz / appsettings.json
Created April 25, 2023 11:58
Excluding URLs in Microsoft Graph Developer Proxy
{
"plugins": [
{
"name": "GraphRandomErrorPlugin",
"enabled": true,
"pluginPath": "GraphProxyPlugins\\msgraph-developer-proxy-plugins.dll",
"configSection": "graphRandomErrorsPlugin"
}
],
"urlsToWatch": [
@waldekmastykarz
waldekmastykarz / mgdp-rate-limiting.sh
Created March 30, 2023 06:39
Microsoft Graph Developer Proxy rate-limiting preset
mgdp --config presets/microsoft-graph-rate-limiting.json