Skip to content

Improve encapsulation of lambda-based factories #14838

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

Closed
franticticktick opened this issue Apr 3, 2024 · 1 comment
Closed

Improve encapsulation of lambda-based factories #14838

franticticktick opened this issue Apr 3, 2024 · 1 comment
Assignees
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@franticticktick
Copy link
Contributor

While working on #14831 I noticed that many default lambda-based factories can be moved to classes where they are used, for example:

final class DefaultOidcLogoutTokenValidatorFactory implements Function<ClientRegistration, OAuth2TokenValidator<Jwt>> {

	@Override
	public OAuth2TokenValidator<Jwt> apply(ClientRegistration clientRegistration) {
		return JwtValidators.createDefaultWithValidators(new OidcBackChannelLogoutTokenValidator(clientRegistration));
	}

}

can be moved to OidcBackChannelLogoutReactiveAuthenticationManager as private nested class etc. So far I have found only one such example, but perhaps there are more.

@franticticktick franticticktick added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Apr 3, 2024
@marcusdacoregio
Copy link
Contributor

Hi @CrazyParanoid. Maybe I am missing something but I don't see the aggregated value in doing such change. In that case it seems more like a code style than anything else. We prefer to only make changes if they have a clear advantage over what the current code is.

With that said I'll close this but feel free to add more context if you think there is some value in this.

@marcusdacoregio marcusdacoregio self-assigned this Apr 10, 2024
@marcusdacoregio marcusdacoregio added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants