vapor-community / Imperial

Federated Authentication with OAuth providers
MIT License
153 stars 48 forks source link

OAuth Service API #60

Closed calebkleveter closed 3 years ago

calebkleveter commented 4 years ago

This PR re-designs the OAuth service endpoint API, or how the endpoints for a given service should be accessed.

Instead of a general OAuthService type, there is an OAuthServiceProtocol protocol that defines how an OAuth service type should be defined. These custom types use the @Endpoint property wrapper to define properties that represent endpoints for an API.

The Request.create and Request.fetch methods have been replaced with Request.get, along with .uncache methods.

Finally, each service implementation can implement an extension on Request that allows you to easily access defined endpoints that that service.

Currently, each service still needs its full catalog of endpoints defined. An additional bonus would also be defining the Codable types that represent the response data that we get back from those endpoints.

calebkleveter commented 4 years ago

At the same time, maybe I'm just going overkill on what Imperial is actually supposed to do? 😄

0xTim commented 3 years ago

Closing due to out of scope