Skip to content

Make AuthorizationProxyFactory.proxy generic #16996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

big-cir
Copy link
Contributor

@big-cir big-cir commented Apr 25, 2025

Overview

This pull request updates the AuthorizationProxyFactory interface to make its proxy method generic, ensuring that it returns the same type as the input object.

The following changes are included:

  • Refactored AuthorizationProxyFactory.proxy to use generics ( T proxy(T object)).
  • Removed redundant casts from production and test code that are no longer necessary due to the type-safe proxy method.

Related

ISSUE: #16706


Note

I’m aware that the issue is currently labeled with status: waiting-for-triage, which indicates that the final design direction may not be settled yet. This PR reflects my current understanding of the issue and is intended as a starting point for further discussion.

If this approach does not align with the intended direction, please feel free to close the PR or provide feedback. I am happy to revise or take a different direction as needed. Thank you!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 25, 2025
@jzheaux jzheaux added this to the 7.0.x milestone May 1, 2025
Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

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

Thanks, @big-cir! I've left some feedback inline.

@jzheaux jzheaux modified the milestones: 7.0.x, 7.0.0-M1 May 1, 2025
@jzheaux jzheaux added in: core An issue in spring-security-core type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 1, 2025
@big-cir big-cir force-pushed the refactor/generic-proxy-method branch from 70bab2b to 7b8ba13 Compare May 2, 2025 02:09
@big-cir
Copy link
Contributor Author

big-cir commented May 2, 2025

Thanks, @big-cir! I've left some feedback inline.

@jzheaux Thank you for your valuable feedback.
I've updated the code according to your comments.
Please review the changes and let me know if any further modifications are needed. :)

@big-cir big-cir force-pushed the refactor/generic-proxy-method branch from 7b8ba13 to 07a8e30 Compare May 4, 2025 11:40
@jzheaux jzheaux self-assigned this May 7, 2025
@jzheaux
Copy link
Contributor

jzheaux commented May 7, 2025

Thanks, @big-cir! This looks great. In preparation for merging, will you please squash your commits and then rewrite it to include the ticket number like so:

Make AuthorizationProxyFactory#proxy Generic

Closes gh-16706

@big-cir big-cir force-pushed the refactor/generic-proxy-method branch from 07a8e30 to f4eda99 Compare May 8, 2025 00:24
Closes spring-projectsgh-16706

Signed-off-by: dae won <eodnjs01477@gmail.com>
@big-cir big-cir force-pushed the refactor/generic-proxy-method branch from f4eda99 to 3c8a94d Compare May 8, 2025 00:25
@big-cir
Copy link
Contributor Author

big-cir commented May 8, 2025

Thanks, @big-cir! This looks great. In preparation for merging, will you please squash your commits and then rewrite it to include the ticket number like so:

Make AuthorizationProxyFactory#proxy Generic

Closes gh-16706

I've squashed the commits and updated the commit message as requested.
Thank you for the review! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants