Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore --property NuGetAudit=true --property NuGetAuditMode=All --property NuGetAuditLevel=Moderate
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Generate Package
run: |
dotnet clean -c Release
Expand Down
10 changes: 3 additions & 7 deletions samples/SourceApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddOpenApiDocument();

// Add the cache options
builder.Services.AddMemoryCache();
Expand Down Expand Up @@ -71,12 +71,8 @@
.ConfigureHttpClient(c => c.BaseAddress = new Uri("http://localhost:5121"));

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseOpenApi();
app.UseSwaggerUi();

app.MapGet("/test/TargetApiWithNoInterceptor", async (IHttpClientFactory factory) =>
{
Expand Down
11 changes: 5 additions & 6 deletions samples/SourceApi/SourceApi.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="9.8.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.0" />
<PackageReference Include="NSwag.AspNetCore" Version="14.6.3" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 6 additions & 14 deletions samples/TargetApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Text.Json.Serialization;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddOpenApiDocument();
builder.Services.AddSingleton(new UserContainer());

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseOpenApi();
app.UseSwaggerUi();

app.MapPost("/auth", (UserContainer users, ILoggerFactory loggerFactory) =>
{
Expand All @@ -33,8 +28,7 @@
users.Users.Add(user);
return user;
})
.WithName("auth")
.WithOpenApi();
.WithName("auth");

app.MapPost("/refresh", (UserContainer users, [FromQuery] string refresh, ILoggerFactory loggerFactory) =>
{
Expand All @@ -61,8 +55,7 @@
users.Users.Add(user);
return Results.Ok(user);
})
.WithName("refresh")
.WithOpenApi();
.WithName("refresh");

app.MapGet("/data", (HttpRequest request, UserContainer users, ILoggerFactory loggerFactory, [FromHeader(Name = "Authorization")] string? token = null) =>
{
Expand All @@ -78,8 +71,7 @@

return Results.Ok();
})
.WithName("data")
.WithOpenApi();
.WithName("data");


app.Run();
Expand Down
5 changes: 2 additions & 3 deletions samples/TargetApi/TargetApi.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="NSwag.AspNetCore" Version="14.6.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.9" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="9.9.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="10.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AuthorizationInterceptor.Extensions.Abstractions\AuthorizationInterceptor.Extensions.Abstractions.csproj" />
Expand Down
10 changes: 7 additions & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<LangVersion>13</LangVersion>
<LangVersion>14</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>5.2.0</Version>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<Version>5.3.0</Version>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
<Title>Authorization Interceptor</Title>
<Authors>Adolfok3</Authors>
<Copyright>MIT</Copyright>
Expand Down Expand Up @@ -41,6 +41,10 @@
<None Include="./README.md" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0' And '$(IsCachingAbstractionsTargeted)' == 'true'">
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0' And '$(IsCachingAbstractionsTargeted)' == 'true'">
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.9" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<PropertyGroup>
<LangVersion>13</LangVersion>
<LangVersion>14</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Loading