laravel / passport

Laravel Passport provides OAuth2 server support to Laravel.
https://laravel.com/docs/passport
MIT License
3.25k stars 780 forks source link

[13.x] Remove redundant PAT client table and model #1749

Closed hafezdivandari closed 3 weeks ago

hafezdivandari commented 1 month ago

Personal access client table (oauth_personal_access_clients) and its model (Laravel\Passport\PersonalAccessClient) is redundant since Passport 9.0.

Changes

github-actions[bot] commented 1 month ago

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

taylorotwell commented 1 month ago

Can you explain a bit more why it is redundant?

hafezdivandari commented 1 month ago

@taylorotwell sure. Since Passport 9.0, according to docs PASSPORT_PERSONAL_ACCESS_CLIENT_ID and PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET env variables should be set to be able to issue new personal access tokens. Since then, we are using these 2 values to issue a new PAT.

But before that change on 9.x, we were finding the first active personal access client on oauth_personal_access_clients, and using the found client to issue a new PAT, that's why we were copying any new personal access clients from oauth_clients to oauth_personal_access_clients. We have no usage for oauth_personal_access_clients and its model anymore.