mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: allow external services to be authable (#9996)
* feat: allow external services to be authable * Refactor external auth config structure for defaults * Add support for new config properties * Change the name of external auth * Move externalauth -> external-auth * Run gen * Fix tests * Fix MW tests * Fix git auth redirect * Fix lint * Fix name * Allow any ID * Fix invalid type test * Fix e2e tests * Fix comments * Fix colors * Allow accepting any type as string * Run gen * Fix href
This commit is contained in:
+3
-3
@@ -547,7 +547,7 @@ func New(options *Options) *API {
|
||||
|
||||
// Register callback handlers for each OAuth2 provider.
|
||||
// We must support gitauth and externalauth for backwards compatibility.
|
||||
for _, route := range []string{"gitauth", "externalauth"} {
|
||||
for _, route := range []string{"gitauth", "external-auth"} {
|
||||
r.Route("/"+route, func(r chi.Router) {
|
||||
for _, externalAuthConfig := range options.ExternalAuthConfigs {
|
||||
// We don't need to register a callback handler for device auth.
|
||||
@@ -616,7 +616,7 @@ func New(options *Options) *API {
|
||||
r.Get("/{fileID}", api.fileByID)
|
||||
r.Post("/", api.postFile)
|
||||
})
|
||||
r.Route("/externalauth/{externalauth}", func(r chi.Router) {
|
||||
r.Route("/external-auth/{externalauth}", func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
httpmw.ExtractExternalAuthParam(options.ExternalAuthConfigs),
|
||||
@@ -689,7 +689,7 @@ func New(options *Options) *API {
|
||||
r.Get("/schema", templateVersionSchemaDeprecated)
|
||||
r.Get("/parameters", templateVersionParametersDeprecated)
|
||||
r.Get("/rich-parameters", api.templateVersionRichParameters)
|
||||
r.Get("/externalauth", api.templateVersionExternalAuth)
|
||||
r.Get("/external-auth", api.templateVersionExternalAuth)
|
||||
r.Get("/variables", api.templateVersionVariables)
|
||||
r.Get("/resources", api.templateVersionResources)
|
||||
r.Get("/logs", api.templateVersionLogs)
|
||||
|
||||
Reference in New Issue
Block a user