-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Create Authorized Proxy of Return Values #14669
Conversation
We should consider how this works with |
I wonder if we could consider
|
a8a6f5a
to
2f3457e
Compare
...t/java/org/springframework/security/authorization/object/AuthorizationProxyFactoryTests.java
Outdated
Show resolved
Hide resolved
769ed43
to
408295f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jzheaux This looks good!
Proxy arbitrary objects like so:
For return values of type
Iterator
,Collection
,Stream
,Array
, andMap
, the values are proxied instead of the collection.Also when adding
@EnableMethodSecurity
, you can do:And then each
Flight
returned will be proxied.Also works for
@EnableReactiveMethodSecurity
:Additionally, if you have types that you want to skip globally, for example, value return types, you can do:
This is handy when using
@AuthorizeReturnObject
at the class level, in case some of the methods return value types (String
,Integer
, etc.) that you have no need to proxy,