-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #993 from pascalbreuninger/feat/ENG-3216-external-…
…git-credentials feat(cli): add globals git credential flags and forward them to grpc servers; intercept git credential requests if token and username are specified
- Loading branch information
Showing
15 changed files
with
276 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package tunnelserver | ||
|
||
import ( | ||
"github.com/loft-sh/devpod/pkg/devcontainer/config" | ||
"github.com/loft-sh/devpod/pkg/netstat" | ||
provider2 "github.com/loft-sh/devpod/pkg/provider" | ||
) | ||
|
||
type Option func(*tunnelServer) *tunnelServer | ||
|
||
func WithWorkspace(workspace *provider2.Workspace) Option { | ||
return func(s *tunnelServer) *tunnelServer { | ||
s.workspace = workspace | ||
return s | ||
} | ||
} | ||
|
||
func WithForwarder(forwarder netstat.Forwarder) Option { | ||
return func(s *tunnelServer) *tunnelServer { | ||
s.forwarder = forwarder | ||
return s | ||
} | ||
} | ||
|
||
func WithAllowGitCredentials(allowGitCredentials bool) Option { | ||
return func(s *tunnelServer) *tunnelServer { | ||
s.allowGitCredentials = allowGitCredentials | ||
return s | ||
} | ||
} | ||
|
||
func WithAllowDockerCredentials(allowDockerCredentials bool) Option { | ||
return func(s *tunnelServer) *tunnelServer { | ||
s.allowDockerCredentials = allowDockerCredentials | ||
return s | ||
} | ||
} | ||
|
||
func WithMounts(mounts []*config.Mount) Option { | ||
return func(s *tunnelServer) *tunnelServer { | ||
s.mounts = mounts | ||
return s | ||
} | ||
} | ||
|
||
func WithGitCredentialsOverride(username string, token string) Option { | ||
return func(s *tunnelServer) *tunnelServer { | ||
s.gitCredentialsOverride = gitCredentialsOverride{ | ||
username: username, | ||
token: token, | ||
} | ||
return s | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.