Skip to content

Conversation

bartizan
Copy link
Contributor

@bartizan bartizan commented Oct 9, 2025

@bartizan bartizan marked this pull request as ready for review October 9, 2025 08:37
@bartizan bartizan requested a review from a team as a code owner October 9, 2025 08:37
@waldekmastykarz
Copy link
Collaborator

Thanks for the PR, we'll review it asap

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends the ApiCenterMinimalPermissionsPlugin to support specific security scheme names when determining minimal permissions for API calls. This enhancement allows for more granular permission checking by supporting both delegated and application permissions through scheme-specific configuration.

Key Changes

  • Added optional schemeName configuration property to specify which security scheme to analyze
  • Enhanced reporting to include scheme-specific context in permission headers and log messages
  • Updated the permission checking logic to pass the scheme name for targeted analysis

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
schemas/v1.3.0/apicenterminimalpermissionsplugin.schema.json Added optional schemeName property to plugin configuration schema
DevProxy.Plugins/Reporting/ApiCenterMinimalPermissionsPluginReport.cs Enhanced report output to include scheme name in permission headers when specified
DevProxy.Plugins/Reporting/ApiCenterMinimalPermissionsPlugin.cs Added scheme name configuration, updated logging messages, and modified permission checking to use specified scheme
Comments suppressed due to low confidence (1)

DevProxy.Plugins/Reporting/ApiCenterMinimalPermissionsPlugin.cs:1

  • The nested if-else structure creates code duplication and reduces readability. Consider extracting the message formatting logic into helper methods or using string interpolation with conditional expressions to reduce duplication.
// Licensed to the .NET Foundation under one or more agreements.

Copy link
Collaborator

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Nothing to add

@waldekmastykarz waldekmastykarz merged commit cd8770e into dotnet:main Oct 17, 2025
4 checks passed
@bartizan bartizan deleted the 1392_add-schemaName-to-ApiCenterMinimalPermissionsPlugin branch October 17, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants