refactor: allow multiple UaaTokenEnhancers#3899
refactor: allow multiple UaaTokenEnhancers#3899peterhaochen47 wants to merge 1 commit intodevelopfrom
Conversation
- previously, only one is allowed - add setUaaTokenEnhancers function to allow adding multiple UaaTokenEnhancers - for now, keep setUaaTokenEnhancer function intact (it just adds a UaaTokenEnhancer) for backward compatibility; even though the naming of this function is a little misleading now.
2d75474 to
c862614
Compare
| } | ||
| } | ||
|
|
||
| public void setUaaTokenEnhancer(UaaTokenEnhancer uaaTokenEnhancer) { |
There was a problem hiding this comment.
API change here. Would it be better to add addUaaTokenEnhancer in addition to the set, which overwrites everything? and perhaps deprecate the setUaaTokenEnhancer
setUaaTokenEnhancer went from idempotent to non idempotent, and that is because it is a List, not a Set.
|
@peterhaochen47 You could already achieve a list of token enhancers today by setting an object that implements TokenEnhancer, and that object has a list of token enhancers in it. This PR can still be accepted, but I'm thinking that
|
|
Order these are applied may become important, so a list seems more appropriate. |
|
@gdgenchev FYI you should be aware of such change and @adrianhoelzl-sap |
|
created alternative PR based on feedback: #3904 |
|
Another similar approach would be to rely on the spring wiring for the list of beans by injecting the list directly in the constructor. If multiple enhancers are needed, you just define multiple beans that automatically get injected to the list. If order is important, you use This approach could be used if we align that we would expect Note that I recently added the |
Yes, that's how I plan to use it, to supply multiple beans, rather than calling setter explicitly (I have tested that it works). I'm keeping the old setter for backward compatibility. See new PR: #3904 |
|
closing in favor of #3904 |
setUaaTokenEnhancersfunction to allow adding multiple UaaTokenEnhancerssetUaaTokenEnhancerfunction intact (it just adds a UaaTokenEnhancer now) for backward compatibility; even though the naming of this function is a little misleading now, it functions the same as before.setUaaTokenEnhancer, neither explicitly nor implicitly via spring), we could remove this function (and migrate tosetUaaTokenEnhancers).