-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Consider replacing AuthorizationGrantType and ClientAuthenticationMethod #10506
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
Comments
Can you explain why you've created those enums in the first place because I meant to ask and forgot. Two things:
|
@snicoll The enums were originally added for meta-data. But if I understood what you said correctly, generating meta-data or a hint for keys in a map is not possible today. So even if we removed the enums, it wouldn't be possible to add custom meta-data to get hints in this case? |
I am not sure that accurately describes what I meant. Enums don't need metadata, they are processed by the IDE. So if you have a 100% matching enum in Spring Security, use that. Yes, we can't add hints for something that's bound to a map or a list in the hierarchy. |
I think I see the confusion. The versions in Spring Security are not enums. They're regular classes with a few static final constants that you can use if you want. In Spring Security you can do:
|
@snicoll I'm still slightly unsure what that means for enums that are used as values in maps. |
Nothing specific. Enums don't need metadata. Ever. Perhaps the confusing part is that what I mean here is that you'll get auto-completion for enums regardless where it's defined (maps or non maps). That change however broke the meta-data as you no longer have auto-completion. You can test it by using the key in your IDE. Can we restore proper meta-data for those keys please? Or do we want to support arbitrary values for those? |
I'm on the fence about that. Spring Security supports arbitrary values although |
In this case I think we should forgo the IDE support in favor of matching what Spring Security does. If we stick with the enum there's no way for the user to pick anything other than Once #9945 is fixed we can retrofit meta-data to give IDE hints. It's also worth considering that most users will hopefully be using one of the common providers and will only need to venture into custom configuration very occasionally. |
We could replace our own
AuthorizationGrantType
andClientAuthenticationMethod
enums with Spring Security classes and use custom meta-data for hints.The text was updated successfully, but these errors were encountered: