Add API key authentication and MCP search improvements#352
Merged
239573049 merged 1 commit intoAIDotNet:mainfrom Apr 11, 2026
Merged
Add API key authentication and MCP search improvements#352239573049 merged 1 commit intoAIDotNet:mainfrom
239573049 merged 1 commit intoAIDotNet:mainfrom
Conversation
…ta (AIDotNet#26) API Key Authentication (headless/M2M): - Split-token API key scheme (dwk_ prefix, SHA-256 hashed storage) - Constant-time hash comparison, instant revocation - ASP.NET Core auth handler alongside existing OAuth - Admin endpoints for key management (POST/GET/DELETE /api/admin/api-keys) - User self-service endpoints (POST/GET/DELETE /api/auth/api-keys) - Admin UI page at /admin/api-keys - User settings page API Keys section at /settings - MCP endpoint works without Google OAuth when API key is provided Cross-Repository Search: - New SearchAllRepositories MCP tool searches across all accessible repos - Single JOIN query with EF.Functions.Like, filtered by user's accessible repos - Returns snippets with relevance scoring (title match = 2.0, content = 1.0) Fix SearchDocuments: - Replace StringComparison.OrdinalIgnoreCase with EF.Functions.Like - Fixes SQLite EF Core translation error at runtime Repository Metadata: - Add Description field to Repository entity (populated from GitHub on import) - Expose Description and PrimaryLanguage in ListRepositories MCP tool - Add Description to DepartmentRepositoryInfo for department repo queries i18n: translations for all 4 locales (en, zh, ko, ja)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds API key authentication for headless/M2M MCP access, fixes SearchDocuments, and adds repository metadata to the MCP API.
API Key Authentication
ApiKeyentity with split-token storage (dwk_prefix, SHA-256 hashed, constant-time comparison)ApiKeyAuthenticationHandlerthat works alongside existing JWT/OAuth authPOST/GET/DELETE /api/admin/api-keys) for key managementPOST/GET/DELETE /api/auth/api-keys)/admin/api-keys/settingsFix SearchDocuments
StringComparison.OrdinalIgnoreCasewithEF.Functions.Likein the search queryRepository Metadata
Descriptionfield toRepositoryentity (populated from GitHub on import)DescriptionandPrimaryLanguagetoDepartmentRepositoryInfoFrontend
Motivation
Enables headless services (CI/CD, autonomous agents) to authenticate with the MCP endpoint without browser-based OAuth flows.