MCPcopy Create free account
hub / github.com/entireio/git-sync / addTargetAuth

Function addTargetAuth

cmd/git-sync/flags.go:36–43  ·  view source on GitHub ↗
(cmd *cobra.Command, auth *gitsync.EndpointAuth)

Source from the content-addressed store, hash-verified

34}
35
36func addTargetAuth(cmd *cobra.Command, auth *gitsync.EndpointAuth) {
37 cmd.Flags().StringVar(&auth.Token, "target-token", envOr("GITSYNC_TARGET_TOKEN", ""), "target token/password")
38 cmd.Flags().StringVar(&auth.Username, "target-username", envOr("GITSYNC_TARGET_USERNAME", "git"), "target basic auth username")
39 cmd.Flags().StringVar(&auth.BearerToken, "target-bearer-token", envOr("GITSYNC_TARGET_BEARER_TOKEN", ""), "target bearer token")
40 cmd.Flags().BoolVar(&auth.SkipTLSVerify, "target-insecure-skip-tls-verify",
41 envBool("GITSYNC_TARGET_INSECURE_SKIP_TLS_VERIFY"),
42 "skip TLS certificate verification for the target")
43}
44
45func addProtocolFlag(cmd *cobra.Command, mode *protocolModeFlag) {
46 cmd.Flags().Var(mode, "protocol", "protocol mode: auto, v1, or v2")

Callers 3

newSyncLikeCmdFunction · 0.85
newProbeCmdFunction · 0.85
newBootstrapCmdFunction · 0.85

Calls 2

envOrFunction · 0.85
envBoolFunction · 0.85

Tested by

no test coverage detected