Skip to content

Commit 74d48ea

Browse files
Refactor conditional logic for handling application endpoints in GraphMinimalPermissionsGuidancePlugin. Closes #1605 (#1606)
Co-authored-by: Garry Trinder <garry@trinder365.co.uk>
1 parent 22ef349 commit 74d48ea

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

DevProxy.Plugins/Reporting/GraphMinimalPermissionsGuidancePlugin.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,20 @@ public override async Task AfterRecordingStopAsync(RecordingArgs e, Cancellation
141141
}
142142
else
143143
{
144-
// skip empty roles which are returned in case we couldn't get permissions information
145-
//
146144
// application permissions are always the same because they come from app reg
147145
// so we can just use the first request that has them
148146
if (permissions.Any() && !rolesToEvaluate.Any())
149147
{
150148
rolesToEvaluate = permissions;
149+
}
151150

152-
if (ProxyUtils.IsGraphBatchUrl(uri))
153-
{
154-
applicationEndpoints.AddRange(requestsFromBatch);
155-
}
156-
else
157-
{
158-
applicationEndpoints.Add(methodAndUrl);
159-
}
151+
if (ProxyUtils.IsGraphBatchUrl(uri))
152+
{
153+
applicationEndpoints.AddRange(requestsFromBatch);
154+
}
155+
else
156+
{
157+
applicationEndpoints.Add(methodAndUrl);
160158
}
161159
}
162160
}

0 commit comments

Comments
 (0)