-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new Account Service, Migrated all projects to dotnet 8, updated…
… all dependencies.
- Loading branch information
Showing
35 changed files
with
857 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/.idea | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\basvd\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_Netmon.1481318327\Snapshot\snapshot.utdcvr</s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=e0a1c0c7_002Df1b5_002D473d_002D9b32_002Db8cc2963f373/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="GetPrivacyProvider_ShouldReturnAES192PrivacyProvider_WhenAES192ProtocolIsSelected" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<Or>
 | ||
<TestAncestor>
 | ||
<TestId>NUnit3x::7F1D3097-C146-466F-8738-9C5AD15BC72A::net8.0::Netmon.SNMPPolling.SNMP.UnitTests.Security.PrivacyProviderTests.GetPrivacyProvider_ShouldReturnAES192PrivacyProvider_WhenAES192ProtocolIsSelected</TestId>
 | ||
</TestAncestor>
 | ||
<Project Location="G:\School Projects\Netmon\Tests\Netmon.SNMPPolling.IntegrationTests" Presentation="&lt;Netmon.SNMPPolling.IntegrationTests&gt;" />
 | ||
<Project Location="G:\School Projects\Netmon\Tests\Netmon.SNMPPolling.SNMP.UnitTests" Presentation="&lt;Netmon.SNMPPolling.SNMP.UnitTests&gt;" />
 | ||
</Or>
 | ||
</SessionState></s:String> | ||
|
||
|
||
|
||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=9b8a4c9e_002D5f16_002D474d_002D9068_002D5d039104f6f6/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="Get_EndpointsReturnSuccessAndCorrectContentType" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<Project Location="D:\School\Software\Semester 3\Netmon\Tests\Netmon.SNMPPolling.UnitTests" Presentation="&lt;Netmon.SNMPPolling.UnitTests&gt;" />
 | ||
</SessionState></s:String></wpf:ResourceDictionary> | ||
</wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<DockerDefaultTargetOS>Windows</DockerDefaultTargetOS> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" /> | ||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.2" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.11"> | ||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.1" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.15" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.15"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
USER $APP_UID | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Services/Netmon.AccountService/Netmon.AccountService.csproj", "Services/Netmon.AccountService/"] | ||
RUN dotnet restore "Services/Netmon.AccountService/Netmon.AccountService.csproj" | ||
COPY . . | ||
WORKDIR "/src/Services/Netmon.AccountService" | ||
RUN dotnet build "Netmon.AccountService.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Netmon.AccountService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "Netmon.AccountService.dll"] |
234 changes: 234 additions & 0 deletions
234
Services/Netmon.AccountService/Migrations/20240113160234_Initial.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using MySql.EntityFrameworkCore.Metadata; | ||
using Netmon.Identity; | ||
|
||
#nullable disable | ||
|
||
namespace Netmon.AccountService.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class Initial : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AlterDatabase() | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "AspNetRoles", | ||
columns: table => new | ||
{ | ||
Id = table.Column<string>(type: "varchar(255)", nullable: false), | ||
Name = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true), | ||
NormalizedName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true), | ||
ConcurrencyStamp = table.Column<string>(type: "longtext", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_AspNetRoles", x => x.Id); | ||
}) | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "AspNetUsers", | ||
columns: table => new | ||
{ | ||
Id = table.Column<string>(type: "varchar(255)", nullable: false), | ||
UserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true), | ||
NormalizedUserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true), | ||
Email = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true), | ||
NormalizedEmail = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true), | ||
EmailConfirmed = table.Column<bool>(type: "tinyint(1)", nullable: false), | ||
PasswordHash = table.Column<string>(type: "longtext", nullable: true), | ||
SecurityStamp = table.Column<string>(type: "longtext", nullable: true), | ||
ConcurrencyStamp = table.Column<string>(type: "longtext", nullable: true), | ||
PhoneNumber = table.Column<string>(type: "longtext", nullable: true), | ||
PhoneNumberConfirmed = table.Column<bool>(type: "tinyint(1)", nullable: false), | ||
TwoFactorEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), | ||
LockoutEnd = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true), | ||
LockoutEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), | ||
AccessFailedCount = table.Column<int>(type: "int", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_AspNetUsers", x => x.Id); | ||
}) | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "AspNetRoleClaims", | ||
columns: table => new | ||
{ | ||
Id = table.Column<int>(type: "int", nullable: false) | ||
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn), | ||
RoleId = table.Column<string>(type: "varchar(255)", nullable: false), | ||
ClaimType = table.Column<string>(type: "longtext", nullable: true), | ||
ClaimValue = table.Column<string>(type: "longtext", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", | ||
column: x => x.RoleId, | ||
principalTable: "AspNetRoles", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}) | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "AspNetUserClaims", | ||
columns: table => new | ||
{ | ||
Id = table.Column<int>(type: "int", nullable: false) | ||
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn), | ||
UserId = table.Column<string>(type: "varchar(255)", nullable: false), | ||
ClaimType = table.Column<string>(type: "longtext", nullable: true), | ||
ClaimValue = table.Column<string>(type: "longtext", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_AspNetUserClaims_AspNetUsers_UserId", | ||
column: x => x.UserId, | ||
principalTable: "AspNetUsers", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}) | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "AspNetUserLogins", | ||
columns: table => new | ||
{ | ||
LoginProvider = table.Column<string>(type: "varchar(255)", nullable: false), | ||
ProviderKey = table.Column<string>(type: "varchar(255)", nullable: false), | ||
ProviderDisplayName = table.Column<string>(type: "longtext", nullable: true), | ||
UserId = table.Column<string>(type: "varchar(255)", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); | ||
table.ForeignKey( | ||
name: "FK_AspNetUserLogins_AspNetUsers_UserId", | ||
column: x => x.UserId, | ||
principalTable: "AspNetUsers", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}) | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "AspNetUserRoles", | ||
columns: table => new | ||
{ | ||
UserId = table.Column<string>(type: "varchar(255)", nullable: false), | ||
RoleId = table.Column<string>(type: "varchar(255)", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); | ||
table.ForeignKey( | ||
name: "FK_AspNetUserRoles_AspNetRoles_RoleId", | ||
column: x => x.RoleId, | ||
principalTable: "AspNetRoles", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
table.ForeignKey( | ||
name: "FK_AspNetUserRoles_AspNetUsers_UserId", | ||
column: x => x.UserId, | ||
principalTable: "AspNetUsers", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}) | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "AspNetUserTokens", | ||
columns: table => new | ||
{ | ||
UserId = table.Column<string>(type: "varchar(255)", nullable: false), | ||
LoginProvider = table.Column<string>(type: "varchar(255)", nullable: false), | ||
Name = table.Column<string>(type: "varchar(255)", nullable: false), | ||
Value = table.Column<string>(type: "longtext", nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); | ||
table.ForeignKey( | ||
name: "FK_AspNetUserTokens_AspNetUsers_UserId", | ||
column: x => x.UserId, | ||
principalTable: "AspNetUsers", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Cascade); | ||
}) | ||
.Annotation("MySQL:Charset", "utf8mb4"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_AspNetRoleClaims_RoleId", | ||
table: "AspNetRoleClaims", | ||
column: "RoleId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "RoleNameIndex", | ||
table: "AspNetRoles", | ||
column: "NormalizedName", | ||
unique: true); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_AspNetUserClaims_UserId", | ||
table: "AspNetUserClaims", | ||
column: "UserId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_AspNetUserLogins_UserId", | ||
table: "AspNetUserLogins", | ||
column: "UserId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_AspNetUserRoles_RoleId", | ||
table: "AspNetUserRoles", | ||
column: "RoleId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "EmailIndex", | ||
table: "AspNetUsers", | ||
column: "NormalizedEmail"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "UserNameIndex", | ||
table: "AspNetUsers", | ||
column: "NormalizedUserName", | ||
unique: true); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "AspNetRoleClaims"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "AspNetUserClaims"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "AspNetUserLogins"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "AspNetUserRoles"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "AspNetUserTokens"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "AspNetRoles"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "AspNetUsers"); | ||
} | ||
} | ||
} |
Oops, something went wrong.