Release v1.0.0 #16

Merged
Wesser merged 492 commits from release/v1.0.0 into master 2025-02-12 09:19:32 +03:00
282 changed files with 14713 additions and 99 deletions
Showing only changes of commit c12323dc29 - Show all commits
.editorconfig.env
.gitea/workflows
.gitignore
ApiDto
Backend.slnDockerfile
Endpoint
Backend.http
Common
Configuration
Controllers
Endpoint.csprojProgram.cs
Sync
WeatherForecast.cs
wwwroot/css/swagger
README.md
Security
SqlData
Application
Application.csproj
Common
Cqrs
DependencyInjection.cs
Interfaces/DbContexts
Domain
Migrations
Persistence
nuget.config

@ -26,14 +26,14 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
private static string GetFirstAuthCacheKey(string fingerprint) => $"{fingerprint}_auth_token_first";
private static string GetAttemptFailedCountKey(string fingerprint) => $"{fingerprint}_login_failed";
private Task SetAuthTokenDataToCache(AuthToken data, CancellationToken cancellation) =>
private Task StoreAuthTokenInCache(AuthToken data, CancellationToken cancellation) =>
cache.SetAsync(
GetAuthCacheKey(data.Fingerprint),
JsonSerializer.SerializeToUtf8Bytes(data),
slidingExpiration: Lifetime,
cancellationToken: cancellation);
private Task CreateFirstAuthTokenToCache(User data, RequestContextInfo requestContext, CancellationToken cancellation) =>
private Task StoreFirstAuthTokenInCache(User data, RequestContextInfo requestContext, CancellationToken cancellation) =>
cache.SetAsync(
GetFirstAuthCacheKey(requestContext.Fingerprint),
JsonSerializer.SerializeToUtf8Bytes(new FirstAuthToken(requestContext)
@ -106,7 +106,7 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
AccessToken = token
};
await SetAuthTokenDataToCache(authToken, cancellation);
await StoreAuthTokenInCache(authToken, cancellation);
cookieOptions.SetCookie(context, CookieNames.AccessToken, authToken.AccessToken, expireIn);
cookieOptions.SetCookie(context, CookieNames.RefreshToken, authToken.RefreshToken, DateTime.UtcNow.Add(Lifetime));
@ -126,7 +126,7 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
return TwoFactorAuthenticator.None;
}
await CreateFirstAuthTokenToCache(user, requestContext, cancellation);
await StoreFirstAuthTokenInCache(user, requestContext, cancellation);
return user.TwoFactorAuthenticator;
}
@ -173,7 +173,7 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
return TwoFactorAuthenticator.None;
}
await CreateFirstAuthTokenToCache(user, requestContext, cancellation);
await StoreFirstAuthTokenInCache(user, requestContext, cancellation);
return user.TwoFactorAuthenticator;
}
@ -211,7 +211,7 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I
authToken.AccessToken = token;
authToken.RefreshToken = newRefreshToken;
await SetAuthTokenDataToCache(authToken, cancellation);
await StoreAuthTokenInCache(authToken, cancellation);
cookieOptions.SetCookie(context, CookieNames.AccessToken, authToken.AccessToken, expireIn);
cookieOptions.SetCookie(context, CookieNames.RefreshToken, authToken.RefreshToken, DateTime.UtcNow.Add(Lifetime));
}