Skip to content

Adds support for detecting and documenting command permissions #6705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .devproxy/api-specs/sharepoint-admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
openapi: 3.0.4
info:
title: SharePoint Tenant Admin site API
description: SharePoint Tenant Admin site API
version: v1.0
servers:
- url: https://{tenant}-admin.sharepoint.com
variables:
tenant:
default: contoso
components:
securitySchemes:
delegated:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://login.microsoftonline.com/common/v2.0/oauth2/authorize
tokenUrl: https://login.microsoftonline.com/common/v2.0/oauth2/token
scopes:
AllSites.FullControl: AllSites.FullControl
AllSites.Manage: AllSites.Manage
AllSites.Read: AllSites.Read
AllSites.Write: AllSites.Write
EnterpriseResource.Read: EnterpriseResource.Read
EnterpriseResource.Write: EnterpriseResource.Write
MyFiles.Read: MyFiles.Read
MyFiles.Write: MyFiles.Write
Project.Read: Project.Read
Project.Write: Project.Write
ProjectWebApp.FullControl: ProjectWebApp.FullControl
ProjectWebAppReporting.Read: ProjectWebAppReporting.Read
Sites.Search.All: Sites.Search.All
TaskStatus.Submit: TaskStatus.Submit
TermStore.Read.All: TermStore.Read.All
TermStore.ReadWrite.All: TermStore.ReadWrite.All
User.Read.All: User.Read.All
User.ReadWrite.All: User.ReadWrite.All
application:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://login.microsoftonline.com/common/v2.0/oauth2/token
scopes:
Sites.FullControl.All: Sites.FullControl.All
Sites.Manage.All: Sites.Manage.All
Sites.Read.All: Sites.Read.All
Sites.ReadWrite.All: Sites.ReadWrite.All
Sites.Selected: Sites.Selected
TermStore.Read.All: TermStore.Read.All
TermStore.ReadWrite.All: TermStore.ReadWrite.All
User.Read.All: User.Read.All
User.ReadWrite.All: User.ReadWrite.All
paths:
/_api/contextinfo:
post:
security:
- delegated:
- AllSites.Read
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
responses:
200:
description: OK
x-ms-generated-by:
toolName: Dev Proxy
toolVersion: 0.25.0
230 changes: 230 additions & 0 deletions .devproxy/api-specs/sharepoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
openapi: 3.0.4
info:
title: SharePoint REST API
description: SharePoint REST API
version: v1.0
servers:
- url: https://{tenant}.sharepoint.com/{site}
variables:
tenant:
default: contoso
site:
default: ""
components:
securitySchemes:
delegated:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://login.microsoftonline.com/common/v2.0/oauth2/authorize
tokenUrl: https://login.microsoftonline.com/common/v2.0/oauth2/token
scopes:
AllSites.FullControl: AllSites.FullControl
AllSites.Manage: AllSites.Manage
AllSites.Read: AllSites.Read
AllSites.Write: AllSites.Write
EnterpriseResource.Read: EnterpriseResource.Read
EnterpriseResource.Write: EnterpriseResource.Write
MyFiles.Read: MyFiles.Read
MyFiles.Write: MyFiles.Write
Project.Read: Project.Read
Project.Write: Project.Write
ProjectWebApp.FullControl: ProjectWebApp.FullControl
ProjectWebAppReporting.Read: ProjectWebAppReporting.Read
Sites.Search.All: Sites.Search.All
TaskStatus.Submit: TaskStatus.Submit
TermStore.Read.All: TermStore.Read.All
TermStore.ReadWrite.All: TermStore.ReadWrite.All
User.Read.All: User.Read.All
User.ReadWrite.All: User.ReadWrite.All
application:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://login.microsoftonline.com/common/v2.0/oauth2/token
scopes:
Sites.FullControl.All: Sites.FullControl.All
Sites.Manage.All: Sites.Manage.All
Sites.Read.All: Sites.Read.All
Sites.ReadWrite.All: Sites.ReadWrite.All
Sites.Selected: Sites.Selected
TermStore.Read.All: TermStore.Read.All
TermStore.ReadWrite.All: TermStore.ReadWrite.All
User.Read.All: User.Read.All
User.ReadWrite.All: User.ReadWrite.All
paths:
/_api/contextinfo:
post:
security:
- delegated:
- AllSites.Read
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
responses:
200:
description: OK
/_api/SP_TenantSettings_Current:
get:
security:
- delegated:
- AllSites.Read
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
responses:
200:
description: OK
/_api/web:
get:
security:
- delegated:
- AllSites.Read
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
responses:
200:
description: OK
/_api/web/folders/addUsingPath(decodedUrl={folderPath}):
post:
parameters:
- name: folderPath
in: path
required: true
description: URL-encoded server-relative path to the folder
schema:
type: string
example: "'%2FShared%20Documents%2FMy%20Folder%20Name'"
security:
- delegated:
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
responses:
200:
description: OK
/_api/web/GetFolderByServerRelativePath(DecodedUrl={folderPath}):
get:
parameters:
- name: folderPath
in: path
required: true
description: URL-encoded server-relative path to the folder
schema:
type: string
example: "'%2FShared%20Documents'"
security:
- delegated:
- AllSites.Read
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
responses:
200:
description: OK
/_api/web/GetFolderByServerRelativePath(DecodedUrl={folderPath})/Files/Add({filesAddOptions}):
post:
parameters:
- name: folderPath
in: path
required: true
description: URL-encoded server-relative path to the folder
schema:
type: string
example: "'%2FShared%20Documents'"
- name: filesAddOptions
in: path
required: true
description: Options for adding files
schema:
type: string
example: "url='README.md',%20overwrite=true"
security:
- delegated:
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
responses:
200:
description: OK
/_api/web/lists:
get:
security:
- delegated:
- AllSites.Read
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
- application:
- Sites.Read.All
- Sites.Manage.All
- Sites.ReadWrite.All
- Sites.FullControl.All
responses:
200:
description: OK
/_api/web/webs:
get:
security:
- delegated:
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
- application:
- Sites.Read.All
- Sites.Manage.All
- Sites.ReadWrite.All
- Sites.FullControl.All
responses:
200:
description: OK
/sites/{appCatalog}/_api/web/tenantappcatalog/Add({addOptions}):
post:
parameters:
- name: appCatalog
in: path
required: true
description: App catalog site URL
schema:
type: string
example: "appcatalog"
- name: addOptions
in: path
required: true
description: Options for adding the app package
schema:
type: string
example: "overwrite=false,%20url='spfx.sppkg'"
security:
- delegated:
- AllSites.FullControl
responses:
200:
description: OK
/sites/{appCatalog}/_api/web/tenantappcatalog/AvailableApps/GetById({appId})/deploy:
post:
parameters:
- name: appCatalog
in: path
required: true
description: App catalog site URL
schema:
type: string
example: "appcatalog"
- name: appId
in: path
required: true
description: App ID to deploy
schema:
type: string
example: "'f55e3c17-63ea-456a-8451-48d2839760f7'"
security:
- delegated:
- AllSites.FullControl
responses:
200:
description: OK
x-ms-generated-by:
toolName: Dev Proxy
toolVersion: 0.25.0
48 changes: 48 additions & 0 deletions .devproxy/devproxyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/rc.schema.json",
"plugins": [
{
"name": "GraphMinimalPermissionsPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"urlsToWatch": [
"https://graph.microsoft.com/*"
]
},
{
"name": "MinimalPermissionsPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "minimalPermissionsPlugin",
"urlsToWatch": [
"https://*.sharepoint.com/*_api/*"
]
},
{
"name": "MinimalCsomPermissionsPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.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/v1.0.0/minimalpermissionsplugin.schema.json",
"apiSpecsFolderPath": "./api-specs"
},
"minimalCsomPermissionsPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/minimalcsompermissionsplugin.schema.json",
"typesFilePath": "./spo-csom-types.json"
},
"asSystemProxy": false,
"logLevel": "information",
"newVersionNotification": "stable",
"showSkipMessages": true,
"record": true
}
24 changes: 24 additions & 0 deletions .devproxy/generate-openapi-spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/rc.schema.json",
"plugins": [
{
"name": "OpenApiSpecGeneratorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "openApiSpecGeneratorPlugin"
}
],
"urlsToWatch": [
"!https://login.microsoftonline.com/*",
"!https://*.applicationinsights.azure.com/*",
"*"
],
"openApiSpecGeneratorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/openapispecgeneratorplugin.schema.json",
"includeOptionsRequests": false,
"specVersion": "v3_0",
"specFormat": "Yaml"
},
"asSystemProxy": false,
"record": true
}
Loading