diff --git a/go.mod b/go.mod index a46a8db9..fa0c140a 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 github.com/hashicorp/go-multierror v1.1.1 - github.com/hetznercloud/hcloud-go/v2 v2.44.0 + github.com/hetznercloud/hcloud-go/v2 v2.46.0 github.com/jackc/pgx/v5 v5.10.0 github.com/johannesboyne/gofakes3 v1.2.0 github.com/lestrrat-go/jwx/v4 v4.1.0 @@ -201,7 +201,7 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect golang.org/x/mod v0.38.0 // indirect - golang.org/x/net v0.56.0 // indirect + golang.org/x/net v0.57.0 // indirect golang.org/x/sync v0.22.0 // indirect golang.org/x/term v0.45.0 // indirect golang.org/x/time v0.15.0 // indirect diff --git a/go.sum b/go.sum index 4a999ac7..8f4df4f0 100644 --- a/go.sum +++ b/go.sum @@ -238,6 +238,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hetznercloud/hcloud-go/v2 v2.44.0 h1:1p9qwaZ/H55nLP9c7WfuwUA0LfsexS2YHOhD8+iBga8= github.com/hetznercloud/hcloud-go/v2 v2.44.0/go.mod h1:d0s2WLe7jSoStamv3eHoWgBSOxc/K17tYSXsqUkbse0= +github.com/hetznercloud/hcloud-go/v2 v2.46.0 h1:Ng1Jn6+9oLWorpmNkn7XhDj98MshhZAKMLFv2zT+ULw= +github.com/hetznercloud/hcloud-go/v2 v2.46.0/go.mod h1:pdG7fFGlYsCAaJ9r0QOIF0O6wQcpbJxT2VT8aP6XlIc= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -546,6 +548,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/action.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/action.go index 6f907fc7..e44b12ad 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/action.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/action.go @@ -44,11 +44,21 @@ type ActionResourceType string // List of action resource reference types. const ( - ActionResourceTypeServer ActionResourceType = "server" - ActionResourceTypeImage ActionResourceType = "image" - ActionResourceTypeISO ActionResourceType = "iso" - ActionResourceTypeFloatingIP ActionResourceType = "floating_ip" - ActionResourceTypeVolume ActionResourceType = "volume" + ActionResourceTypeServer ActionResourceType = "server" + ActionResourceTypeImage ActionResourceType = "image" + ActionResourceTypeISO ActionResourceType = "iso" + ActionResourceTypeFloatingIP ActionResourceType = "floating_ip" + ActionResourceTypeVolume ActionResourceType = "volume" + ActionResourceTypeNetwork ActionResourceType = "network" + ActionResourceTypeCertificate ActionResourceType = "certificate" + ActionResourceTypeLoadBalancer ActionResourceType = "load_balancer" + ActionResourceTypeFirewall ActionResourceType = "firewall" + ActionResourceTypePlacementGroup ActionResourceType = "placement_group" + ActionResourceTypePrimaryIP ActionResourceType = "primary_ip" + ActionResourceTypeZone ActionResourceType = "zone" + ActionResourceTypeStorageBox ActionResourceType = "storage_box" + ActionResourceTypeStorageBoxSnapshot ActionResourceType = "storage_box_snapshot" + ActionResourceTypeStorageBoxSubaccount ActionResourceType = "storage_box_subaccount" ) // ActionError is the error of an action. diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/deprecation.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/deprecation.go index a4bded8b..c2218363 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/deprecation.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/deprecation.go @@ -57,3 +57,4 @@ func (o DeprecatableResource) DeprecationAnnounced() time.Time { // Make sure that all expected Resources actually implement the interface. var _ Deprecatable = ServerType{} +var _ Deprecatable = LoadBalancerType{} diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/hcloud.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/hcloud.go index b1f4ce4b..71b6d8a0 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/hcloud.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/hcloud.go @@ -81,4 +81,4 @@ breaking changes. package hcloud // Version is the library's version following Semantic Versioning. -const Version = "2.44.0" // x-releaser-pleaser-version +const Version = "2.46.0" // x-releaser-pleaser-version diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/load_balancer_type.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/load_balancer_type.go index ff828689..a6e11951 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/load_balancer_type.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/load_balancer_type.go @@ -20,7 +20,11 @@ type LoadBalancerType struct { MaxTargets int MaxAssignedCertificates int Pricings []LoadBalancerTypeLocationPricing - Deprecated *string + + DeprecatableResource + + // Deprecated: [LoadBalancerType.Deprecated] is deprecated, use [LoadBalancerType.Deprecation] instead. + Deprecated *string } // LoadBalancerTypeClient is a client for the Load Balancer types API. diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/primary_ip.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/primary_ip.go index b062da4a..83177a49 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/primary_ip.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/primary_ip.go @@ -28,11 +28,6 @@ type PrimaryIP struct { Blocked bool Created time.Time Location *Location - - // Deprecated: [PrimaryIP.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [PrimaryIP.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter *Datacenter } func (o *PrimaryIP) pathID() (string, error) { @@ -105,11 +100,6 @@ type PrimaryIPCreateOpts struct { Labels map[string]string Name string Type PrimaryIPType - - // Deprecated: [PrimaryIPCreateOpts.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [PrimaryIPCreateOpts.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter string } // PrimaryIPCreateResult defines the response diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/load_balancer_type.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/load_balancer_type.go index b0193d3a..c05d68b1 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/load_balancer_type.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/load_balancer_type.go @@ -10,7 +10,11 @@ type LoadBalancerType struct { MaxTargets int `json:"max_targets"` MaxAssignedCertificates int `json:"max_assigned_certificates"` Prices []PricingLoadBalancerTypePrice `json:"prices"` - Deprecated *string `json:"deprecated"` + + DeprecatableResource + + // Deprecated: [LoadBalancerType.Deprecated] is deprecated, use [LoadBalancerType.Deprecation] instead. + Deprecated *string `json:"deprecated"` } // LoadBalancerTypeListResponse defines the schema of the response when diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/primary_ip.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/primary_ip.go index 3b91bd0b..de87e893 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/primary_ip.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/primary_ip.go @@ -17,11 +17,6 @@ type PrimaryIP struct { Blocked bool `json:"blocked"` Created time.Time `json:"created"` Location Location `json:"location"` - - // Deprecated: [PrimaryIP.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [PrimaryIP.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter *Datacenter `json:"datacenter"` } // PrimaryIPProtection represents the protection level of a Primary IP. @@ -45,11 +40,6 @@ type PrimaryIPCreateRequest struct { Labels *map[string]string `json:"labels,omitempty"` AutoDelete *bool `json:"auto_delete,omitempty"` Location string `json:"location,omitempty"` - - // Deprecated: [PrimaryIPCreateRequest.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [PrimaryIPCreateRequest.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter string `json:"datacenter,omitempty"` } // PrimaryIPCreateResponse defines the schema of the response diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/server.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/server.go index 450d10e9..09da2511 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/server.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema/server.go @@ -26,11 +26,6 @@ type Server struct { PrimaryDiskSize int `json:"primary_disk_size"` PlacementGroup *PlacementGroup `json:"placement_group"` LoadBalancers []int64 `json:"load_balancers"` - - // Deprecated: [Server.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [Server.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter *Datacenter `json:"datacenter"` } // ServerProtection defines the schema of a server's resource protection. @@ -117,11 +112,6 @@ type ServerCreateRequest struct { Firewalls []ServerCreateFirewalls `json:"firewalls,omitempty"` PlacementGroup int64 `json:"placement_group,omitempty"` PublicNet *ServerCreatePublicNet `json:"public_net,omitempty"` - - // Deprecated: [ServerCreateRequest.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [ServerCreateRequest.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter string `json:"datacenter,omitempty"` } // ServerCreatePublicNet defines the public network configuration of a server. diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema_gen.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema_gen.go index f8e497a9..435a9cdf 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema_gen.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/schema_gen.go @@ -83,6 +83,7 @@ You can find a documentation of goverter here: https://goverter.jmattheis.de/ // goverter:extend stringSlicePtrFromStringSlice // goverter:extend locationFromServerTypeLocationSchema // goverter:extend schemaPtrFromDatacenterServerTypes +// goverter:extend deprecatedStrFromDeprecationSchema type converter interface { // goverter:map Error.Code ErrorCode @@ -218,6 +219,7 @@ type converter interface { SchemaFromLoadBalancer(*LoadBalancer) schema.LoadBalancer // goverter:map Prices Pricings + // goverter:map DeprecatableResource.Deprecation Deprecated | deprecatedStrFromDeprecationSchema LoadBalancerTypeFromSchema(schema.LoadBalancerType) *LoadBalancerType // goverter:map Pricings Prices @@ -1064,6 +1066,14 @@ func isDeprecationNotNil(d *DeprecationInfo) bool { return d != nil } +func deprecatedStrFromDeprecationSchema(d *schema.DeprecationInfo) *string { + if d != nil { + value := d.Announced.Format(time.RFC3339) + return &value + } + return nil +} + // int64SlicePtrFromCertificatePtrSlice is needed so that a nil slice is mapped to nil instead of &nil. func int64SlicePtrFromCertificatePtrSlice(s []*Certificate) *[]int64 { if s == nil { diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/server.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/server.go index 0104820a..90a8d1b5 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/server.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/server.go @@ -37,11 +37,6 @@ type Server struct { PrimaryDiskSize int PlacementGroup *PlacementGroup LoadBalancers []*LoadBalancer - - // Deprecated: [Server.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [Server.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter *Datacenter } func (o *Server) pathID() (string, error) { @@ -316,11 +311,6 @@ type ServerCreateOpts struct { Firewalls []*ServerCreateFirewall PlacementGroup *PlacementGroup PublicNet *ServerCreatePublicNet - - // Deprecated: [ServerCreateOpts.Datacenter] is deprecated and will be removed after 1 July 2026. - // Use [ServerCreateOpts.Location] instead. - // See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters - Datacenter *Datacenter } type ServerCreatePublicNet struct { @@ -346,9 +336,6 @@ func (o ServerCreateOpts) Validate() error { if o.Image == nil || (o.Image.ID == 0 && o.Image.Name == "") { return missingField(o, "Image") } - if o.Location != nil && o.Datacenter != nil { - return mutuallyExclusiveFields(o, "Location", "Datacenter") - } return nil } @@ -421,13 +408,6 @@ func (c *ServerClient) Create(ctx context.Context, opts ServerCreateOpts) (Serve reqBody.Location = opts.Location.Name } } - if opts.Datacenter != nil { - if opts.Datacenter.ID != 0 { - reqBody.Datacenter = strconv.FormatInt(opts.Datacenter.ID, 10) // nolint:staticcheck // Deprecated - } else { - reqBody.Datacenter = opts.Datacenter.Name // nolint:staticcheck // Deprecated - } - } if opts.PlacementGroup != nil { reqBody.PlacementGroup = opts.PlacementGroup.ID } diff --git a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/zz_schema_converter.go b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/zz_schema_converter.go index afb0bea0..62830d42 100644 --- a/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/zz_schema_converter.go +++ b/vendor/github.com/hetznercloud/hcloud-go/v2/hcloud/zz_schema_converter.go @@ -304,7 +304,8 @@ func (c *converterImpl) LoadBalancerTypeFromSchema(source schema.LoadBalancerTyp hcloudLoadBalancerType.Pricings[i] = c.LoadBalancerTypeLocationPricingFromSchema(source.Prices[i]) } } - hcloudLoadBalancerType.Deprecated = source.Deprecated + hcloudLoadBalancerType.DeprecatableResource = c.schemaDeprecatableResourceToHcloudDeprecatableResource(source.DeprecatableResource) + hcloudLoadBalancerType.Deprecated = deprecatedStrFromDeprecationSchema(source.DeprecatableResource.Deprecation) return &hcloudLoadBalancerType } func (c *converterImpl) LoadBalancerTypeLocationPricingFromSchema(source schema.PricingLoadBalancerTypePrice) LoadBalancerTypeLocationPricing { @@ -443,7 +444,6 @@ func (c *converterImpl) PrimaryIPFromSchema(source schema.PrimaryIP) *PrimaryIP hcloudPrimaryIP.Blocked = source.Blocked hcloudPrimaryIP.Created = c.timeTimeToTimeTime(source.Created) hcloudPrimaryIP.Location = c.LocationFromSchema(source.Location) - hcloudPrimaryIP.Datacenter = c.pSchemaDatacenterToPHcloudDatacenter(source.Datacenter) return &hcloudPrimaryIP } func (c *converterImpl) SSHKeyFromSchema(source schema.SSHKey) *SSHKey { @@ -790,6 +790,7 @@ func (c *converterImpl) SchemaFromLoadBalancerType(source *LoadBalancerType) sch schemaLoadBalancerType.Prices[i] = c.SchemaFromLoadBalancerTypeLocationPricing((*source).Pricings[i]) } } + schemaLoadBalancerType.DeprecatableResource = c.hcloudDeprecatableResourceToSchemaDeprecatableResource((*source).DeprecatableResource) schemaLoadBalancerType.Deprecated = (*source).Deprecated } return schemaLoadBalancerType @@ -958,7 +959,6 @@ func (c *converterImpl) SchemaFromPrimaryIP(source *PrimaryIP) schema.PrimaryIP schemaPrimaryIP.Blocked = (*source).Blocked schemaPrimaryIP.Created = c.timeTimeToTimeTime((*source).Created) schemaPrimaryIP.Location = c.SchemaFromLocation((*source).Location) - schemaPrimaryIP.Datacenter = c.pHcloudDatacenterToPSchemaDatacenter((*source).Datacenter) } return schemaPrimaryIP } @@ -989,7 +989,6 @@ func (c *converterImpl) SchemaFromPrimaryIPCreateOpts(source PrimaryIPCreateOpts schemaPrimaryIPCreateRequest.Labels = stringMapToStringMapPtr(source.Labels) schemaPrimaryIPCreateRequest.AutoDelete = source.AutoDelete schemaPrimaryIPCreateRequest.Location = source.Location - schemaPrimaryIPCreateRequest.Datacenter = source.Datacenter return schemaPrimaryIPCreateRequest } func (c *converterImpl) SchemaFromPrimaryIPUpdateOpts(source PrimaryIPUpdateOpts) schema.PrimaryIPUpdateRequest { @@ -1051,7 +1050,6 @@ func (c *converterImpl) SchemaFromServer(source *Server) schema.Server { schemaServer.LoadBalancers[k] = c.pHcloudLoadBalancerToInt64((*source).LoadBalancers[k]) } } - schemaServer.Datacenter = c.pHcloudDatacenterToPSchemaDatacenter((*source).Datacenter) } return schemaServer } @@ -1535,7 +1533,6 @@ func (c *converterImpl) ServerFromSchema(source schema.Server) *Server { hcloudServer.LoadBalancers[k] = &hcloudLoadBalancer } } - hcloudServer.Datacenter = c.pSchemaDatacenterToPHcloudDatacenter(source.Datacenter) return &hcloudServer } func (c *converterImpl) ServerMetricsFromSchema(source *schema.ServerGetMetricsResponse) (*ServerMetrics, error) { @@ -2114,19 +2111,6 @@ func (c *converterImpl) pHcloudCertificateStatusToPSchemaCertificateStatusRef(so } return pSchemaCertificateStatusRef } -func (c *converterImpl) pHcloudDatacenterToPSchemaDatacenter(source *Datacenter) *schema.Datacenter { - var pSchemaDatacenter *schema.Datacenter - if source != nil { - var schemaDatacenter schema.Datacenter - schemaDatacenter.ID = (*source).ID - schemaDatacenter.Name = (*source).Name - schemaDatacenter.Description = (*source).Description - schemaDatacenter.Location = c.SchemaFromLocation((*source).Location) - schemaDatacenter.ServerTypes = schemaPtrFromDatacenterServerTypes((*source).ServerTypes) - pSchemaDatacenter = &schemaDatacenter - } - return pSchemaDatacenter -} func (c *converterImpl) pHcloudErrorToPSchemaError(source *Error) *schema.Error { var pSchemaError *schema.Error if source != nil { @@ -2588,19 +2572,6 @@ func (c *converterImpl) pSchemaDatacenterServerTypesToHcloudDatacenterServerType } return hcloudDatacenterServerTypes } -func (c *converterImpl) pSchemaDatacenterToPHcloudDatacenter(source *schema.Datacenter) *Datacenter { - var pHcloudDatacenter *Datacenter - if source != nil { - var hcloudDatacenter Datacenter - hcloudDatacenter.ID = (*source).ID - hcloudDatacenter.Name = (*source).Name - hcloudDatacenter.Description = (*source).Description - hcloudDatacenter.Location = c.LocationFromSchema((*source).Location) - hcloudDatacenter.ServerTypes = c.pSchemaDatacenterServerTypesToHcloudDatacenterServerTypes((*source).ServerTypes) - pHcloudDatacenter = &hcloudDatacenter - } - return pHcloudDatacenter -} func (c *converterImpl) pSchemaErrorToPHcloudError(source *schema.Error) *Error { var pHcloudError *Error if source != nil { diff --git a/vendor/golang.org/x/net/http2/transport_wrap.go b/vendor/golang.org/x/net/http2/transport_wrap.go index eab2e6b0..534e77ab 100644 --- a/vendor/golang.org/x/net/http2/transport_wrap.go +++ b/vendor/golang.org/x/net/http2/transport_wrap.go @@ -55,7 +55,7 @@ type transportConfig struct { // Registered is called by net/http.Transport.RegisterProtocol, // to let us know that it understands the registration mechanism we're using. func (t transportConfig) Registered(t1 *http.Transport) { - t.t.t1 = t1 + t.t.lazyt1 = t1 } func (t transportConfig) DisableCompression() bool { @@ -145,29 +145,30 @@ func (t transportConfig) DialFromContext(ctx context.Context, network, address s type transportInternal struct { initOnce sync.Once - t1 *http.Transport + lazyt1 *http.Transport } -func (t *Transport) init() { +func (t *Transport) init() *http.Transport { t.initOnce.Do(func() { - if t.t1 != nil { + if t.lazyt1 != nil { return } t1 := &http.Transport{} t.configure(t1) }) + return t.lazyt1 } func (t *Transport) configure(t1 *http.Transport) { t1.RegisterProtocol("http/2", transportConfig{t}) - // tr2.t1 is set by transportConfig.Registered. - if t.t1 != t1 { + // tr2.lazyt1 is set by transportConfig.Registered. + if t.lazyt1 != t1 { panic("http2: net/http does not support this version of x/net/http2") } } func (t *Transport) roundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { - t.init() + t1 := t.init() if req.URL.Scheme == "http" && !t.AllowHTTP { return nil, errors.New("http2: unencrypted HTTP/2 not enabled") @@ -188,22 +189,23 @@ func (t *Transport) roundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res ctx := context.WithValue(req.Context(), http2TransportContextKey{}, t) req = req.WithContext(ctx) - return t.t1.RoundTrip(req) + return t1.RoundTrip(req) } func (t *Transport) closeIdleConnections() { - t.init() - t.t1.CloseIdleConnections() + t1 := t.init() + t1.CloseIdleConnections() } func (t *Transport) newUserClientConn(c net.Conn) (*ClientConn, error) { + t1 := t.init() // http.Transport's NewClientConn doesn't provide a supported way to create // a connection from a net.Conn. (This might be useful to add in the future?) // We're going to craftily sneak one in via the context key, with the // scheme of "http/2" telling NewClientConn to look for it. ctx := context.WithValue(context.Background(), netConnContextKey{}, c) - nhcc, err := t.t1.NewClientConn(ctx, "http/2", "") + nhcc, err := t1.NewClientConn(ctx, "http/2", "") if err != nil { return nil, err } diff --git a/vendor/golang.org/x/net/idna/idna.go b/vendor/golang.org/x/net/idna/idna.go index 22767125..e2f28fed 100644 --- a/vendor/golang.org/x/net/idna/idna.go +++ b/vendor/golang.org/x/net/idna/idna.go @@ -400,7 +400,11 @@ func (p *Profile) process(s string, toASCII bool) (string, error) { // Spec says keep the old label. continue } - if unicode16 && err == nil && len(u) > 0 && isASCII(u) { + if err == nil && len(u) > 0 && isASCII(u) { + // UTS 43 pre-revision 33 doesn't classify a xn-- label + // which contains only ASCII characters as an error, + // but that's a specification bug and a security issue. + // Always return an error in this case. err = punyError(enc) } isBidi = isBidi || bidirule.DirectionString(u) != bidi.LeftToRight diff --git a/vendor/modules.txt b/vendor/modules.txt index 0c61e43a..ae10e058 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -483,7 +483,7 @@ github.com/hashicorp/errwrap # github.com/hashicorp/go-multierror v1.1.1 ## explicit; go 1.13 github.com/hashicorp/go-multierror -# github.com/hetznercloud/hcloud-go/v2 v2.44.0 +# github.com/hetznercloud/hcloud-go/v2 v2.46.0 ## explicit; go 1.25.0 github.com/hetznercloud/hcloud-go/v2/hcloud github.com/hetznercloud/hcloud-go/v2/hcloud/exp/ctxutil @@ -1069,7 +1069,7 @@ golang.org/x/exp/slices golang.org/x/mod/internal/lazyregexp golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.56.0 +# golang.org/x/net v0.57.0 ## explicit; go 1.25.0 golang.org/x/net/http/httpguts golang.org/x/net/http2