(parentHandler *Handler, r *mux.Router, app *App)
| 215 | } |
| 216 | |
| 217 | func configureGitlabOauth(parentHandler *Handler, r *mux.Router, app *App) { |
| 218 | if app.Config().GitlabOauth.ClientID != "" { |
| 219 | callbackLocation := app.Config().App.Host + "/oauth/callback/gitlab" |
| 220 | |
| 221 | var callbackProxy *callbackProxyClient = nil |
| 222 | if app.Config().GitlabOauth.CallbackProxy != "" { |
| 223 | callbackProxy = &callbackProxyClient{ |
| 224 | server: app.Config().GitlabOauth.CallbackProxyAPI, |
| 225 | callbackLocation: app.Config().App.Host + "/oauth/callback/gitlab", |
| 226 | httpClient: config.DefaultHTTPClient(), |
| 227 | } |
| 228 | callbackLocation = app.Config().GitlabOauth.CallbackProxy |
| 229 | } |
| 230 | |
| 231 | address := config.OrDefaultString(app.Config().GitlabOauth.Host, gitlabHost) |
| 232 | oauthClient := gitlabOauthClient{ |
| 233 | ClientID: app.Config().GitlabOauth.ClientID, |
| 234 | ClientSecret: app.Config().GitlabOauth.ClientSecret, |
| 235 | ExchangeLocation: address + "/oauth/token", |
| 236 | InspectLocation: address + "/api/v4/user", |
| 237 | AuthLocation: address + "/oauth/authorize", |
| 238 | HttpClient: config.DefaultHTTPClient(), |
| 239 | CallbackLocation: callbackLocation, |
| 240 | } |
| 241 | configureOauthRoutes(parentHandler, r, app, oauthClient, callbackProxy) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | func configureGenericOauth(parentHandler *Handler, r *mux.Router, app *App) { |
| 246 | if app.Config().GenericOauth.ClientID != "" { |
no test coverage detected