mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2025-12-26 16:27:25 +01:00
Beyond simply moving to the builder pattern for intialization this has a few other effects. The DeviceFlow and InstalledFlow can no longer be used without an associated Authenticator. This is becaus they no longer have any publicly accessible constructor. All initialization goes through the Authenticator. This also means that the flows are always initialized with a clone of the hyper client used by the Authenticator. The authenticator uses the builder pattern which allows omitting optional fields. This means that if users simply want a default hyper client, they don't need to create one explicitly. One will be created automatically. If users want to specify a hyper client (maybe to allow sharing a single client between different libraries) they can still do so by using the hyper_client method on the builder. Additionally for both AuthenticatorDelegate's and FlowDelegate's if the user does not specify an override the default ones will be used. The builders are now exposed publicly with the names of Authenicator, InstalledFlow, and DeviceFlow. The structs that actually implement those behaviors are now hidden and only expose the GetToken trait. This means some methods that were previously publicly accessible are no longer available, but the methods appeared to be implementation details that probably shouldn't have been exposed anyway.