mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
chore: add workspace proxies to the backend (#7032)
Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
@ -83,11 +83,24 @@ func New(ctx context.Context, options *Options) (*API, error) {
|
||||
})
|
||||
r.Route("/workspaceproxies", func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
api.moonsEnabledMW,
|
||||
)
|
||||
r.Post("/", api.postWorkspaceProxy)
|
||||
r.Get("/", api.workspaceProxies)
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
)
|
||||
r.Post("/", api.postWorkspaceProxy)
|
||||
r.Get("/", api.workspaceProxies)
|
||||
})
|
||||
r.Route("/me", func(r chi.Router) {
|
||||
r.Use(
|
||||
httpmw.ExtractWorkspaceProxy(httpmw.ExtractWorkspaceProxyConfig{
|
||||
DB: options.Database,
|
||||
Optional: false,
|
||||
}),
|
||||
)
|
||||
r.Post("/issue-signed-app-token", api.workspaceProxyIssueSignedAppToken)
|
||||
})
|
||||
// TODO: Add specific workspace proxy endpoints.
|
||||
// r.Route("/{proxyName}", func(r chi.Router) {
|
||||
// r.Use(
|
||||
|
Reference in New Issue
Block a user