Skip to content

Conversation

@imhmdi
Copy link
Member

@imhmdi imhmdi commented May 21, 2025

No description provided.

@imhmdi imhmdi requested a review from Copilot May 21, 2025 15:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the legacy facade authorization implementations with a more generic authorization interface and updates related command handler decorators to support the new authorization flow. Key changes include the removal of IFacadeAuthorization and associated attributes, the introduction of IAuthorization and its implementations, and updates to the service registrations and command handler decorators.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Facade/Default/Interceptors/AuthorizeInterceptor.cs Replaced IFacadeAuthorization with IAuthorization and updated attribute names accordingly
src/Facade/Default/Extensions/FacadeServiceCollectionExtensions.cs Updated dependency registrations to use IAuthorization
src/Facade/Default/DisableFacadeAuthorization.cs Removed legacy authorization class
src/Facade/Default/DisableAuthorization.cs Introduced new authorization class implementing IAuthorization
src/Facade/Abstractions/* Removed outdated interface and attribute definitions
src/Core/Applications/Extensions/ServiceCollectionExtensions.cs Adjusted decorator registrations to include the new ExceptionCommandHandlerDecorator
src/Core/Applications/CommandHandlerDecorators/* Added AuthorizeCommandHandlerDecorator and ExceptionCommandHandlerDecorator for handling authorization
src/Core/Applications.Abstractions/Authorizes/* Added new attribute definitions and authorization interface details
TodoSample/Facade/TodoItems/* and CreateTodoItemCommand.cs Updated attribute references from FacadeDynamicAuthorize to DynamicAuthorize and adjusted authorization annotations
Comments suppressed due to low confidence (1)

src/Facade/Default/Interceptors/AuthorizeInterceptor.cs:46

  • [nitpick] Local variable 'AllowAnonymous' uses PascalCase instead of the typical camelCase for local variables; consider renaming it to 'allowAnonymous' for consistency.
var AllowAnonymous = invocation.MethodInvocationTarget.GetCustomAttribute<AllowAnonymousAttribute>();




//[DynamicAuthorize]
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider removing the commented-out '[DynamicAuthorize]' attribute if it is no longer required to reduce code clutter.

Suggested change
//[DynamicAuthorize]

Copilot uses AI. Check for mistakes.
return result;
}

private TResponse CreateResultWithError(Type type, Exception ex)
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider abstracting the common result creation logic shared with ResultOrientedCommandHandlerDecorator into a common helper to avoid code duplication.

Copilot uses AI. Check for mistakes.
@imhmdi imhmdi merged commit 1d8c21d into main May 22, 2025
@imhmdi imhmdi deleted the AuthorizeCommandHandlerDecorator branch October 10, 2025 08:40
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