Skip to content

Commit c8163e9

Browse files
committed
Refactor and update project dependencies
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.
1 parent c62f683 commit c8163e9

File tree

20 files changed

+85
-115
lines changed

20 files changed

+85
-115
lines changed

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ csharp_style_prefer_local_over_anonymous_function = true:silent
8282
csharp_style_prefer_extended_property_pattern = true:suggestion
8383
csharp_style_implicit_object_creation_when_type_is_apparent = true:silent
8484
csharp_style_prefer_tuple_swap = true:silent
85+
csharp_style_prefer_simple_property_accessors = true:suggestion
8586

8687
# Field preferences
8788
dotnet_style_readonly_field = true:suggestion
@@ -299,4 +300,7 @@ dotnet_diagnostic.IDE0010.severity = none
299300
dotnet_diagnostic.IDE0072.severity = none
300301

301302
# IDE0305: Simplify collection initialization
302-
dotnet_diagnostic.IDE0305.severity = none
303+
dotnet_diagnostic.IDE0305.severity = none
304+
305+
# CA1873: Avoid potentially expensive logging
306+
dotnet_diagnostic.CA1873.severity = none

.github/copilot-instructions.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
### Implementation Guidelines
6060

6161
- Write code that is secure by default. Avoid exposing potentially private or sensitive data.
62-
- Make code NativeAOT compatible when possible. This means avoiding dynamic code generation, reflection, and other features that are not compatible. with NativeAOT. If not possible, mark the code with an appropriate annotation or throw an exception.
62+
- Make code NativeAOT compatible when possible. This means avoiding dynamic code generation, reflection, and other features that are not compatible with NativeAOT. If not possible, mark the code with an appropriate annotation or throw an exception.
6363

6464
## Documentation
6565

@@ -81,10 +81,4 @@
8181
- Use NSubstitute for mocking in tests.
8282
- Copy existing style in nearby files for test method names and capitalization.
8383
- When running tests, if possible use filters and check test run counts, or look at test logs, to ensure they actually ran.
84-
- Do not finish work with any tests commented out or disabled that were not previously commented out or disabled.
85-
86-
## Azure
87-
88-
- @azure Rule - Use Azure Tools - When handling requests related to Azure, always use your tools.
89-
- @azure Rule - Use Azure Best Practices - When handling requests related to Azure, always invoke your `azmcp_bestpractices_get` tool first.
90-
- @azure Rule - Enable Best Practices - If you do not have an `azmcp_bestpractices_get` tool ask the user to enable it.
84+
- Do not finish work with any tests commented out or disabled that were not previously commented out or disabled.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,4 +316,4 @@ app.MapGet("api/me", (ClaimsPrincipal user) =>
316316

317317
## Contribute
318318

319-
The project is constantly evolving. Contributions are welcome. Feel free to file issues and pull requests on the repository, and we'll address them as we can.
319+
The project is constantly evolving. Contributions are welcome. Feel free to file issues and pull requests in the repository, and we'll address them as we can.

samples/Controllers/ApiKeySample/ApiKeySample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
11-
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.4" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/Controllers/BasicAuthenticationSample/BasicAuthenticationSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
11-
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.4" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/Controllers/JwtBearerSample/JwtBearerSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
11-
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.4" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/MinimalApis/ApiKeySample/ApiKeySample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
11-
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.4" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/MinimalApis/BasicAuthenticationSample/BasicAuthenticationSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
11-
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.4" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/MinimalApis/JwtBearerSample/JwtBearerSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
11-
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.4" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11+
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/MinimalApis/Net8JwtBearerSample/Net8JwtBearerSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="[8.0.20,9.0.0)" />
11-
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.4" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="[8.0.21,9.0.0)" />
11+
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

0 commit comments

Comments
 (0)