Adding gitea runner and microservices
This commit is contained in:
parent
337e26c4ed
commit
1d1bb1bf4f
0
.gitignore → game/.gitignore
vendored
0
.gitignore → game/.gitignore
vendored
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 995 B After Width: | Height: | Size: 995 B |
18
gitea/workflows/k8s-smoke-test.yml
Normal file
18
gitea/workflows/k8s-smoke-test.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: k8s smoke test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Test kubectl connectivity
|
||||||
|
run: |
|
||||||
|
kubectl --kubeconfig ${{ secrets.KUBECONFIG }} get nodes
|
||||||
14
microservices/.gitignore
vendored
Normal file
14
microservices/.gitignore
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# ---> VisualStudioCode
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/*.code-snippets
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Built Visual Studio Code Extensions
|
||||||
|
*.vsix
|
||||||
|
|
||||||
17
microservices/Auth/Auth.csproj
Normal file
17
microservices/Auth/Auth.csproj
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Bcrypt.Net-Next" Version="4.0.3" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.4" />
|
||||||
|
<PackageReference Include="MongoDB.Driver" Version="3.4.3" />
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
6
microservices/Auth/Auth.http
Normal file
6
microservices/Auth/Auth.http
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
@Auth_HostAddress = http://localhost:5279
|
||||||
|
|
||||||
|
GET {{Auth_HostAddress}}/weatherforecast/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
###
|
||||||
113
microservices/Auth/Controllers/AuthController.cs
Normal file
113
microservices/Auth/Controllers/AuthController.cs
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
using Auth.Models;
|
||||||
|
using Auth.Services;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Auth.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
public class AuthController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly UserService _users;
|
||||||
|
private readonly IConfiguration _cfg;
|
||||||
|
private readonly BlacklistService _blacklist;
|
||||||
|
|
||||||
|
public AuthController(UserService users, IConfiguration cfg, BlacklistService blacklist)
|
||||||
|
{
|
||||||
|
_users = users; _cfg = cfg; _blacklist = blacklist;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("register")]
|
||||||
|
public async Task<IActionResult> Register([FromBody] RegisterRequest req)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(req.Username) || string.IsNullOrWhiteSpace(req.Password))
|
||||||
|
return BadRequest("Username and password required");
|
||||||
|
|
||||||
|
if (await _users.GetByUsernameAsync(req.Username) != null)
|
||||||
|
return BadRequest("User already exists");
|
||||||
|
|
||||||
|
var hash = BCrypt.Net.BCrypt.HashPassword(req.Password);
|
||||||
|
var user = new User { Username = req.Username, PasswordHash = hash, Role = "USER", Email = req.Email };
|
||||||
|
await _users.CreateAsync(user);
|
||||||
|
return Ok("User created");
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("login")]
|
||||||
|
public async Task<IActionResult> Login([FromBody] LoginRequest req)
|
||||||
|
{
|
||||||
|
var user = await _users.GetByUsernameAsync(req.Username);
|
||||||
|
if (user == null || !BCrypt.Net.BCrypt.Verify(req.Password, user.PasswordHash))
|
||||||
|
return Unauthorized();
|
||||||
|
|
||||||
|
var (accessToken, jti, expUtc) = GenerateJwtToken(user);
|
||||||
|
user.RefreshToken = Guid.NewGuid().ToString("N");
|
||||||
|
user.RefreshTokenExpiry = DateTime.UtcNow.AddDays(7);
|
||||||
|
await _users.UpdateAsync(user);
|
||||||
|
|
||||||
|
return Ok(new { accessToken, refreshToken = user.RefreshToken, user.Username, user.Role, jti, exp = expUtc });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("refresh")]
|
||||||
|
public async Task<IActionResult> Refresh([FromBody] RefreshRequest req)
|
||||||
|
{
|
||||||
|
var user = await _users.GetByUsernameAsync(req.Username);
|
||||||
|
if (user == null || user.RefreshToken != req.RefreshToken || user.RefreshTokenExpiry < DateTime.UtcNow)
|
||||||
|
return Unauthorized("Invalid or expired refresh token");
|
||||||
|
|
||||||
|
var (accessToken, _, expUtc) = GenerateJwtToken(user);
|
||||||
|
return Ok(new { accessToken, exp = expUtc });
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("logout")]
|
||||||
|
[Authorize(Roles = "USER,SUPER")]
|
||||||
|
public async Task<IActionResult> Logout()
|
||||||
|
{
|
||||||
|
var token = HttpContext.Request.Headers["Authorization"].FirstOrDefault()?.Replace("Bearer ", "");
|
||||||
|
if (string.IsNullOrWhiteSpace(token)) return BadRequest("Token missing");
|
||||||
|
var jwt = new JwtSecurityTokenHandler().ReadJwtToken(token);
|
||||||
|
await _blacklist.AddToBlacklistAsync(jwt.Id, jwt.ValidTo);
|
||||||
|
return Ok("Logged out.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("role")]
|
||||||
|
[Authorize(Roles = "SUPER")]
|
||||||
|
public async Task<IActionResult> ChangeUserRole([FromBody] ChangeRoleRequest req)
|
||||||
|
{
|
||||||
|
if (req.NewRole is not ("USER" or "SUPER")) return BadRequest("Role must be 'USER' or 'SUPER'");
|
||||||
|
var user = await _users.GetByUsernameAsync(req.Username);
|
||||||
|
if (user is null) return NotFound("User not found");
|
||||||
|
user.Role = req.NewRole;
|
||||||
|
await _users.UpdateAsync(user);
|
||||||
|
return Ok($"{req.Username}'s role updated to {req.NewRole}");
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("users")]
|
||||||
|
[Authorize(Roles = "SUPER")]
|
||||||
|
public async Task<IActionResult> GetAllUsers() => Ok(await _users.GetAllAsync());
|
||||||
|
|
||||||
|
private (string token, string jti, DateTime expUtc) GenerateJwtToken(User user)
|
||||||
|
{
|
||||||
|
var key = Encoding.UTF8.GetBytes(_cfg["Jwt:Key"]!);
|
||||||
|
var issuer = _cfg["Jwt:Issuer"] ?? "GameAuthApi";
|
||||||
|
var audience = _cfg["Jwt:Audience"] ?? issuer;
|
||||||
|
|
||||||
|
var creds = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256);
|
||||||
|
var jti = Guid.NewGuid().ToString("N");
|
||||||
|
var claims = new[]
|
||||||
|
{
|
||||||
|
new Claim(ClaimTypes.Name, user.Username),
|
||||||
|
new Claim(ClaimTypes.NameIdentifier, user.Id),
|
||||||
|
new Claim(ClaimTypes.Role, user.Role),
|
||||||
|
new Claim(JwtRegisteredClaimNames.Jti, jti)
|
||||||
|
};
|
||||||
|
|
||||||
|
var exp = DateTime.UtcNow.AddMinutes(15);
|
||||||
|
var token = new JwtSecurityToken(issuer, audience, claims, expires: exp, signingCredentials: creds);
|
||||||
|
return (new JwtSecurityTokenHandler().WriteToken(token), jti, exp);
|
||||||
|
}
|
||||||
|
}
|
||||||
21
microservices/Auth/Dockerfile
Normal file
21
microservices/Auth/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Copy project file first to take advantage of Docker layer caching
|
||||||
|
COPY ["Auth.csproj", "./"]
|
||||||
|
RUN dotnet restore "Auth.csproj"
|
||||||
|
|
||||||
|
# Copy the remaining source and publish
|
||||||
|
COPY . .
|
||||||
|
RUN dotnet publish "Auth.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/publish .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS=http://+:8080 \
|
||||||
|
ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "Auth.dll"]
|
||||||
6
microservices/Auth/Models/Dto.cs
Normal file
6
microservices/Auth/Models/Dto.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Auth.Models;
|
||||||
|
|
||||||
|
public class RegisterRequest { public string Username { get; set; } = ""; public string Password { get; set; } = ""; public string? Email { get; set; } }
|
||||||
|
public class LoginRequest { public string Username { get; set; } = ""; public string Password { get; set; } = ""; }
|
||||||
|
public class ChangeRoleRequest { public string Username { get; set; } = ""; public string NewRole { get; set; } = ""; }
|
||||||
|
public class RefreshRequest { public string Username { get; set; } = ""; public string RefreshToken { get; set; } = ""; }
|
||||||
16
microservices/Auth/Models/User.cs
Normal file
16
microservices/Auth/Models/User.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using MongoDB.Bson;
|
||||||
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
|
|
||||||
|
namespace Auth.Models;
|
||||||
|
|
||||||
|
public class User
|
||||||
|
{
|
||||||
|
[BsonId] [BsonRepresentation(BsonType.ObjectId)]
|
||||||
|
public string Id { get; set; } = default!;
|
||||||
|
public string Username { get; set; } = default!;
|
||||||
|
public string PasswordHash { get; set; } = default!;
|
||||||
|
public string Role { get; set; } = "USER";
|
||||||
|
public string? Email { get; set; }
|
||||||
|
public string? RefreshToken { get; set; }
|
||||||
|
public DateTime? RefreshTokenExpiry { get; set; }
|
||||||
|
}
|
||||||
86
microservices/Auth/Program.cs
Normal file
86
microservices/Auth/Program.cs
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
using Auth.Services;
|
||||||
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
|
||||||
|
// DI
|
||||||
|
builder.Services.AddSingleton<UserService>();
|
||||||
|
builder.Services.AddSingleton<BlacklistService>();
|
||||||
|
|
||||||
|
// Swagger + JWT auth in Swagger
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
builder.Services.AddSwaggerGen(c =>
|
||||||
|
{
|
||||||
|
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Auth API", Version = "v1" });
|
||||||
|
c.AddSecurityDefinition("bearerAuth", new OpenApiSecurityScheme
|
||||||
|
{
|
||||||
|
Type = SecuritySchemeType.Http,
|
||||||
|
Scheme = "bearer",
|
||||||
|
BearerFormat = "JWT",
|
||||||
|
Description = "Paste your access token here (no 'Bearer ' prefix needed)."
|
||||||
|
});
|
||||||
|
c.AddSecurityRequirement(new OpenApiSecurityRequirement
|
||||||
|
{
|
||||||
|
{
|
||||||
|
new OpenApiSecurityScheme
|
||||||
|
{
|
||||||
|
Reference = new OpenApiReference
|
||||||
|
{ Type = ReferenceType.SecurityScheme, Id = "bearerAuth" }
|
||||||
|
},
|
||||||
|
Array.Empty<string>()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// AuthN/JWT
|
||||||
|
var cfg = builder.Configuration;
|
||||||
|
var jwtKey = cfg["Jwt:Key"] ?? throw new Exception("Jwt:Key missing");
|
||||||
|
var issuer = cfg["Jwt:Issuer"] ?? "GameAuthApi";
|
||||||
|
var aud = cfg["Jwt:Audience"] ?? issuer;
|
||||||
|
|
||||||
|
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||||
|
.AddJwtBearer(o =>
|
||||||
|
{
|
||||||
|
o.TokenValidationParameters = new TokenValidationParameters
|
||||||
|
{
|
||||||
|
ValidateIssuer = true, ValidIssuer = issuer,
|
||||||
|
ValidateAudience = true, ValidAudience = aud,
|
||||||
|
ValidateIssuerSigningKey = true,
|
||||||
|
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtKey)),
|
||||||
|
ValidateLifetime = true,
|
||||||
|
ClockSkew = TimeSpan.FromSeconds(30)
|
||||||
|
};
|
||||||
|
o.Events = new JwtBearerEvents
|
||||||
|
{
|
||||||
|
OnTokenValidated = async ctx =>
|
||||||
|
{
|
||||||
|
var jti = ctx.Principal?.FindFirstValue(System.IdentityModel.Tokens.Jwt.JwtRegisteredClaimNames.Jti);
|
||||||
|
if (!string.IsNullOrEmpty(jti))
|
||||||
|
{
|
||||||
|
var bl = ctx.HttpContext.RequestServices.GetRequiredService<BlacklistService>();
|
||||||
|
if (await bl.IsBlacklistedAsync(jti)) ctx.Fail("Token revoked");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Services.AddAuthorization();
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
app.MapGet("/healthz", () => Results.Ok("ok"));
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI(o =>
|
||||||
|
{
|
||||||
|
o.SwaggerEndpoint("/swagger/v1/swagger.json", "Auth API v1");
|
||||||
|
o.RoutePrefix = "swagger";
|
||||||
|
});
|
||||||
|
app.UseAuthentication();
|
||||||
|
app.UseAuthorization();
|
||||||
|
app.MapControllers();
|
||||||
|
app.Run();
|
||||||
23
microservices/Auth/Properties/launchSettings.json
Normal file
23
microservices/Auth/Properties/launchSettings.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||||
|
"profiles": {
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": false,
|
||||||
|
"applicationUrl": "http://localhost:5279",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": false,
|
||||||
|
"applicationUrl": "https://localhost:7295;http://localhost:5279",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
microservices/Auth/Services/BlacklistService.cs
Normal file
36
microservices/Auth/Services/BlacklistService.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
|
using MongoDB.Driver;
|
||||||
|
|
||||||
|
namespace Auth.Services;
|
||||||
|
|
||||||
|
public class BlacklistedToken
|
||||||
|
{
|
||||||
|
[BsonId] public string Jti { get; set; } = default!;
|
||||||
|
public DateTime ExpiresAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BlacklistService
|
||||||
|
{
|
||||||
|
private readonly IMongoCollection<BlacklistedToken> _col;
|
||||||
|
|
||||||
|
public BlacklistService(IConfiguration cfg)
|
||||||
|
{
|
||||||
|
var cs = cfg["MongoDB:ConnectionString"] ?? "mongodb://127.0.0.1:27017";
|
||||||
|
var dbName = cfg["MongoDB:DatabaseName"] ?? "GameDb";
|
||||||
|
var client = new MongoClient(cs);
|
||||||
|
var db = client.GetDatabase(dbName);
|
||||||
|
_col = db.GetCollection<BlacklistedToken>("BlacklistedTokens");
|
||||||
|
|
||||||
|
// TTL index so revocations expire automatically
|
||||||
|
var keys = Builders<BlacklistedToken>.IndexKeys.Ascending(x => x.ExpiresAt);
|
||||||
|
_col.Indexes.CreateOne(new CreateIndexModel<BlacklistedToken>(keys, new CreateIndexOptions { ExpireAfter = TimeSpan.Zero }));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task AddToBlacklistAsync(string jti, DateTime expiresAt) =>
|
||||||
|
_col.ReplaceOneAsync(x => x.Jti == jti,
|
||||||
|
new BlacklistedToken { Jti = jti, ExpiresAt = expiresAt },
|
||||||
|
new ReplaceOptions { IsUpsert = true });
|
||||||
|
|
||||||
|
public Task<bool> IsBlacklistedAsync(string jti) =>
|
||||||
|
_col.Find(x => x.Jti == jti).AnyAsync();
|
||||||
|
}
|
||||||
32
microservices/Auth/Services/UserService.cs
Normal file
32
microservices/Auth/Services/UserService.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
using Auth.Models;
|
||||||
|
using MongoDB.Driver;
|
||||||
|
|
||||||
|
namespace Auth.Services;
|
||||||
|
|
||||||
|
public class UserService
|
||||||
|
{
|
||||||
|
private readonly IMongoCollection<User> _col;
|
||||||
|
|
||||||
|
public UserService(IConfiguration cfg)
|
||||||
|
{
|
||||||
|
var cs = cfg["MongoDB:ConnectionString"] ?? "mongodb://127.0.0.1:27017";
|
||||||
|
var dbName = cfg["MongoDB:DatabaseName"] ?? "GameDb";
|
||||||
|
var client = new MongoClient(cs);
|
||||||
|
var db = client.GetDatabase(dbName);
|
||||||
|
_col = db.GetCollection<User>("Users");
|
||||||
|
|
||||||
|
var keys = Builders<User>.IndexKeys.Ascending(u => u.Username);
|
||||||
|
_col.Indexes.CreateOne(new CreateIndexModel<User>(keys, new CreateIndexOptions { Unique = true }));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<User?> GetByUsernameAsync(string username) =>
|
||||||
|
_col.Find(u => u.Username == username).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
public Task CreateAsync(User user) => _col.InsertOneAsync(user);
|
||||||
|
|
||||||
|
public Task UpdateAsync(User user) =>
|
||||||
|
_col.ReplaceOneAsync(u => u.Id == user.Id, user);
|
||||||
|
|
||||||
|
public Task<List<User>> GetAllAsync() =>
|
||||||
|
_col.Find(FilterDefinition<User>.Empty).ToListAsync();
|
||||||
|
}
|
||||||
8
microservices/Auth/appsettings.Development.json
Normal file
8
microservices/Auth/appsettings.Development.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
microservices/Auth/appsettings.json
Normal file
7
microservices/Auth/appsettings.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"Kestrel": { "Endpoints": { "Http": { "Url": "http://0.0.0.0:5000" } } },
|
||||||
|
"MongoDB": { "ConnectionString": "mongodb://192.168.86.50:27017", "DatabaseName": "GameDb" },
|
||||||
|
"Jwt": { "Key": "SuperUltraSecureJwtKeyWithAtLeast32Chars!!", "Issuer": "GameAuthApi", "Audience": "game-auth-api" },
|
||||||
|
"Logging": { "LogLevel": { "Default": "Information" } },
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
||||||
88
microservices/Auth/obj/Auth.csproj.nuget.dgspec.json
Normal file
88
microservices/Auth/obj/Auth.csproj.nuget.dgspec.json
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"format": 1,
|
||||||
|
"restore": {
|
||||||
|
"C:\\Users\\hz-vm\\Desktop\\micro-services\\Auth\\Auth.csproj": {}
|
||||||
|
},
|
||||||
|
"projects": {
|
||||||
|
"C:\\Users\\hz-vm\\Desktop\\micro-services\\Auth\\Auth.csproj": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"restore": {
|
||||||
|
"projectUniqueName": "C:\\Users\\hz-vm\\Desktop\\micro-services\\Auth\\Auth.csproj",
|
||||||
|
"projectName": "Auth",
|
||||||
|
"projectPath": "C:\\Users\\hz-vm\\Desktop\\micro-services\\Auth\\Auth.csproj",
|
||||||
|
"packagesPath": "C:\\Users\\hz-vm\\.nuget\\packages\\",
|
||||||
|
"outputPath": "C:\\Users\\hz-vm\\Desktop\\micro-services\\Auth\\obj\\",
|
||||||
|
"projectStyle": "PackageReference",
|
||||||
|
"configFilePaths": [
|
||||||
|
"C:\\Users\\hz-vm\\AppData\\Roaming\\NuGet\\NuGet.Config"
|
||||||
|
],
|
||||||
|
"originalTargetFrameworks": [
|
||||||
|
"net9.0"
|
||||||
|
],
|
||||||
|
"sources": {
|
||||||
|
"https://api.nuget.org/v3/index.json": {}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"net9.0": {
|
||||||
|
"targetAlias": "net9.0",
|
||||||
|
"projectReferences": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"warningProperties": {
|
||||||
|
"warnAsError": [
|
||||||
|
"NU1605"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"restoreAuditProperties": {
|
||||||
|
"enableAudit": "true",
|
||||||
|
"auditLevel": "low",
|
||||||
|
"auditMode": "direct"
|
||||||
|
},
|
||||||
|
"SdkAnalysisLevel": "9.0.200"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"net9.0": {
|
||||||
|
"targetAlias": "net9.0",
|
||||||
|
"dependencies": {
|
||||||
|
"Bcrypt.Net-Next": {
|
||||||
|
"target": "Package",
|
||||||
|
"version": "[4.0.3, )"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.Authentication.JwtBearer": {
|
||||||
|
"target": "Package",
|
||||||
|
"version": "[9.0.8, )"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.OpenApi": {
|
||||||
|
"target": "Package",
|
||||||
|
"version": "[9.0.4, )"
|
||||||
|
},
|
||||||
|
"MongoDB.Driver": {
|
||||||
|
"target": "Package",
|
||||||
|
"version": "[3.4.3, )"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"imports": [
|
||||||
|
"net461",
|
||||||
|
"net462",
|
||||||
|
"net47",
|
||||||
|
"net471",
|
||||||
|
"net472",
|
||||||
|
"net48",
|
||||||
|
"net481"
|
||||||
|
],
|
||||||
|
"assetTargetFallback": true,
|
||||||
|
"warn": true,
|
||||||
|
"frameworkReferences": {
|
||||||
|
"Microsoft.AspNetCore.App": {
|
||||||
|
"privateAssets": "none"
|
||||||
|
},
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"privateAssets": "all"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.203/PortableRuntimeIdentifierGraph.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
microservices/Auth/obj/Auth.csproj.nuget.g.props
Normal file
15
microservices/Auth/obj/Auth.csproj.nuget.g.props
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||||
|
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||||
|
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||||
|
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||||
|
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||||
|
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\hz-vm\.nuget\packages\</NuGetPackageFolders>
|
||||||
|
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||||
|
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.2</NuGetToolVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||||
|
<SourceRoot Include="C:\Users\hz-vm\.nuget\packages\" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
2
microservices/Auth/obj/Auth.csproj.nuget.g.targets
Normal file
2
microservices/Auth/obj/Auth.csproj.nuget.g.targets
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||||
1101
microservices/Auth/obj/project.assets.json
Normal file
1101
microservices/Auth/obj/project.assets.json
Normal file
File diff suppressed because it is too large
Load Diff
34
microservices/Auth/obj/project.nuget.cache
Normal file
34
microservices/Auth/obj/project.nuget.cache
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"dgSpecHash": "eAAcl+OtbvI=",
|
||||||
|
"success": true,
|
||||||
|
"projectFilePath": "C:\\Users\\hz-vm\\Desktop\\micro-services\\Auth\\Auth.csproj",
|
||||||
|
"expectedPackageFiles": [
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\bcrypt.net-next\\4.0.3\\bcrypt.net-next.4.0.3.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\dnsclient\\1.6.1\\dnsclient.1.6.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.aspnetcore.authentication.jwtbearer\\9.0.8\\microsoft.aspnetcore.authentication.jwtbearer.9.0.8.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.aspnetcore.openapi\\9.0.4\\microsoft.aspnetcore.openapi.9.0.4.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\2.0.0\\microsoft.extensions.logging.abstractions.2.0.0.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.identitymodel.abstractions\\8.0.1\\microsoft.identitymodel.abstractions.8.0.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\8.0.1\\microsoft.identitymodel.jsonwebtokens.8.0.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.identitymodel.logging\\8.0.1\\microsoft.identitymodel.logging.8.0.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.identitymodel.protocols\\8.0.1\\microsoft.identitymodel.protocols.8.0.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.identitymodel.protocols.openidconnect\\8.0.1\\microsoft.identitymodel.protocols.openidconnect.8.0.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.identitymodel.tokens\\8.0.1\\microsoft.identitymodel.tokens.8.0.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.netcore.platforms\\5.0.0\\microsoft.netcore.platforms.5.0.0.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.openapi\\1.6.17\\microsoft.openapi.1.6.17.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\mongodb.bson\\3.4.3\\mongodb.bson.3.4.3.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\mongodb.driver\\3.4.3\\mongodb.driver.3.4.3.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\sharpcompress\\0.30.1\\sharpcompress.0.30.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\snappier\\1.0.0\\snappier.1.0.0.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\system.identitymodel.tokens.jwt\\8.0.1\\system.identitymodel.tokens.jwt.8.0.1.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512",
|
||||||
|
"C:\\Users\\hz-vm\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512"
|
||||||
|
],
|
||||||
|
"logs": []
|
||||||
|
}
|
||||||
2
microservices/README.md
Normal file
2
microservices/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# micro-services
|
||||||
|
|
||||||
24
microservices/micro-services.sln
Normal file
24
microservices/micro-services.sln
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.5.2.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Auth", "Auth\Auth.csproj", "{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {F82C87CC-7411-493D-A138-491A81FBCC32}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
Loading…
x
Reference in New Issue
Block a user