Commit Graph

12 Commits

Author SHA1 Message Date
ae7f0b80f3 Refactor AuthController for interface and policy checks
Refactored AuthController to implement IAuthController and expose AuthService. Removed the protected IsUserInPolicyAsync method in favor of using an extension method for policy checks. Updated the Logout logic to use the new approach. Consolidated using directives into a single line.
2026-02-06 13:41:45 +01:00
1b10162c85 Refactor AuthController policy checks and response types
Introduce IsUserInPolicyAsync for cleaner policy checks in AuthController and update Logout to use it. Adjust Logout's response type to void and improve documentation and formatting.
2026-02-06 13:23:08 +01:00
bd0426dbee Refactor AuthController for improved policy-based auth
- Inject IAuthorizationService for flexible policy checks
- Replace role checks in Logout with async policy authorization
- Merge IsAuthenticated into Check endpoint with optional role
- Update Check response type and clean up imports
2026-02-06 13:04:57 +01:00
ebed51b46a Refactor receiver roles: rename FullyAuth/PreAuth for clarity
Renamed receiver roles FullyAuth → Receiver.Full and PreAuth → Receiver.TFA across the codebase for improved clarity and consistency. Updated all usages, [Authorize] attributes, role checks, authentication logic, and authorization policies to use the new role names. Marked old constants as obsolete and pointed them to the new values. This change enhances code readability and groups receiver roles under the Receiver static class.
2026-02-06 10:49:28 +01:00
eb345a0e4d Relax and rename auth policies for sender/receiver roles
Replaced SenderOrReceiverFullyAuth and ReceiverFullyAuth policies with more general SenderOrReceiver and Receiver policies. Updated policy definitions in AuthPolicy.cs to use nameof for clarity. Adjusted AddAuthorizationBuilder configuration and [Authorize] attributes in controllers to use the new, less restrictive policies, simplifying authorization logic.
2026-02-03 16:08:15 +01:00
1b95b9d7e0 Refactor authorization policy naming to AuthPolicy
Renamed AuthorizationPolicies to AuthPolicy and updated all references to use the new naming convention for authorization policy constants. This improves consistency and clarity across the codebase.
2026-02-03 16:01:28 +01:00
8742ea6025 Switch to policy-based authorization for controllers
Replaced role-based [Authorize] attributes with policy-based ones in AuthController and TfaRegistrationController. This centralizes authorization logic and allows for more flexible access control.
2026-02-03 15:16:30 +01:00
a6be907307 Refactor AuthController roles and add check endpoint
- Change AuthController to use IOptions<AuthTokenKeys> for config
- Restrict Logout and new Check endpoints to Sender and Receiver.FullyAuth roles
- Update Logout logic to handle cookie deletion or sign-out based on user role
- Add GET /api/auth/check to verify user role via query param
- Add necessary using statements for new dependencies
2026-02-03 14:54:02 +01:00
9450ed3486 Remove old Login endpoint and related documentation
Removed the previous Login method from AuthController, including its XML documentation and Swagger/OpenAPI annotations. This prepares the controller for a revised authentication implementation.
2026-02-03 10:45:17 +01:00
1b840f4ae3 Refactor AuthController to use primary constructor
Refactored AuthController to use C# 12 primary constructor syntax for ILogger<AuthController> injection. Removed obsolete IUserService and IDirectorySearchService dependencies, their fields, and the old constructor. This streamlines the controller and prepares it for MediatR-based service handling.
2026-02-02 16:29:31 +01:00
f59c0d90ad Refactor namespaces to EnvelopeGenerator.API
Replaced all EnvelopeGenerator.GeneratorAPI namespaces with EnvelopeGenerator.API across controllers, models, extensions, middleware, and annotation-related files. Updated using/import statements and namespace declarations accordingly. Added wwwroot folder to project file. Minor code adjustments made for consistency. This unifies API naming for improved clarity and maintainability.
2026-02-02 10:00:21 +01:00
f475cf4ea9 Remove dotnet-ef tool config and IIS publish profiles
Deleted dotnet-tools.json (dotnet-ef config) and IIS publish profiles for .NET 7 and .NET 9 (IISProfileNet7Win64.pubxml, IISProfileNet9Win64.pubxml) to clean up unused deployment and tooling files.
2026-01-30 15:12:10 +01:00