|
|
@ -34,6 +34,7 @@ type InspectResponse struct { |
|
|
|
ExpiresAt time.Time `json:"expires_at"` |
|
|
|
ExpiresAt time.Time `json:"expires_at"` |
|
|
|
Username string `json:"username"` |
|
|
|
Username string `json:"username"` |
|
|
|
Email string `json:"email"` |
|
|
|
Email string `json:"email"` |
|
|
|
|
|
|
|
Error string `json:"error"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// tokenRequestMaxLen is the most bytes that we'll read from the /oauth/token
|
|
|
|
// tokenRequestMaxLen is the most bytes that we'll read from the /oauth/token
|
|
|
@ -104,7 +105,7 @@ func configureSlackOauth(r *mux.Router, app *App) { |
|
|
|
ClientSecret: app.Config().SlackOauth.ClientSecret, |
|
|
|
ClientSecret: app.Config().SlackOauth.ClientSecret, |
|
|
|
TeamID: app.Config().SlackOauth.TeamID, |
|
|
|
TeamID: app.Config().SlackOauth.TeamID, |
|
|
|
CallbackLocation: app.Config().App.Host + "/oauth/callback", |
|
|
|
CallbackLocation: app.Config().App.Host + "/oauth/callback", |
|
|
|
HttpClient: &http.Client{Timeout: 10 * time.Second}, |
|
|
|
HttpClient: config.DefaultHTTPClient(), |
|
|
|
} |
|
|
|
} |
|
|
|
configureOauthRoutes(r, app, oauthClient) |
|
|
|
configureOauthRoutes(r, app, oauthClient) |
|
|
|
} |
|
|
|
} |
|
|
@ -115,11 +116,14 @@ func configureWriteAsOauth(r *mux.Router, app *App) { |
|
|
|
oauthClient := writeAsOauthClient{ |
|
|
|
oauthClient := writeAsOauthClient{ |
|
|
|
ClientID: app.Config().WriteAsOauth.ClientID, |
|
|
|
ClientID: app.Config().WriteAsOauth.ClientID, |
|
|
|
ClientSecret: app.Config().WriteAsOauth.ClientSecret, |
|
|
|
ClientSecret: app.Config().WriteAsOauth.ClientSecret, |
|
|
|
ExchangeLocation: app.Config().WriteAsOauth.TokenLocation, |
|
|
|
ExchangeLocation: config.OrDefaultString(app.Config().WriteAsOauth.TokenLocation, writeAsExchangeLocation), |
|
|
|
InspectLocation: app.Config().WriteAsOauth.InspectLocation, |
|
|
|
InspectLocation: config.OrDefaultString(app.Config().WriteAsOauth.InspectLocation, writeAsIdentityLocation), |
|
|
|
AuthLocation: app.Config().WriteAsOauth.AuthLocation, |
|
|
|
AuthLocation: config.OrDefaultString(app.Config().WriteAsOauth.AuthLocation, writeAsAuthLocation), |
|
|
|
HttpClient: &http.Client{Timeout: 10 * time.Second}, |
|
|
|
HttpClient: config.DefaultHTTPClient(), |
|
|
|
CallbackLocation: app.Config().App.Host + "/oauth/callback", |
|
|
|
CallbackLocation: app.Config().App.Host + "/oauth/callback", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if oauthClient.ExchangeLocation == "" { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
configureOauthRoutes(r, app, oauthClient) |
|
|
|
configureOauthRoutes(r, app, oauthClient) |
|
|
|
} |
|
|
|
} |
|
|
|