diff --git a/cmd/agola/cmd/remotesourcecreate.go b/cmd/agola/cmd/remotesourcecreate.go index d0bd215..01e4d58 100644 --- a/cmd/agola/cmd/remotesourcecreate.go +++ b/cmd/agola/cmd/remotesourcecreate.go @@ -40,6 +40,7 @@ type remoteSourceCreateOptions struct { rsType string authType string apiURL string + skipVerify bool oauth2ClientID string oauth2ClientSecret string sshHostKey string @@ -55,6 +56,7 @@ func init() { flags.StringVar(&remoteSourceCreateOpts.rsType, "type", "", "remotesource type") flags.StringVar(&remoteSourceCreateOpts.authType, "auth-type", "", "remote source auth type") flags.StringVar(&remoteSourceCreateOpts.apiURL, "api-url", "", "remotesource api url") + flags.BoolVarP(&remoteSourceCreateOpts.skipVerify, "skip-verify", "", false, "skip remote source api tls certificate verification") flags.StringVar(&remoteSourceCreateOpts.oauth2ClientID, "clientid", "", "remotesource oauth2 client id") flags.StringVar(&remoteSourceCreateOpts.oauth2ClientSecret, "secret", "", "remotesource oauth2 secret") flags.StringVar(&remoteSourceCreateOpts.sshHostKey, "ssh-host-key", "", "remotesource ssh public host key") @@ -82,6 +84,7 @@ func remoteSourceCreate(cmd *cobra.Command, args []string) error { Type: remoteSourceCreateOpts.rsType, AuthType: remoteSourceCreateOpts.authType, APIURL: remoteSourceCreateOpts.apiURL, + SkipVerify: remoteSourceCreateOpts.skipVerify, Oauth2ClientID: remoteSourceCreateOpts.oauth2ClientID, Oauth2ClientSecret: remoteSourceCreateOpts.oauth2ClientSecret, SSHHostKey: remoteSourceCreateOpts.sshHostKey, diff --git a/internal/services/gateway/action/remotesource.go b/internal/services/gateway/action/remotesource.go index fcd7e6c..7c2e34f 100644 --- a/internal/services/gateway/action/remotesource.go +++ b/internal/services/gateway/action/remotesource.go @@ -48,6 +48,7 @@ func (h *ActionHandler) GetRemoteSources(ctx context.Context, req *GetRemoteSour type CreateRemoteSourceRequest struct { Name string APIURL string + SkipVerify bool Type string AuthType string Oauth2ClientID string @@ -97,6 +98,7 @@ func (h *ActionHandler) CreateRemoteSource(ctx context.Context, req *CreateRemot Type: types.RemoteSourceType(req.Type), AuthType: types.RemoteSourceAuthType(req.AuthType), APIURL: req.APIURL, + SkipVerify: req.SkipVerify, Oauth2ClientID: req.Oauth2ClientID, Oauth2ClientSecret: req.Oauth2ClientSecret, SSHHostKey: req.SSHHostKey, diff --git a/internal/services/gateway/api/remotesource.go b/internal/services/gateway/api/remotesource.go index 66cd7d3..5c64812 100644 --- a/internal/services/gateway/api/remotesource.go +++ b/internal/services/gateway/api/remotesource.go @@ -33,6 +33,7 @@ type CreateRemoteSourceRequest struct { APIURL string `json:"apiurl"` Type string `json:"type"` AuthType string `json:"auth_type"` + SkipVerify bool `json:"skip_verify"` Oauth2ClientID string `json:"oauth_2_client_id"` Oauth2ClientSecret string `json:"oauth_2_client_secret"` SSHHostKey string `json:"ssh_host_key"` @@ -63,6 +64,7 @@ func (h *CreateRemoteSourceHandler) ServeHTTP(w http.ResponseWriter, r *http.Req APIURL: req.APIURL, Type: req.Type, AuthType: req.AuthType, + SkipVerify: req.SkipVerify, Oauth2ClientID: req.Oauth2ClientID, Oauth2ClientSecret: req.Oauth2ClientSecret, SSHHostKey: req.SSHHostKey,