Skip to content

Consider renaming ProviderSettings to something more specific and enhance javadoc #681

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
asaikali opened this issue Apr 9, 2022 · 3 comments
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@asaikali
Copy link

asaikali commented Apr 9, 2022

The ProviderSettings class

does not give any clues about its purpose. The word provider is too generic and raises questions about exactly is being provided. ProviderSettings extends from AbstractSettings which again does not provide hints on what this for, beyond it is just something to hold settings. The ClientSettings and TokenSettings extend AbstractSettings and it is much clearer from the name what they do.

I suggest that the ProviderSettings should be renamed to AuthorizationServerSettings to clearly explain its purpose and make it easy for users to know what is is used for.

@asaikali asaikali added the type: enhancement A general enhancement label Apr 9, 2022
@jgrandja
Copy link
Collaborator

@asaikali I did originally consider AuthorizationServerSettings but it was specific to OAuth2 only and is not inclusive to OIDC settings.

You will notice ProviderSettings.getOidcUserInfoEndpoint() and ProviderSettings.getOidcClientRegistrationEndpoint, which are OIDC specific settings, whereas, ProviderSettings.getAuthorizationEndpoint() and ProviderSettings.getTokenEndpoint() are OAuth2 specific settings.

It was difficult to come up with a name to accomodate both OAuth2 and OIDC settings, so the end result was a generic name Provider* to accommodate both configuration scenarios.

I could potentially introduce a hierarchy AuthorizationServerSettings extends AbstractSettings and OidcProviderSettings extends AuthorizationServerSettings but this introduces some complexity in a "should be" simple design.

If we improved the javadoc, would this help? Any other suggestions?

@jgrandja jgrandja added the status: waiting-for-feedback We need additional information before we can continue label Apr 27, 2022
@jgrandja jgrandja changed the title Consider Renaming ProviderSettings to something more specific and enhanceJava docs Consider renaming ProviderSettings to something more specific and enhance javadoc Apr 27, 2022
@asaikali
Copy link
Author

asaikali commented May 1, 2022

I think improving the Javadoc helps for sure.

When I see AuthorizationServerSettings I don't think of OIDC or OAuth2 I just think this is settings required by the server. I can see why AuthorizationServerSettings might be too generic and might raise the question why do I have to setup other beans the AuthorizationServerSettings` should have all the server settings . I think introducing a class hierarchy is too much complexity.

How about:

  • ProtocolSettings - Sets the exceptions that is being used to configure protocol related settings so endpoints fits in while it stays generic of OIDC or OAuth2 and allows for non end point settings.
  • ProtocolEndpointSettings - describes exactly all the settings that exist in ProviderSettings today, if you have non endpoint settings in the future you will need to create a settings class with another name.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 1, 2022
@jgrandja jgrandja removed the status: feedback-provided Feedback has been provided label Aug 17, 2022
@jgrandja
Copy link
Collaborator

@asaikali I tried out a few different names for ProviderSettings and ended up with AuthorizationServerSettings. This name makes the most sense and clearly defines its purpose. Although I was hung up with the fact that it holds OIDC specific settings as well, the fact is that an OIDC Provider is an OAuth2 Authorization Server so this alone solidified the naming decision. Thank you for raising this issue and the naming suggestion!

Closing this as a duplicate in favour of gh-864.

See related commits gh-865, gh-866, gh-867

@jgrandja jgrandja self-assigned this Aug 23, 2022
@jgrandja jgrandja added status: duplicate A duplicate of another issue and removed type: enhancement A general enhancement labels Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants