Skip to content

MinimalPermissionsPlugin doesn't match site-specific URLs #1292

@Jwaegebaert

Description

@Jwaegebaert

Description

We're using the following plugin setup:

{
  "name": "MinimalPermissionsPlugin",
  "enabled": true,
  "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
  "configSection": "minimalPermissionsPlugin",
  "urlsToWatch": [
    "https://*.sharepoint.com/*_api/*"
  ]
}

When using root URLs like https://contoso.sharepoint.com, the plugin returns the expected minimal permissions. However, when making calls to specific sites (e.g. https://contoso.sharepoint.com/sites/test1), Dev Proxy logs a warning saying no matching pattern was found, even though the pattern should cover it.

Image

Expected behaviour

MinimalPermissionsPlugin should detect and process site-specific SharePoint URLs that match the defined pattern and return the corresponding minimal permissions.

Actual behaviour

For site-specific URLs, Dev Proxy logs a warning about no matching path item being found, and does not return any permissions.

Steps to reproduce

Check the setup in this PR https://github.com/pnp/cli-microsoft365/pull/6705/files and run a simple request to a SharePoint site using Dev Proxy with the MinimalPermissionsPlugin enabled. You'll notice that it works fine for the root site, but when using something like /sites/test1, it throws the warning.

Dev Proxy Version

0.27.0

Operating system (environment)

Windows

Shell

PowerShell

Configuration file

{
  "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rc.schema.json",
  "plugins": [
    {
      "name": "GraphMinimalPermissionsPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
      "urlsToWatch": [
        "https://graph.microsoft.com/*"
      ]
    },
    {
      "name": "MinimalPermissionsPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
      "configSection": "minimalPermissionsPlugin",
      "urlsToWatch": [
        "https://*.sharepoint.com/*_api/*"
      ]
    },
    {
      "name": "MinimalCsomPermissionsPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
      "configSection": "minimalCsomPermissionsPlugin",
      "urlsToWatch": [
        "https://*.sharepoint.com/*_vti_bin/client.svc/ProcessQuery"
      ]
    }
  ],
  "urlsToWatch": [
    "https://*.sharepoint.com/*",
    "https://graph.microsoft.com/*"
  ],
  "minimalPermissionsPlugin": {
    "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/minimalpermissionsplugin.schema.json",
    "apiSpecsFolderPath": "./api-specs"
  },
  "minimalCsomPermissionsPlugin": {
    "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/minimalcsompermissionsplugin.schema.json",
    "typesFilePath": "./spo-csom-types.json"
  },
  "asSystemProxy": false,
  "logLevel": "information",
  "newVersionNotification": "stable",
  "showSkipMessages": true,
  "record": true
}

Additional Info

No response

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions