Skip to content

Commit

Permalink
Update minimal permissions snippets. Closes #140 (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrytrinder authored Oct 28, 2024
1 parent 5c55cfb commit e4f62d0
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 52 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Snippets: All snippets that reference schemas updated to use `v0.22.0` schema
- Snippets: Added `logLevel`, `newVersionNotification`, `showSkipMessages` properties to `devproxy-config-file`
- Snippets: Renamed `devproxy-plugin-minimal-permissions` to `devproxy-plugin-graph-minimal-permissions`
- Snippets: Renamed `devproxy-plugin-minimal-permissions-guidance` to `devproxy-plugin-graph-minimal-permissions-guidance`

### Added:

- Snippets: `devproxy-plugin-minimal-permissions-guidance-config` - MinimalPermissionsGuidancePlugin config section
- Snippets: `devproxy-plugin-minimal-permissions` - MinimalPermissionsPlugin instance

## [0.10.0] - 2024-10-01

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Shown when the active document is a Dev Proxy configuration file
| `devproxy-plugin-generic-random-error-file-schema` | GenericRandomErrorPlugin errors file schema |
| `devproxy-plugin-graph-beta-support-guidance` | GraphBetaSupportGuidancePlugin instance |
| `devproxy-plugin-graph-client-request-id-guidance` | GraphClientRequestIdGuidancePlugin instance |
| `devproxy-plugin-graph-minimal-permissions-guidance` | GraphMinimalPermissionsGuidancePlugin instance |
| `devproxy-plugin-graph-minimal-permissions-guidance-config` | GraphMinimalPermissionsGuidancePlugin config section |
| `devproxy-plugin-graph-minimal-permissions` | GraphMinimalPermissionsPlugin instance |
| `devproxy-plugin-graph-minimal-permissions-config` | GraphMinimalPermissionsPlugin config section |
| `devproxy-plugin-graph-mock-response` | GraphMockResponsePlugin instance |
| `devproxy-plugin-graph-mock-response-config` | GraphMockResponsePlugin config section |
| `devproxy-plugin-graph-random-error` | GraphRandomErrorPlugin instance |
Expand All @@ -110,9 +114,8 @@ Shown when the active document is a Dev Proxy configuration file
| `devproxy-plugin-http-file-generator-config` | HttpFileGeneratorPlugin config section |
| `devproxy-plugin-latency` | LatencyPlugin instance |
| `devproxy-plugin-latency-config` | LatencyPlugin config section |
| `devproxy-plugin-graph-minimal-permissions-guidance` | MinimalPermissionsGuidancePlugin instance |
| `devproxy-plugin-graph-minimal-permissions-guidance-config` | MinimalPermissionsGuidancePlugin config section |
| `devproxy-plugin-graph-minimal-permissions` | MinimalPermissionsPlugin instance |
| `devproxy-plugin-minimal-permissions` | MinimalPermissionsPlugin instance |
| `devproxy-plugin-minimal-permissions-config` | MinimalPermissionsPlugin config section |
| `devproxy-plugin-mock-generator` | MockGeneratorPlugin instance |
| `devproxy-plugin-mock-request` | MockResponsePlugin instance |
| `devproxy-plugin-mock-request-config` | MockResponsePlugin config section |
Expand Down
57 changes: 34 additions & 23 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,70 @@ export const pluginSnippets: PluginSnippets = {
config: {
name: 'devproxy-plugin-api-center-production-version-config',
required: true,
},
}
},
CachingGuidancePlugin: {
instance: 'devproxy-plugin-caching-guidance',
config: {
name: 'devproxy-plugin-caching-guidance-config',
required: false,
},
}
},
CrudApiPlugin: {
instance: 'devproxy-plugin-crud-api',
config: {
name: 'devproxy-plugin-crud-api-config',
required: true,
},
}
},
DevToolsPlugin: {
instance: 'devproxy-plugin-dev-tools',
config: {
name: 'devproxy-plugin-dev-tools-config',
required: false,
},
}
},
EntraMockResponsePlugin: {
instance: 'devproxy-plugin-entra-mock-response',
config: {
name: 'devproxy-plugin-entra-mock-response-config',
required: true,
},
}
},
ExecutionSummaryPlugin: {
instance: 'devproxy-plugin-execution-summary',
config: {
name: 'devproxy-plugin-execution-summary-config',
required: false,
},
}
},
GenericRandomErrorPlugin: {
instance: 'devproxy-plugin-generic-random-error',
config: {
name: 'devproxy-plugin-generic-random-error-config',
required: true,
},
}
},
GraphBetaSupportGuidancePlugin: {
instance: 'devproxy-plugin-graph-beta-support-guidance',
},
GraphClientRequestIdGuidancePlugin: {
instance: 'devproxy-plugin-graph-client-request-id-guidance',
},
GraphMinimalPermissionsPlugin: {
instance: 'devproxy-plugin-graph-minimal-permissions',
config: {
name: 'devproxy-plugin-graph-minimal-permissions-config',
required: false,
}
},
GraphMinimalPermissionsGuidancePlugin: {
instance: 'devproxy-plugin-graph-minimal-permissions-guidance',
config: {
name: 'devproxy-plugin-graph-minimal-permissions-guidance-config',
required: false
}
},
GraphMockResponsePlugin: {
instance: 'devproxy-plugin-graph-mock-response',
},
Expand All @@ -78,7 +92,7 @@ export const pluginSnippets: PluginSnippets = {
config: {
name: 'devproxy-plugin-graph-random-error-config',
required: false,
},
}
},
GraphSdkGuidancePlugin: {
instance: 'devproxy-plugin-graph-sdk-guidance',
Expand All @@ -91,28 +105,21 @@ export const pluginSnippets: PluginSnippets = {
config: {
name: 'devproxy-plugin-http-file-generator-config',
required: false,
},
}
},
LatencyPlugin: {
instance: 'devproxy-plugin-latency',
config: {
name: 'devproxy-plugin-latency-config',
required: false,
},
},
MinimalPermissionsGuidancePlugin: {
instance: 'devproxy-plugin-minimal-permissions-guidance',
config: {
name: 'devproxy-plugin-minimal-permissions-guidance-config',
required: false
}
},
MinimalPermissionsPlugin: {
instance: 'devproxy-plugin-minimal-permissions',
config: {
name: 'devproxy-plugin-minimal-permissions-config',
required: false,
},
}
},
MockGeneratorPlugin: {
instance: 'devproxy-plugin-mock-generator',
Expand All @@ -122,7 +129,7 @@ export const pluginSnippets: PluginSnippets = {
config: {
name: 'devproxy-plugin-mock-request-config',
required: true,
},
}
},
MockResponsePlugin: {
instance: 'devproxy-plugin-mock-response',
Expand All @@ -148,7 +155,7 @@ export const pluginSnippets: PluginSnippets = {
config: {
name: 'devproxy-plugin-rate-limiting-config',
required: false,
},
}
},
RetryAfterPlugin: {
instance: 'devproxy-plugin-retry-after',
Expand Down Expand Up @@ -209,6 +216,14 @@ export const pluginDocs: PluginDocs = {
name: 'Graph Client Request ID Guidance Plugin',
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/graphclientrequestidguidanceplugin',
},
GraphMinimalPermissionsPlugin: {
name: 'Graph Minimal Permissions Plugin',
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/graphminimalpermissionsplugin',
},
GraphMinimalPermissionsGuidancePlugin: {
name: 'Graph Minimal Permissions Guidance Plugin',
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/graphminimalpermissionsguidanceplugin',
},
GraphMockResponsePlugin: {
name: 'Graph Mock Response Plugin',
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/graphmockresponseplugin',
Expand All @@ -233,10 +248,6 @@ export const pluginDocs: PluginDocs = {
name: 'Latency Plugin',
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/latencyplugin',
},
MinimalPermissionsGuidancePlugin: {
name: 'Minimal Permissions Guidance Plugin',
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/minimalpermissionsguidanceplugin',
},
MinimalPermissionsPlugin: {
name: 'Minimal Permissions Plugin',
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/minimalpermissionsplugin',
Expand Down
81 changes: 55 additions & 26 deletions src/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
"\t\t\"https://graph.microsoft.us/beta/*\",",
"\t\t\"https://dod-graph.microsoft.us/beta/*\",",
"\t\t\"https://microsoftgraph.chinacloudapi.cn/beta/*\"",
"\t]",
"\t]",
"}"
],
"description": "GraphBetaSupportGuidancePlugin instance"
Expand All @@ -465,6 +465,51 @@
],
"description": "GraphClientRequestIdGuidancePlugin instance"
},
"GraphMinimalPermissionsGuidancePlugin": {
"prefix": "devproxy-plugin-graph-minimal-permissions-guidance",
"body": [
"{",
"\t\"name\": \"GraphMinimalPermissionsGuidancePlugin\",",
"\t\"enabled\": true,",
"\t\"pluginPath\": \"~appFolder/plugins/dev-proxy-plugins.dll\"",
"}"
],
"description": "GraphMinimalPermissionsGuidancePlugin instance"
},
"GraphMinimalPermissionsGuidancePluginConfig": {
"prefix": "devproxy-plugin-graph-minimal-permissions-guidance-config",
"body": [
"\"graphMinimalPermissionsGuidancePlugin\": {",
"\t\"permissionsToIgnore\": [",
"\t\t\"profile\",",
"\t\t\"openid\",",
"\t\t\"offline_access\",",
"\t\t\"email\"",
"\t]",
"}"
],
"description": "GraphMinimalPermissionsGuidancePlugin config section"
},
"GraphMinimalPermissionsPlugin": {
"prefix": "devproxy-plugin-graph-minimal-permissions",
"body": [
"{",
"\t\"name\": \"GraphMinimalPermissionsPlugin\",",
"\t\"enabled\": true,",
"\t\"pluginPath\": \"~appFolder/plugins/dev-proxy-plugins.dll\"",
"}"
],
"description": "GraphMinimalPermissionsPlugin instance"
},
"GraphMinimalPermissionsPluginConfig": {
"prefix": "devproxy-plugin-graph-minimal-permissions-config",
"body": [
"\"graphMinimalPermissionsPlugin\": {",
"\t\"type\": \"delegated\"",
"}"
],
"description": "GraphMinimalPermissionsPlugin config section"
},
"GraphMockResponsePlugin": {
"prefix": "devproxy-plugin-graph-mock-response",
"body": [
Expand Down Expand Up @@ -612,41 +657,25 @@
],
"description": "LatencyPlugin config section"
},
"MinimalPermissionsGuidancePlugin": {
"prefix": "devproxy-plugin-graph-minimal-permissions-guidance",
"MinimalPermissionsPlugin": {
"prefix": "devproxy-plugin-minimal-permissions",
"body": [
"{",
"\t\"name\": \"MinimalPermissionsGuidancePlugin\",",
"\t\"name\": \"MinimalPermissionsPlugin\",",
"\t\"enabled\": true,",
"\t\"pluginPath\": \"~appFolder/plugins/dev-proxy-plugins.dll\"",
"}"
],
"description": "MinimalPermissionsGuidancePlugin instance"
},
"MinimalPermissionsGuidancePluginConfig": {
"prefix": "devproxy-plugin-graph-minimal-permissions-guidance-config",
"body": [
"\"minimalPermissionsGuidancePlugin\": {",
"\t\"permissionsToIgnore\": [",
"\t\t\"profile\",",
"\t\t\"openid\",",
"\t\t\"offline_access\",",
"\t\t\"email\"",
"\t]",
"}"
],
"description": "MinimalPermissionsGuidancePlugin config section"
"description": "MinimalPermissionsPlugin instance"
},
"MinimalPermissionsPlugin": {
"prefix": "devproxy-plugin-graph-minimal-permissions",
"MinimalPermissionsPluginConfig": {
"prefix": "devproxy-plugin-minimal-permissions-config",
"body": [
"{",
"\t\"name\": \"MinimalPermissionsPlugin\",",
"\t\"enabled\": true,",
"\t\"pluginPath\": \"~appFolder/plugins/dev-proxy-plugins.dll\"",
"\"minimalPermissionsPlugin\": {",
"\t\"apiSpecsFolderPath\": \"./api-specs\"",
"}"
],
"description": "MinimalPermissionsPlugin instance"
"description": "MinimalPermissionsPlugin config section"
},
"MockGeneratorPlugin": {
"prefix": "devproxy-plugin-mock-generator",
Expand Down

0 comments on commit e4f62d0

Please sign in to comment.