fix: correct SCIM Swagger try it out URLs (#24779)

This commit is contained in:
Atif Ali
2026-05-05 02:54:03 +05:00
committed by GitHub
parent f0fd2111fd
commit fad69df710
97 changed files with 21313 additions and 21246 deletions
+10 -11
View File
@@ -5,6 +5,7 @@ import (
"crypto/tls"
"crypto/x509"
"database/sql"
_ "embed"
"errors"
"expvar"
"flag"
@@ -115,6 +116,9 @@ import (
// See https://github.com/swaggo/http-swagger/issues/78
var globalHTTPSwaggerHandler http.HandlerFunc
//go:embed swagger_request_interceptor.js
var swaggerRequestInterceptor string
func init() {
globalHTTPSwaggerHandler = httpSwagger.Handler(
httpSwagger.URL("/swagger/doc.json"),
@@ -130,16 +134,11 @@ func init() {
// So remove authenticating via a cookie, and rely on the authorization
// header passed in.
httpSwagger.UIConfig(map[string]string{
// Pulled from https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
// 'withCredentials' should disable fetch sending browser credentials, but
// for whatever reason it does not.
// So this `requestInterceptor` ensures browser credentials are
// omitted from all requests.
"requestInterceptor": `(a => {
a.credentials = "omit";
return a;
})`,
"withCredentials": "false",
// The interceptor source lives in swagger_request_interceptor.js so
// it can be edited as real JavaScript.
// See https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/.
"requestInterceptor": swaggerRequestInterceptor,
"withCredentials": "false",
}))
}
@@ -310,7 +309,7 @@ type Options struct {
// @license.name AGPL-3.0
// @license.url https://github.com/coder/coder/blob/main/LICENSE
// @BasePath /api/v2
// @BasePath /
// @securitydefinitions.apiKey Authorization
// @in header