Skip to content

Conversation

@giovanninocco
Copy link
Member

No description provided.

Updated `Directory.Build.props` to version 7.1.0 and `global.json` to .NET SDK 9.0.0. Removed `Polly` package references from multiple projects. Made formatting changes to `launchSettings.json`, `stylecop.json`, and `testEnvironments.json`. Updated `MongoDbExtensions.cs` with new service registrations and method changes. Fixed a typo in `MongoDatabaseProvider.cs`. Updated lambda expression in `Extensions.cs`. Modified Dockerfiles to copy additional configuration files. Added `.editorconfig` for coding style rules and naming conventions. Added `Directory.Build.targets`, `dotnet.ruleset`, `local copy.env`, and `NuGet.config` for build and environment configuration.
Added new properties to JwtOptions and CertificateOptions classes. Removed commented-out code in Program.cs. Updated and clarified summary comments in Extensions.cs. Changed health check endpoint to /healthz and reorganized its logic. Enhanced logger configuration with structured logging and exception details. Added new Serilog package references. Refactored Startup class for conciseness.
- Set default values for `ExpiryMinutes` and `Expiry` in `JwtOptions.cs`
- Correct summary comments in multiple files for better grammar
- Rename `StructuredConsoleLogging` to `EnableStructured` in `ConsoleOptions.cs`
- Update `Extensions.cs` to use the renamed property `EnableStructured`
Updated target framework to include net9.0 across multiple projects.
Modified Title and Description properties in .csproj files for clarity.
Updated PackageReleaseNotes to indicate the upgrade to NET9.0.
Reordered and refined PackageTags for better categorization.
Removed redundant tags from PackageTags in some .csproj files.
Adjusted ItemGroup conditions in Genocs.Auth.csproj for proper configuration.
Refined AddMetrics method in Extensions.cs to use configuration positions.
Corrected a typo in XML documentation in MongoDbBaseRepositoryOfType.cs.
Simplified constructor logic in MongoSessionFactory.cs and MongoDbInitializer.cs.
Updated IMongoDbEntity and IMongoDbInitializer interfaces to remove braces.
Modified MongoDbSeeder class for a more straightforward collection check.
Removed Polly package reference from Genocs.Tracing.csproj.
Updated genocs.sln:
- Removed and re-added order-webapi.dockerfile entry
- Added Genocs.OpenTelemetry project
- Added configuration entries for Genocs.OpenTelemetry

Modified JwtOptions.cs:
- Changed Expiry property type from TimeSpan to TimeSpan?

Updated appsettings.json:
- Set enabled property to false for consul and fabio sections

Enhanced GetProductHandler.cs:
- Added static Random instance _random
- Added logic to throw exception for random values > 6

Added Extensions.cs:
- Introduced OpenTelemetryExtensions class with AddOpenTelemetry method

Added Genocs.OpenTelemetry.csproj:
- Targets net9.0, net8.0, net7.0, and net6.0
- Includes metadata for package generation and necessary references

Added OpenTelemetryOptions.cs:
- Introduced OpenTelemetryOptions class with properties for enabling section and specifying OTLP endpoint
Renamed namespaces to `Genocs.GnxOpenTelemetry` and constants to reflect the shift from "jaeger" to "openTelemetry". Added new `Exporter` property and `OtlpExportOptions` class in `OpenTelemetryOptions.cs`. Updated `AddOtlpExporter` method in `Extensions.cs` for additional configuration options. Modified `Genocs.APIGateway.csproj` and `Startup.cs` to use new namespaces. Updated `appsettings.json` to include new "openTelemetry" section. Added `README_NUGET.md` for OpenTelemetry setup instructions.
- Added `Console` property to `OpenTelemetryOptions` for console settings.
- Updated `OpenTelemetryExtensions` to configure console exporter.
- Added `OpenTelemetry.Exporter.Console` NuGet package.
- Updated `appsettings.json` with console exporter settings.
- Created `ConsoleOptions` class for console tracing, metrics, and logging.
- Added a new service `aspire` to `infrastructure-monitoring.yml`.
- Added `Genocs.Core.Demo.HelloWorld` project to `genocs.sln`.
- Updated `Extensions.cs` to include `Serilog.Enrichers.Span` and OpenTelemetry configuration.
- Updated `Genocs.Logging.csproj` to include `Serilog.Enrichers.Span` and `Serilog.Sinks.OpenTelemetry`.
- Modified `OpenTelemetryOptions.cs` and `OtlpExportOptions.cs` for Azure settings.
- Added `Azure.Monitor.OpenTelemetry.Exporter` to `Genocs.OpenTelemetry.csproj`.
- Updated `appsettings.json` and added `appsettings.Development.json` for new settings.
- Created `Genocs.Core.Demo.HelloWorld` project with necessary files.
- Added `launchSettings.json` for the new project.
- Added `AzureOptions.cs` for Azure OpenTelemetry settings.
Added a new property `OtlpEndpoint` to `LoggerOptions` for specifying the OpenTelemetry exporter endpoint. Updated `Extensions` class to conditionally set up OpenTelemetry logging based on the presence of `OtlpEndpoint`. Included a new `using` directive for `Genocs.Core.Exceptions` in `Extensions`. Replaced direct usage of `InvalidConfigurationException` with `GenocsException.InvalidConfigurationException` in `OpenTelemetryExtensions` for consistent exception handling.
- Add error handling in GenocsHttpClient for HTTP failures
- Replace Genocs.OpenTelemetry with Genocs.Tracing in csproj
- Update launchSettings.json: remove launchBrowser, change URLs
- Change namespace in Startup.cs to Genocs.Tracing
- Add Jaeger tracing settings in appsettings.json
- Remove unused using directive in GetOrder.cs
- Refactor GetProductHandler: update random range, exception logic
- Renamed `_endpoints` to `_allowAnonymousEndpoints` in `AccessTokenValidatorMiddleware.cs`
- Removed `Microsoft.AspNetCore.Authentication.JwtBearer` package references from `Genocs.Auth.csproj`
- Simplified `issuerSigningKey` initialization in `JwtHandler.cs`
- Refactored `JwtAuthAttribute` to use a primary constructor
- Renamed `GetCurrentAsync` to `GetCurrent` in `InMemoryAccessTokenService.cs`
- Refactored `builder.AddGenocs()` to fluent style and added `app.UseGenocs()` in `Program.cs`
- Updated `PackageTags` in `Genocs.Security.csproj`
- Improved readability of `DispatcherEndpointsBuilder` class
- Simplified `CustomForwarderHttpClientFactory.cs`
- Commented out `services.AddAuthorization` in `Startup.cs`
- Updated `appsettings.json` to disable certain features and change logging levels
- Simplified variable declarations in `CreateUserHandler.cs`
- Refactored `RevokeAccessTokenHandler` and `UnlockUserHandler` to use primary constructors
- Refactored `InvalidRoleException` to use a primary constructor
- Updated `builder` configuration in `Program.cs` to include `AddJwt` and other services
- Enabled JWT and modified settings in `appsettings.json`
- Streamlined `IGenocsBuilder` initialization in `Program.cs`
Updated various classes and interfaces to support multiple roles instead of a single role, including `JwtHandler`, `JsonWebToken`, `User`, and DTO classes. Made methods synchronous in `IAccessTokenService` and related classes. Introduced policy-based authorization in `Program.cs` and added `Policies` and `Roles` classes for better role management. Reorganized `using` directives and improved handling of nullable values.
Refactored `CreateUser` and `CreateUserHandler` for cleaner syntax and constructor injection. Updated `EndpointsBuilder` to allow anonymous access when no authentication or roles are required. Enhanced `Extensions` for better authorization policy formatting and middleware usage. Added `CreateAdmin` command, handler, and endpoint with specific authorization policies.
Refactored multiple classes for better readability and nullability handling:
- `DispatcherEndpointsBuilder`: Updated `dispatcher` to `ICommandDispatcher?`, improved `afterDispatch` logic, and ensured `context.Response.StatusCode` is set to 200 if `context` is not null.
- `EndpointsBuilder`: Reformatted methods to single lines.
- `ExceptionResponse`: Included constructor parameters directly in the class definition.
- `IExceptionToResponseMapper`: Allowed `Map` method to return nullable `ExceptionResponse`.
- `Extensions`: Reformatted methods to single lines, allowed nullable returns and variables.
- `IRequest` and `WebApiEndpointDefinitions`: Removed unnecessary braces.
Refactored multiple classes to use constructors with parameters and C# 9.0's target-typed new expressions. Updated various methods to return nullable types. Enhanced XML documentation for several interfaces and classes. Modified project files to include a new "logs" folder. Adjusted `appsettings.json` configuration values. Simplified method signatures and object creation across the codebase. Ensured proper middleware order in `Program.cs` and improved static asset handling.
- Updated `AddJwt` method for better syntax and formatting.
- Allowed anonymous access for health check routes.
- Adjusted `afterDispatch` logic in `DispatcherEndpointsBuilder`.
- Refactored `JwtProvider` and `GenocsHub` to use inline constructor parameters.
- Enhanced `appsettings.json` for JWT configuration flexibility.
- Cleaned up commented-out authorization policies in `Extensions`.
- Simplified `DisabledAuthenticationPolicyEvaluator` for better clarity.
- Enhanced method signatures in `Extensions` for consistency and added authorization settings.
- Improved performance in `DateExtensions` by using `in DateTime`.
- Significant updates to `JwtHandler` with new token creation methods.
- Updated `IJwtHandler` interface for clarity and consistency.
- Reordered properties in `JsonWebTokenPayload` for better organization.
- Added new package references in `HelloWorld.csproj` for JWT and OpenAPI.
- Enhanced `Program.cs` with authentication, authorization, and CORS settings.
- Refactored `DispatcherEndpointsBuilder` for improved readability.
- Updated `JwtProvider` for consistency with `IJwtHandler`.
- Introduced `TokenProvider` for encapsulating JWT token creation logic.
- Updated `AccessTokenValidatorMiddleware` documentation.
- Modified `JwtOptions` to include default `Algorithm` and added XML documentation.
- Improved `Extensions` class with new using directives and clearer service registration.
- Refactored `JwtHandler` to centralize `SecurityTokenDescriptor` creation.
- Simplified field initialization in `InMemoryAccessTokenService`.
- Added project reference to `Genocs.Auth` in `Genocs.Core.Demo`.
- Configured JWT authentication in `Program.cs` and added access token validation middleware.
- Updated `appsettings.json` with new `simmetric_jwt` configuration section.
- Improved formatting in `DispatcherEndpointsBuilder` class.
This commit introduces JWT authentication features in `Extensions.cs` with detailed XML documentation and two new methods for adding JWT authentication. The `Program.cs` file is updated to include new authorization policies and utilize the JWT methods. Additionally, the configuration of authorization has been modified, new policies have been introduced, and some commented-out code has been removed. Middleware for access token validation has been added, along with updates to dispatcher endpoints to enforce authorization requirements.
- Added `WebApplicationBuilder` property to `GenocsBuilder` with XML documentation.
- Refactored constructors to initialize `_buildActions` as an empty array.
- Introduced a new `Build` method in `GenocsBuilder` for service provider construction.
- Cleaned up unused namespaces in `Program.cs`.
- Commented out default authorization policies and replaced with `UseCore()` for core services setup.
- Enhanced endpoint mapping to support health checks and added `UseDispatcherEndpoints` for sign-in actions.
- Changed logging level from "warning" to "debug".
- Updated Jaeger and OpenTelemetry UDP endpoints.
- Modified JWT certificate location and expiry settings.
- Changed ELK index formats for API Gateway and Products.
- Updated Swagger titles and versions for API Gateway and Orders services.
- Added request retries parameter and disabled request masking.
- Expanded OpenTelemetry configuration to include console and Azure settings.
- Renamed MongoDB database from "orders-service" to "orders".
- Updated `appsettings.json` to enable `consul` and `fabio` services for both `api-gateway` and `orders-service`.
- Increased random exception threshold in `GetProductHandler` from 20 to 90.
- Set `httpClient` type to `fabio` and disabled request masking.
- Added `openTelemetry` section for telemetry features with console and Azure exporter settings.
- Changed JWT certificate from `.cer` to `.pfx` and increased `expiryMinutes` from 30 to 60, with several validation properties set to `false`.
- Updated `swagger` version from `v01` to `v1`.
- Introduced new `webApi` section to bind requests from the route.
- Added `Logging` section to specify application log levels.
- Updated `MassTransit.RabbitMQ` from `8.3.2` to `8.3.3` in both `Genocs.Core.Demo.WebApi.csproj` and `Genocs.Core.Demo.Worker.csproj`.
- Updated `MongoDB.Driver` from `3.0.0` to `3.1.0` in `Genocs.Persistence.MongoDb.csproj`.
- Changed exception condition in `GetProductHandler.cs` from `if (currentValue < 90)` to `if (currentValue < 5)`, reducing the likelihood of exceptions.
@giovanninocco giovanninocco merged commit 3112bba into develop Dec 14, 2024
1 check passed
@giovanninocco giovanninocco deleted the ver_700 branch January 20, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants