Skip to content

Conversation

@marcominerva
Copy link
Owner

This pull request introduces several improvements and refactorings across the authentication library, focusing on API Key and Basic Authentication settings, sample project dependencies, and documentation. The most significant changes are the refactoring of how credentials and API keys are managed, the addition of helper methods for retrieving all credentials and keys, and the update of sample dependencies to the latest versions.

Authentication Settings Refactoring:

  • Refactored ApiKeySettings and BasicAuthenticationSettings to use IEnumerable<ApiKey> and IEnumerable<Credential> instead of ICollection, simplifying property management and initialization. [1] [2]
  • Added internal helper methods GetAllApiKeys() and GetAllCredentials() to aggregate keys/credentials from both collection and individual properties, improving extensibility and correctness. [1] [2]
  • Moved the ApiKey and Credential record definitions to their own dedicated files for better separation and clarity.

Sample Project Dependency Updates:

  • Updated Microsoft.AspNetCore.OpenApi and Swashbuckle.AspNetCore.SwaggerUI package references to the latest versions in all sample .csproj files, ensuring compatibility and access to new features. [1] [2] [3]

Documentation and Editorial Improvements:

  • Improved wording and corrected minor typos in the README.md to enhance clarity and professionalism. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Removed outdated Azure-specific Copilot instructions and fixed a formatting issue in .github/copilot-instructions.md. [1] [2]

EditorConfig and Build Props Updates:

  • Added new style and diagnostic rules to .editorconfig for improved code consistency, and updated Nerdbank.GitVersioning to the latest version in Directory.Build.props. [1] [2] [3]

These changes collectively improve the maintainability, clarity, and reliability of the authentication library and its samples.

Updated .editorconfig to suggest simple property accessors and suppress certain diagnostics. Corrected grammatical errors in documentation and removed Azure-specific rules. Updated package references in project files to newer versions and added a project reference in `SimpleAuthentication.csproj`.

Refactored `ApiKeySettings.cs` and `BasicAuthenticationSettings.cs` to use `IEnumerable` and added methods for efficient handling of keys and credentials. Simplified constructors in authentication handlers and used generated regex for parsing headers.

Added new files `ApiKey.cs` and `Credential.cs` for better organization.
@marcominerva marcominerva merged commit 686c144 into master Oct 15, 2025
7 checks passed
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.

2 participants