Skip to content

Commit d568850

Browse files
Prevents retrieving minimal permissions when no Graph URLs captured. Closes #290 (#291)
1 parent d1d9b08 commit d568850

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

m365-developer-proxy-plugins/RequestLogs/MinimalPermissionsPlugin.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ private async void AfterRecordingStop(object? sender, RecordingArgs e)
6565
// Remove duplicates
6666
endpoints = endpoints.Distinct(methodAndUrlComparer).ToList();
6767

68+
if (!endpoints.Any()) {
69+
_logger?.LogInfo("No requests to Microsoft Graph endpoints recorded. Will not retrieve minimal permissions.");
70+
return;
71+
}
72+
6873
_logger?.LogInfo("Retrieving minimal permissions for:");
6974
_logger?.LogInfo(string.Join(Environment.NewLine, endpoints.Select(e => $"- {e.Item1} {e.Item2}")));
7075
_logger?.LogInfo("");

0 commit comments

Comments
 (0)