Skip to content
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

All ResourceOwners are collected automatically. #1872

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

gassan
Copy link
Contributor

@gassan gassan commented Jan 6, 2022

According to #1871 another one commit that needs courage to be merged :)

ResourceOwner oauth types in Configuration are calculated automatically by scandir. All classes extended from GenericOAuth[X]ResourceOwner get oauth[X] type. if class only implements ResourceOwnerInterface then its oauth type is unknown.

ResourceOwner key (parameter type in configs) should have defined ResourceOwner::TYPE constant. If constant not defined or is null, then key will be calculated by converting its class name without ResourceOwner suffix to snake_case. if neither is felt, then InvalidArgumentException will be thrown. Here is possible BC.

Each user defined custom ResourceOwner class that implemented ResourceOwnerInterface will be registered automatically. If autoconfigure option is disabled user have to add the tag hwi_oauth.custom_resource_owner hwi_oauth.resource_owner to the service definition.

Created final classes OAuth1ResourceOwner and OAuth2ResourceOwner.

Fixes #1870

@gassan gassan force-pushed the resource-owner-collector branch 2 times, most recently from 16ec128 to 1a7c605 Compare January 6, 2022 14:55
@gassan gassan force-pushed the resource-owner-collector branch 2 times, most recently from f8c4833 to b5321bc Compare January 13, 2022 19:54
@stloyd stloyd self-assigned this Jul 21, 2022
@stloyd stloyd force-pushed the resource-owner-collector branch 4 times, most recently from ba0dee2 to 19d628a Compare July 22, 2022 07:56
@stloyd stloyd added this to the 2.0 - Game changer milestone Jul 22, 2022
@stloyd stloyd merged commit a606739 into hwi:master Jul 22, 2022
@stloyd
Copy link
Collaborator

stloyd commented Jul 22, 2022

@gassan Polished a bit the code and it's in! Thanks for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[2.0] GenericOAuth2ResourceOwner is abstract
2 participants