Skip to content

Add API Key authentication support to CRUD API plugin#1655

Open
garrytrinder wants to merge 3 commits into
dotnet:mainfrom
garrytrinder:garrytrinder/1650-crud-api-key-auth
Open

Add API Key authentication support to CRUD API plugin#1655
garrytrinder wants to merge 3 commits into
dotnet:mainfrom
garrytrinder:garrytrinder/1650-crud-api-key-auth

Conversation

@garrytrinder
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 12, 2026 13:20
@garrytrinder garrytrinder requested a review from a team as a code owner May 12, 2026 13:20
Copy link
Copy Markdown
Contributor

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 adds API key authentication as an additional security option for the CRUD API plugin, updating both the API definition schema and the plugin runtime to support configuring and validating API keys at the root level and per-action level.

Changes:

  • Extend CRUD API auth type to include apiKey, and introduce apiKeyAuthConfig at both root and action levels.
  • Implement API key authorization checks (header and optional query-string parameter) and update CORS allow-headers handling.
  • Update the API definition loader to hydrate the new API key auth configuration from the API file.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
schemas/v3.0.0/crudapiplugin.apifile.schema.json Adds apiKey auth option and new apiKeyAuthConfig schema blocks at root and action scopes.
DevProxy.Plugins/Mocking/CrudApiPlugin.cs Adds API key auth type/config, authorization logic, and CORS allow-headers updates.
DevProxy.Plugins/Mocking/CrudApiDefinitionLoader.cs Loads ApiKeyAuthConfig from the API definition file into runtime configuration.

Comment thread DevProxy.Plugins/Mocking/CrudApiPlugin.cs Outdated
Comment thread DevProxy.Plugins/Mocking/CrudApiPlugin.cs
Comment thread DevProxy.Plugins/Mocking/CrudApiPlugin.cs Outdated
Comment thread schemas/v3.0.0/crudapiplugin.apifile.schema.json
Comment thread schemas/v3.0.0/crudapiplugin.apifile.schema.json
Comment thread DevProxy.Plugins/Mocking/CrudApiPlugin.cs Outdated
Comment thread DevProxy.Plugins/Mocking/CrudApiPlugin.cs Outdated
Comment thread DevProxy.Plugins/Mocking/CrudApiPlugin.cs Outdated
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.

3 participants