Skip to content

Commit

Permalink
0.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shps951023 committed Jun 30, 2024
1 parent 1ef2471 commit c868157
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/MiniAuth.IdentityAuth/MiniAuth.IdentityAuth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyName>MiniAuth</AssemblyName>
<Title>MiniAuth</Title>
<Version>0.10.0</Version>
<Version>0.10.1</Version>
<Description>"One-line code" adds identity management web for your new/old projects</Description>
<Authors>Wei Lin, mini-software</Authors>
<PackageTags>MiniAuth</PackageTags>
Expand Down
8 changes: 4 additions & 4 deletions tests/TestBearer/TestBearer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class Program
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);

MiniAuthOptions.AuthenticationType = MiniAuthOptions.AuthType.BearerJwt;
MiniAuthOptions.JWTKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("6ee3edbf-488e-4484-9c2c-e3ffa6dcbc09"));
builder.Services.AddMiniAuth();
builder.Services.AddMiniAuth(options:(options)=> {
options.AuthenticationType = AuthType.BearerJwt;
options.JWTKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("6ee3edbf-488e-4484-9c2c-e3ffa6dcbc09"));
});

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
Expand Down
13 changes: 13 additions & 0 deletions tests/TestCookieApi/TestCookieApi/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.6",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
14 changes: 6 additions & 8 deletions tests/TestCookieApi/TestCookieApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ public static void Main(string[] args)
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMiniAuth();
var app = builder.Build();


app.MapGet("/", () => "Hello World!")
.RequireAuthorization()
;
app.MapGet("/test/admin", () => "Is miniauth-admin!")
.RequireAuthorization(
new AuthorizeAttribute() { Roles = "miniauth-admin" })
app.MapGet("/", () =>
{
return Results.Redirect("/miniauth/index.html");
});
app.MapGet("/admin", () => "Is miniauth-admin!")
.RequireAuthorization(new AuthorizeAttribute() { Roles = "miniauth-admin" })
;
app.Run();
}
Expand Down

0 comments on commit c868157

Please sign in to comment.