Skip to content

Commit e04025f

Browse files
authored
8.0.0 (#18)
- net8.0 support added - Sample project for net8.0 added - BasicSamplesClient.http file added for testing sample projects - Readme updated - Updated codeqa-analysis.xml
1 parent e261423 commit e04025f

29 files changed

+496
-125
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
- name: Setup .NET Core SDK
3636
uses: actions/setup-dotnet@v1.9.0
3737
with:
38-
dotnet-version: 7.0.100
38+
dotnet-version: 8.x.x
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
42+
uses: github/codeql-action/init@v2
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
53+
uses: github/codeql-action/autobuild@v2
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
6464
# make release
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
67+
uses: github/codeql-action/analyze@v2

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Mihir Dilip
3+
Copyright (c) 2024 Mihir Dilip
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Easy to use and very light weight Microsoft style Basic Scheme Authentication Im
77

88
## .NET (Core) Frameworks Supported
99
.NET Framework 4.6.1 and/or NetStandard 2.0 onwards
10-
Multi targeted: net7.0; net6.0; net5.0; netcoreapp3.1; netcoreapp3.0; netstandard2.0; net461
10+
Multi targeted: net8.0; net7.0; net6.0; net5.0; netcoreapp3.1; netcoreapp3.0; netstandard2.0; net461
1111

1212
<br/>
1313

@@ -300,6 +300,7 @@ public void ConfigureServices(IServiceCollection services)
300300
## Release Notes
301301
| Version | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notes |
302302
|---------|-------|
303+
|8.0.0 | <ul><li>net8.0 support added</li><li>Sample project for net8.0 added</li><li>BasicSamplesClient.http file added for testing sample projects</li><li>Readme updated</li></ul> |
303304
|7.0.0 | <ul><li>net7.0 support added</li><li>Information log on handler is changed to Debug log when Authorization header is not found on the request</li><li>Added package validations</li><li>Sample project for net7.0 added</li><li>Readme updated</li><li>Readme added to package</li></ul> |
304305
|6.0.1 | <ul><li>net6.0 support added</li><li>Information log on handler is changed to Debug log when IgnoreAuthenticationIfAllowAnonymous is enabled [#9](https://github.com/mihirdilip/aspnetcore-authentication-basic/issues/9)</li><li>Sample project added</li><li>Readme updated</li><li>Copyright year updated on License</li></ul> |
305306
|5.1.0 | <ul><li>Visibility of the handler changed to public</li><li>Tests added</li><li>Readme updated</li><li>Copyright year updated on License</li></ul> |

samples/BasicSamplesClient.http

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@HostAddress = https://localhost:44304
2+
@BasicHash = VGVzdFVzZXIxOjEyMzQ=
3+
4+
# Get Values No Auth
5+
GET {{HostAddress}}/api/values
6+
Accept: application/json
7+
8+
###
9+
10+
# Get Values
11+
GET {{HostAddress}}/api/values
12+
Accept: application/json
13+
Authorization: Basic {{BasicHash}}
14+
15+
###
16+
17+
# Claims
18+
GET {{HostAddress}}/api/values/claims
19+
Accept: application/json
20+
Authorization: Basic {{BasicHash}}
21+
22+
###
23+
24+
# Forbid
25+
GET {{HostAddress}}/api/values/forbid
26+
Accept: application/json
27+
Authorization: Basic {{BasicHash}}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
namespace SampleWebApi.Models
1+
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
2+
namespace SampleWebApi.Models
23
{
34
/// <summary>
45
/// NOTE: DO NOT USE THIS IMPLEMENTATION. THIS IS FOR DEMO PURPOSE ONLY
56
/// </summary>
67
public class User
78
{
9+
810
public string Username { get; set; }
911
public string Password { get; set; }
1012
}
1113
}
14+
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

samples/SampleWebApi.Shared/Repositories/InMemoryUserRepository.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
#pragma warning disable CS8619 // Nullability of reference types in value doesn't match target type.
2+
using System.Collections.Generic;
23
using System.Linq;
34
using System.Threading.Tasks;
45
using SampleWebApi.Models;
@@ -10,7 +11,7 @@ namespace SampleWebApi.Repositories
1011
/// </summary>
1112
public class InMemoryUserRepository : IUserRepository
1213
{
13-
private List<User> _users = new List<User>
14+
private readonly List<User> _users = new List<User>
1415
{
1516
new User { Username = "TestUser1", Password = "1234" },
1617
new User { Username = "TestUser2", Password = "1234" },
@@ -30,3 +31,4 @@ public Task<IEnumerable<User>> GetUsers()
3031
}
3132
}
3233
}
34+
#pragma warning restore CS8619 // Nullability of reference types in value doesn't match target type.

samples/SampleWebApi_2_0/SampleWebApi_2_0.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
6+
<NuGetAudit>false</NuGetAudit>
57
</PropertyGroup>
68

79
<ItemGroup>

samples/SampleWebApi_2_2/SampleWebApi_2_2.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
6+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
7+
<NuGetAudit>false</NuGetAudit>
68
</PropertyGroup>
79

810
<ItemGroup>

samples/SampleWebApi_3_1/SampleWebApi_3_1.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
56
</PropertyGroup>
67

78
<Import Project="..\SampleWebApi.Shared\SampleWebApi.Shared.projitems" Label="Shared" />

samples/SampleWebApi_5_0/SampleWebApi_5_0.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net5.0</TargetFramework>
5+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
56
</PropertyGroup>
67

78
<Import Project="..\SampleWebApi.Shared\SampleWebApi.Shared.projitems" Label="Shared" />

0 commit comments

Comments
 (0)