mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2025-12-29 07:35:42 +01:00
1) Remove the GetToken trait. The trait seemed to be organically designed. It appeared to be mostly tailored for simplifying the implementation since there was no way for users to provide their own implementation to Authenticator. It sadly seemed to get in the way of implementations more than it helped. An enum representing the known implementations is a more straightforward way to accomplish the goal and also has the benefit of not requiring Boxing when returning features (which admittedly is a minor concern for this use case). 2) Reduce the number of type parameters by using trait object for delegates. This simplifies the code considerably and the performance impact of virtual dispatch for the delegate calls is a non-factor. 3) With the above two simplifications it became easier to unify the public interface for building an authenticator. See the examples for how InstalledFlow, DeviceFlow, and ServiceAccount authenticators are now created.