Skip to content

Commit 1a5e232

Browse files
authored
Add AuthPlugin snippets. Closes #123 (#131)
1 parent 4278f3b commit 1a5e232

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
- Snippets: Support for JSONC (JSON with Comments) files
2828
- Snippets: `devproxy-plugin-graph-minimal-permissions-guidance-config` - MinimalPermissionsGuidancePlugin config section
2929
- Snippets: `devproxy-error` - Dev Proxy error
30+
- Snippets: `devproxy-auth-plugin` - AuthPlugin instance
31+
- Snippets: `devproxy-plugin-auth-config-apikey` - AuthPlugin API Key config section
32+
- Snippets: `devproxy-plugin-auth-config-oauth2` - AuthPlugin OAuth2 config section
3033

3134
### Changed:
3235

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Shown when the active document is a Dev Proxy configuration file
7272
| `devproxy-request` | Dev Proxy request |
7373
| `devproxy-response` | Dev Proxy response |
7474
| `devproxy-response-header` | Dev Proxy response header |
75+
| `devproxy-plugin-auth` | AuthPlugin instance |
76+
| `devproxy-plugin-auth-config-apikey` | AuthPlugin API Key config section |
77+
| `devproxy-plugin-auth-config-oauth2` | AuthPlugin OAuth2 config section |
7578
| `devproxy-plugin-api-center-minimal-permissions` | ApiCenterMinimalPermissionsPlugin instance |
7679
| `devproxy-plugin-api-center-minimal-permissions-config` | ApiCenterMinimalPermissionsPlugin config section |
7780
| `devproxy-plugin-api-center-onboarding` | ApiCenterOnboardingPlugin instance |

src/snippets.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,72 @@
107107
],
108108
"description": "Dev Proxy response header"
109109
},
110+
"AuthPlugin": {
111+
"prefix": "devproxy-plugin-auth",
112+
"body": [
113+
"{",
114+
"\t\"name\": \"AuthPlugin\",",
115+
"\t\"enabled\": true,",
116+
"\t\"pluginPath\": \"~appFolder/plugins/dev-proxy-plugins.dll\",",
117+
"\t\"configSection\": \"auth\"",
118+
"}"
119+
],
120+
"description": "AuthPlugin instance"
121+
},
122+
"AuthPluginAPIKeyConfig": {
123+
"prefix": "devproxy-plugin-auth-config-apikey",
124+
"body": [
125+
"\"auth\": {",
126+
"\t\"type\": \"apiKey\",",
127+
"\t\"apiKey\": {",
128+
"\t\t\"parameters\": [",
129+
"\t\t\t{",
130+
"\t\t\t\t\"in\": \"header\",",
131+
"\t\t\t\t\"name\": \"x-api-key\"",
132+
"\t\t\t},",
133+
"\t\t\t{",
134+
"\t\t\t\t\"in\": \"query\",",
135+
"\t\t\t\t\"name\": \"code\"",
136+
"\t\t\t}",
137+
"\t\t],",
138+
"\t\t\"allowedKeys\": [",
139+
"\t\t\t\"1234\"",
140+
"\t\t]",
141+
"\t}",
142+
"}"
143+
],
144+
"description": "AuthPlugin API Key config section"
145+
},
146+
"AuthPluginOAuth2Config": {
147+
"prefix": "devproxy-plugin-auth-config-oauth2",
148+
"body": [
149+
"\"auth\": {",
150+
"\t\"type\": \"oauth2\",",
151+
"\t\"oauth2\": {",
152+
"\t\t\"metadataUrl\": \"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration\",",
153+
"\t\t\"allowedApplications\": [",
154+
"\t\t\t\"00000000-0000-0000-0000-000000000000\"",
155+
"\t\t],",
156+
"\t\t\"allowedAudiences\": [",
157+
"\t\t\t\"00000000-0000-0000-0000-000000000000\"",
158+
"\t\t],",
159+
"\t\t\"allowedPrincipals\": [",
160+
"\t\t\t\"00000000-0000-0000-0000-000000000000\"",
161+
"\t\t],",
162+
"\t\t\"allowedTenants\": [",
163+
"\t\t\t\"00000000-0000-0000-0000-000000000000\"",
164+
"\t\t],",
165+
"\t\t\"issuer\": \"https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0\",",
166+
"\t\t\"scopes\": [",
167+
"\t\t\t\"Posts.Read\"",
168+
"\t\t],",
169+
"\t\t\"validateLifetime\": true,",
170+
"\t\t\"validateSigningKey\": true",
171+
"\t}",
172+
"}"
173+
],
174+
"description": "AuthPlugin OAuth2 config section"
175+
},
110176
"ApiCenterMinimalPermissionsPlugin": {
111177
"prefix": "devproxy-plugin-api-center-minimal-permissions",
112178
"body": [

0 commit comments

Comments
 (0)