ausocean / cloud

GNU General Public License v3.0
1 stars 1 forks source link

gauth: Generalize to support different kinds of OAuth2 authentication #162

Open scruzin opened 5 days ago

ao-david commented 5 days ago

We could use an interface that implements at least the following methods:

type OAuther interface {
  AuthHandler(w http.ResponseWriter, r *http.Request) error
  CallbackHandler(w http.ResponseWriter, r *http.Request) error
}

These handlers would be passed the arguments from the generic endpoint, depending on the oauth implementation being used.

scruzin commented 4 days ago

I think we can share a great deal of the implementation too, not just the interface.

I think functional options might be the way to go.