Documentation
¶
Index ¶
- Constants
- func MakeConfig(callbackURL, appID, clientID, clientSecret, apiEndPoint string, ...) *oauth2.Config
- func ServeReverseProxy(target string, res http.ResponseWriter, req *http.Request)
- type AuthVersion
- type Debugger
- func (d Debugger) GetToken(state string, code string) (*oauth2.Token, error)
- func (d Debugger) HandleHueCallback(handler func(token *oauth2.Token, w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
- func (d Debugger) HandleHueLogin(w http.ResponseWriter, r *http.Request)
- func (d Debugger) HandleRequestAndRedirect(res http.ResponseWriter, req *http.Request)
Constants ¶
View Source
const ( V1 = AuthVersion(1) V2 = AuthVersion(2) )
Variables ¶
This section is empty.
Functions ¶
func MakeConfig ¶
func MakeConfig(callbackURL, appID, clientID, clientSecret, apiEndPoint string, version AuthVersion) *oauth2.Config
MakeConfig sets-up the OAuth config
func ServeReverseProxy ¶
func ServeReverseProxy(target string, res http.ResponseWriter, req *http.Request)
ServeReverseProxy acts as a reverse proxy for a given url
Types ¶
type AuthVersion ¶
type AuthVersion int
type Debugger ¶
type Debugger struct { // HueOauthConfig specifies how to use OAuth HueOAuthConfig *oauth2.Config // APIEndpoint to use for proxying APIEndpoint string // Root, is the root url of the client application Root string // StateFn generator StateFn func() string // State validator ValidateState func(string) bool }
func (Debugger) HandleHueCallback ¶
func (d Debugger) HandleHueCallback(handler func(token *oauth2.Token, w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
HandleHueCallback redirects to
func (Debugger) HandleHueLogin ¶
func (d Debugger) HandleHueLogin(w http.ResponseWriter, r *http.Request)
HandleHueLogin redirects to Hue Login
func (Debugger) HandleRequestAndRedirect ¶
func (d Debugger) HandleRequestAndRedirect(res http.ResponseWriter, req *http.Request)
HandleRequestAndRedirect Given a request send it to the appropriate url
Click to show internal directories.
Click to hide internal directories.