0
0
mirror of https://github.com/thegeeklab/wp-plugin-go.git synced 2024-11-22 00:20:38 +00:00

fix: rename SkipVerify to InsecureSkipVerify (#69)

BREAKING CHANGE: The struct field `Network.SkipVerify` was renamed to `Network.InsecureSkipVerify`.
This commit is contained in:
Robert Kaussow 2024-05-04 13:55:56 +02:00 committed by GitHub
parent 35072e3425
commit f381a5e6ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,8 +45,8 @@ type Network struct {
//nolint:containedctx
Context context.Context
/// Whether SSL verification is skipped
SkipVerify bool
/// Whether SSL verification is skipped or not.
InsecureSkipVerify bool
// Client for making network requests.
Client *http.Client
@ -55,9 +55,9 @@ type Network struct {
func networkFlags(category string) []cli.Flag {
return []cli.Flag{
&cli.BoolFlag{
Name: "transport.skip-verify",
Usage: "skip ssl verify",
EnvVars: []string{"PLUGIN_SKIP_VERIFY"},
Name: "transport.insecure-skip-verify",
Usage: "skip SSL verification",
EnvVars: []string{"PLUGIN_INSECURE_SKIP_VERIFY"},
Category: category,
},
&cli.StringFlag{
@ -77,7 +77,7 @@ func networkFlags(category string) []cli.Flag {
func NetworkFromContext(ctx *cli.Context) Network {
var (
skip = ctx.Bool("transport.skip-verify")
skipVerify = ctx.Bool("transport.insecure-skip-verify")
defaultContext = context.Background()
socks = ctx.String("transport.socks-proxy")
socksoff = ctx.Bool("transport.socks-proxy-off")
@ -90,7 +90,7 @@ func NetworkFromContext(ctx *cli.Context) Network {
tlsConfig := &tls.Config{
RootCAs: certs,
InsecureSkipVerify: skip, //nolint:gosec
InsecureSkipVerify: skipVerify, //nolint:gosec
}
transport := &http.Transport{
@ -135,7 +135,7 @@ func NetworkFromContext(ctx *cli.Context) Network {
return Network{
Context: defaultContext,
SkipVerify: skip,
InsecureSkipVerify: skipVerify,
Client: client,
}
}