Problem/Motivation
When writing an Oauth2Client plugin you have to implement the store/retrieve/clearAccessToken methods yourself. However, it seems they will mostly be one of two common implementations (state, for all users, and tempstore, for individual users) - these are provided as examples but I think they will be commonly used it might be good to provide base class implementations or traits so developers don't have to copy and paste the methods from the examples each time.
Proposed resolution
- Create two traits,
StateTokenStorageandTempStoreTokenStorage. - Refactor the test plugins and the example plugins to use these traits.
- Verify passing tests.
User interface changes
None
API changes
None
Data model changes
None
Issue fork oauth2_client-3351251
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
fathershawnGood idea! I think Traits is the best way forward. I created an issue fork - do you have time to contribute @longwave?
Comment #3
fathershawnComment #4
fathershawnComment #6
fathershawnTests passed: https://git.drupalcode.org/project/oauth2_client/-/pipelines/15036
Comment #8
fathershawn