mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Add user scoped git ssh keys (#834)
This commit is contained in:
+6
-1
@@ -14,6 +14,7 @@ import (
|
||||
"cdr.dev/slog"
|
||||
"github.com/coder/coder/coderd/awsidentity"
|
||||
"github.com/coder/coder/coderd/database"
|
||||
"github.com/coder/coder/coderd/gitsshkey"
|
||||
"github.com/coder/coder/coderd/httpapi"
|
||||
"github.com/coder/coder/coderd/httpmw"
|
||||
"github.com/coder/coder/site"
|
||||
@@ -30,7 +31,8 @@ type Options struct {
|
||||
AWSCertificates awsidentity.Certificates
|
||||
GoogleTokenValidator *idtoken.Validator
|
||||
|
||||
SecureAuthCookie bool
|
||||
SecureAuthCookie bool
|
||||
SSHKeygenAlgorithm gitsshkey.Algorithm
|
||||
}
|
||||
|
||||
// New constructs the Coder API into an HTTP handler.
|
||||
@@ -146,6 +148,8 @@ func New(options *Options) (http.Handler, func()) {
|
||||
r.Get("/", api.workspacesByUser)
|
||||
r.Get("/{workspacename}", api.workspaceByUserAndName)
|
||||
})
|
||||
r.Get("/gitsshkey", api.gitSSHKey)
|
||||
r.Put("/gitsshkey", api.regenerateGitSSHKey)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -157,6 +161,7 @@ func New(options *Options) (http.Handler, func()) {
|
||||
r.Route("/agent", func(r chi.Router) {
|
||||
r.Use(httpmw.ExtractWorkspaceAgent(options.Database))
|
||||
r.Get("/", api.workspaceAgentListen)
|
||||
r.Get("/gitsshkey", api.agentGitSSHKey)
|
||||
})
|
||||
r.Route("/{workspaceresource}", func(r chi.Router) {
|
||||
r.Use(
|
||||
|
||||
Reference in New Issue
Block a user