diff --git a/go.mod b/go.mod index 4632c361..0c44e3da 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/cloudfoundry/cf_exporter/v2 -go 1.26.5 +go 1.26.7 require ( code.cloudfoundry.org/bbs v1.12.0 code.cloudfoundry.org/bbs/models v1.8.0 - code.cloudfoundry.org/cli/v8 v8.18.4 + code.cloudfoundry.org/cli/v8 v8.19.0 code.cloudfoundry.org/lager/v3 v3.84.0 github.com/alecthomas/kingpin/v2 v2.4.0 github.com/cloudfoundry-community/go-cf-clients-helper/v2 v2.14.0 @@ -19,13 +19,13 @@ require ( require ( code.cloudfoundry.org/bbs/encryption v1.9.0 // indirect code.cloudfoundry.org/bbs/format v1.9.0 // indirect - code.cloudfoundry.org/bytefmt v0.78.0 // indirect + code.cloudfoundry.org/bytefmt v0.86.0 // indirect code.cloudfoundry.org/cfhttp/v2 v2.83.0 // indirect - code.cloudfoundry.org/clock v1.76.0 // indirect + code.cloudfoundry.org/clock v1.84.0 // indirect code.cloudfoundry.org/go-log-cache/v2 v2.0.7 // indirect code.cloudfoundry.org/go-loggregator/v9 v9.2.1 // indirect code.cloudfoundry.org/jsonry v1.1.4 // indirect - code.cloudfoundry.org/tlsconfig v0.60.0 // indirect + code.cloudfoundry.org/tlsconfig v0.65.0 // indirect code.cloudfoundry.org/ykk v0.0.0-20170424192843-e4df4ce2fd4d // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/Masterminds/semver/v3 v3.5.0 // indirect @@ -56,7 +56,7 @@ require ( github.com/lunixbochs/vtclean v1.0.0 // indirect github.com/mattn/go-colorable v0.1.15 // indirect github.com/mattn/go-isatty v0.0.22 // indirect - github.com/mattn/go-runewidth v0.0.24 // indirect + github.com/mattn/go-runewidth v0.0.28 // indirect github.com/moby/term v0.5.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect @@ -93,8 +93,8 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apimachinery v0.36.2 // indirect - k8s.io/client-go v0.36.2 // indirect + k8s.io/apimachinery v0.36.4 // indirect + k8s.io/client-go v0.36.4 // indirect k8s.io/klog/v2 v2.140.0 // indirect k8s.io/kube-openapi v0.0.0-20260624041617-8f3fa4921821 // indirect k8s.io/utils v0.0.0-20260626114624-be93311217bd // indirect diff --git a/go.sum b/go.sum index a17ad35a..1e562123 100644 --- a/go.sum +++ b/go.sum @@ -6,16 +6,16 @@ code.cloudfoundry.org/bbs/format v1.9.0 h1:VR52K4jo/UD9ryiPEM8Y2JnC4PEPW7OYT4pyT code.cloudfoundry.org/bbs/format v1.9.0/go.mod h1:iheQ6y6V5iK+hfYKWbjJwLreBbZ9hoJWoaclcyWB3lA= code.cloudfoundry.org/bbs/models v1.8.0 h1:4bN0mNZAKGZUn4ODQ+Zzy2yLlop6LD/fSx7TlMS/Wjc= code.cloudfoundry.org/bbs/models v1.8.0/go.mod h1:xHL4SdxSn73DmJPDT3B6h/bt4+keCXsQoyMAS93B6d4= -code.cloudfoundry.org/bytefmt v0.78.0 h1:Aloep0LXiZ7OFviDbdmojNYZH5F10vWA6jpT5x6mwz4= -code.cloudfoundry.org/bytefmt v0.78.0/go.mod h1:FtdIm5VQRERfop7h8xzQ33hhFZN+mEgz8S5v6xFWCLs= +code.cloudfoundry.org/bytefmt v0.86.0 h1:nT+g6H9uMZKuDFw2Q2k5YUtN/36y3BJ7/WgWGlAzICw= +code.cloudfoundry.org/bytefmt v0.86.0/go.mod h1:nXPkX12GcU2FREdotT/niWqAoqj6f3S0VIK+O6x1kUM= code.cloudfoundry.org/cfhttp/v2 v2.83.0 h1:XP43/VVeA8+3He1Qp4yqXwAwZkgBM2tx3VIX9gYzpzQ= code.cloudfoundry.org/cfhttp/v2 v2.83.0/go.mod h1:OAYoWcMpQzzkMrqGNrL4Lj1u07jelqdtNT56CRu/X8I= code.cloudfoundry.org/cli-plugin-repo v0.0.0-20240520170503-e7ed9c7432a0 h1:AqfPzPhykvxSpxMkDdZMSJrCbxMQ0rugvDB3BuqD0DE= code.cloudfoundry.org/cli-plugin-repo v0.0.0-20240520170503-e7ed9c7432a0/go.mod h1:R1EiyOAr7lW0l/YkZNqItUNZ01Q/dYUfbTn4X4Z+82M= -code.cloudfoundry.org/cli/v8 v8.18.4 h1:KMmVIlVxiYO4NRg/KfKuKxlmKj1mQaP4Y4Ht771MuSE= -code.cloudfoundry.org/cli/v8 v8.18.4/go.mod h1:IZvqeNxbLUvCQC5NfA354+CKKTg5rjYucfcE/ffprCI= -code.cloudfoundry.org/clock v1.76.0 h1:guwRh0ZjP7g/dj+j2CITvh9/0gMa8bNaw7WMAjd78dU= -code.cloudfoundry.org/clock v1.76.0/go.mod h1:1hr8418A6RkZpIz103qhsqiRSfbIKovz5sct6lkJ0VY= +code.cloudfoundry.org/cli/v8 v8.19.0 h1:kCkVKaimYWToG7sta85nzB9hDlgWoDC6rgeqv3mEOps= +code.cloudfoundry.org/cli/v8 v8.19.0/go.mod h1:7SrN7hKuEXvdtf2VeylIxr6tR9ovplq68FzhV6++rpQ= +code.cloudfoundry.org/clock v1.84.0 h1:nYJHcG5WSDSxVYNOp+/GwqVHN5Y0VAMbbRZwetw+RJ4= +code.cloudfoundry.org/clock v1.84.0/go.mod h1:POPXUjWjYxGzHXU/AYe6P0f4rell+a7X5SZG0Q6UxAU= code.cloudfoundry.org/diego-ssh v0.0.0-20230810200140-af9d79fe9c82 h1:Bns1y0jSlcvfP0u8ael+TUlnyNHsNX808zuo58bf5so= code.cloudfoundry.org/diego-ssh v0.0.0-20230810200140-af9d79fe9c82/go.mod h1:L2/glHnSK+wKnsG8oZZqdV2sgYY9NDo/I1aDJGhcWaM= code.cloudfoundry.org/go-log-cache/v2 v2.0.7 h1:yR/JjQ/RscO1n4xVAT9HDYcpx5ET/3Cq2/RhpJml6ZU= @@ -28,8 +28,8 @@ code.cloudfoundry.org/jsonry v1.1.4 h1:P9N7IlH1/4aRCLcXLgLFj1hkcBmV7muijJzY+K6U4 code.cloudfoundry.org/jsonry v1.1.4/go.mod h1:6aKilShQP7w/Ez76h1El2/n9y2OkHuU56nKSBB9Gp0A= code.cloudfoundry.org/lager/v3 v3.84.0 h1:us7j6umD2hzLZwk1jjzEPHgvpYFClYZ8ucxeLjZdBiw= code.cloudfoundry.org/lager/v3 v3.84.0/go.mod h1:3e2EcI09jM+xBskLCaue0NWnfSEal8t4bBqYMOJ6yCA= -code.cloudfoundry.org/tlsconfig v0.60.0 h1:bB+VlWZ1Y3RTHJBNMnUx0pnkSN0DrzmJI3A0g1YSnVw= -code.cloudfoundry.org/tlsconfig v0.60.0/go.mod h1:twyxlqwOBbnU5uMc+GoS04cNuJvG7uXHC+gNAIkk81s= +code.cloudfoundry.org/tlsconfig v0.65.0 h1:mPga0pCfQp9nTHgXizFrfpsWmmcGHIUgD+cYb8KPpmw= +code.cloudfoundry.org/tlsconfig v0.65.0/go.mod h1:orvSwt5ytEO49rjIY+JLGcbIoCCbVbcowHHTbheYToI= code.cloudfoundry.org/ykk v0.0.0-20170424192843-e4df4ce2fd4d h1:M+zXqtXJqcsmpL76aU0tdl1ho23eYa4axYoM4gD62UA= code.cloudfoundry.org/ykk v0.0.0-20170424192843-e4df4ce2fd4d/go.mod h1:YUJiVOr5xl0N/RjMxM1tHmgSpBbi5UM+KoVR5AoejO0= filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= @@ -194,8 +194,8 @@ github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= -github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU= -github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/mattn/go-runewidth v0.0.28 h1:rPyg2ybwEKPebvpzVWe1gKBkH8EQFkxO4Y0hjBeLaBU= +github.com/mattn/go-runewidth v0.0.28/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE= github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A= github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= @@ -290,18 +290,18 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= -go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= +go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU= +go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ= go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= -go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= -go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= +go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o= +go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA= go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= -go.step.sm/crypto v0.83.0 h1:llCPEiL2f+kUPY+CUJrOCsuSBoJZ2qooFG9EqGast6w= -go.step.sm/crypto v0.83.0/go.mod h1:qyLTv666WJ6ImFPUjljux+684Y/GGYUjAZcKCnc6yBs= +go.step.sm/crypto v0.89.0 h1:NPxryE+cZ4XDwXOQY2U6Gu+mOzOihuRLPIsX7WtPzZM= +go.step.sm/crypto v0.89.0/go.mod h1:IEgE6DndnYojbDyHU7eYXpwWzpu4ftkouw7nyI6jsxg= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= @@ -428,12 +428,12 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.4.0-0.dev/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= -k8s.io/api v0.36.2 h1:TF6YDLIzKfccK7cq9YpTcGX8TJmEkHVRv78DM51fRYY= -k8s.io/api v0.36.2/go.mod h1:F4LbMO4brjZYh7yFkXWhynSvtB7YauxV4c+HHkNRGNg= -k8s.io/apimachinery v0.36.2 h1:0PE/W/WNy1UX61NLbXY5TMbJ6UwLL6E6lAPkYrKFxbQ= -k8s.io/apimachinery v0.36.2/go.mod h1:fvf/HOLXq9RId0rnDIbN1OEBvHXdQbLMM8nu0LcBUf4= -k8s.io/client-go v0.36.2 h1:bfgxmFKc9CgqsgX4xKLAAdmTQlWee7Ob/HlDOrJ5TBI= -k8s.io/client-go v0.36.2/go.mod h1:1vgO4OAlfPnoLcb+Rze2GF5rAr14w8qjrYMoyXJzQj0= +k8s.io/api v0.36.4 h1:RxrvqCL6vgH5/+UnTeu1IIFqYmGfy0hnyrod1rn35Oo= +k8s.io/api v0.36.4/go.mod h1:S2B3orCFBDhrgyWbLeuKcT2QdHIpQesBkCYSlWtwUOw= +k8s.io/apimachinery v0.36.4 h1:PT2UzkupGuAx/+xT5XjiMJ1WGpY3fn9/hdAvjweRet4= +k8s.io/apimachinery v0.36.4/go.mod h1:p2I2dipt7JHG+quVwQ1d02d28O4GdDi77RByQ13MTpk= +k8s.io/client-go v0.36.4 h1:MDvfDNvMSt0Br94SK8neviVlwL9qifw9B26hJCpD1K0= +k8s.io/client-go v0.36.4/go.mod h1:pNK4WKELbwlEDvtbE8l22lEZL5THYF61H5EealokZmA= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= k8s.io/kube-openapi v0.0.0-20260624041617-8f3fa4921821 h1:m2wZhD5+vJZyCVkTvUHIfaiXc/mdt3Pxyx3vUnGsKzU= diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/domain_not_enforcing_route_policies_error.go b/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/domain_not_enforcing_route_policies_error.go new file mode 100644 index 00000000..1f24dd1e --- /dev/null +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/domain_not_enforcing_route_policies_error.go @@ -0,0 +1,13 @@ +package actionerror + +import "fmt" + +// DomainNotEnforcingRoutePoliciesError is returned when a user attempts to +// add a route policy to a domain that does not have enforce_route_policies enabled. +type DomainNotEnforcingRoutePoliciesError struct { + Name string +} + +func (e DomainNotEnforcingRoutePoliciesError) Error() string { + return fmt.Sprintf("Domain '%s' does not have route policy enforcement enabled.", e.Name) +} diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/route_policy_ambiguity_error.go b/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/route_policy_ambiguity_error.go new file mode 100644 index 00000000..d5581162 --- /dev/null +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/route_policy_ambiguity_error.go @@ -0,0 +1,17 @@ +package actionerror + +import "fmt" + +// RoutePolicyAmbiguityError is returned when a route has multiple policies +// and no --source flag was given to disambiguate. +type RoutePolicyAmbiguityError struct { + RouteURL string + Count int +} + +func (e RoutePolicyAmbiguityError) Error() string { + return fmt.Sprintf( + "Route '%s' has %d policies. Specify one with --source.", + e.RouteURL, e.Count, + ) +} diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/route_policy_not_found_error.go b/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/route_policy_not_found_error.go new file mode 100644 index 00000000..31410af8 --- /dev/null +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/actionerror/route_policy_not_found_error.go @@ -0,0 +1,11 @@ +package actionerror + +import "fmt" + +type RoutePolicyNotFoundError struct { + Source string +} + +func (e RoutePolicyNotFoundError) Error() string { + return fmt.Sprintf("Route policy with source '%s' not found.", e.Source) +} diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/cloud_controller_client.go b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/cloud_controller_client.go index 0ab0cb18..a7895036 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/cloud_controller_client.go +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/cloud_controller_client.go @@ -20,6 +20,7 @@ type CloudControllerClient interface { CancelDeployment(deploymentGUID string) (ccv3.Warnings, error) ContinueDeployment(deploymentGUID string) (ccv3.Warnings, error) CopyPackage(sourcePackageGUID string, targetAppGUID string) (resources.Package, ccv3.Warnings, error) + CreateRoutePolicy(routePolicy resources.RoutePolicy) (resources.RoutePolicy, ccv3.Warnings, error) CreateApplication(app resources.Application) (resources.Application, ccv3.Warnings, error) CreateApplicationDeployment(dep resources.Deployment) (string, ccv3.Warnings, error) CreateApplicationProcessScale(appGUID string, process resources.Process) (resources.Process, ccv3.Warnings, error) @@ -42,6 +43,7 @@ type CloudControllerClient interface { CreateSpace(space resources.Space) (resources.Space, ccv3.Warnings, error) CreateSpaceQuota(spaceQuota resources.SpaceQuota) (resources.SpaceQuota, ccv3.Warnings, error) CreateUser(userGUID string) (resources.User, ccv3.Warnings, error) + DeleteRoutePolicy(guid string) (ccv3.JobURL, ccv3.Warnings, error) DeleteApplication(guid string) (ccv3.JobURL, ccv3.Warnings, error) DeleteApplicationProcessInstance(appGUID string, processType string, instanceIndex int) (ccv3.Warnings, error) DeleteBuildpack(buildpackGUID string) (ccv3.JobURL, ccv3.Warnings, error) @@ -63,6 +65,7 @@ type CloudControllerClient interface { DeleteUser(userGUID string) (ccv3.JobURL, ccv3.Warnings, error) DownloadDroplet(dropletGUID string) ([]byte, ccv3.Warnings, error) EntitleIsolationSegmentToOrganizations(isoGUID string, orgGUIDs []string) (resources.RelationshipList, ccv3.Warnings, error) + GetRoutePolicies(query ...ccv3.Query) ([]resources.RoutePolicy, ccv3.IncludedResources, ccv3.Warnings, error) GetApplicationByNameAndSpace(appName string, spaceGUID string) (resources.Application, ccv3.Warnings, error) GetApplicationDropletCurrent(appGUID string) (resources.Droplet, ccv3.Warnings, error) GetApplicationEnvironment(appGUID string) (ccv3.Environment, ccv3.Warnings, error) diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/curl.go b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/curl.go index cd388025..caa60f3c 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/curl.go +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/curl.go @@ -47,8 +47,19 @@ func (actor Actor) MakeCurlRequest( requestBodyBytes, ) - if err != nil && failOnHTTPError { - return nil, nil, translatableerror.CurlExit22Error{StatusCode: httpResponse.StatusCode} + if err != nil { + // A nil HTTP response means the request never reached the API (e.g. a token + // refresh or other authentication failure in the request wrapper). There is no + // status code to read and no response body to print, so surface the error + // directly. This also avoids a nil-pointer dereference on httpResponse below + // when the fail-on-http-error flag is set. + if httpResponse == nil { + return nil, nil, err + } + + if failOnHTTPError { + return nil, nil, translatableerror.CurlExit22Error{StatusCode: httpResponse.StatusCode} + } } return responseBody, httpResponse, nil diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/domain.go b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/domain.go index 28a36c53..f0dd6975 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/domain.go +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/domain.go @@ -24,7 +24,7 @@ func (actor Actor) CheckRoute(domainName string, hostname string, path string, p return matches, allWarnings, err } -func (actor Actor) CreateSharedDomain(domainName string, internal bool, routerGroupName string) (Warnings, error) { +func (actor Actor) CreateSharedDomain(domainName string, internal bool, routerGroupName string, enforceAccessRules bool, accessRulesScope string) (Warnings, error) { allWarnings := Warnings{} routerGroupGUID := "" @@ -37,17 +37,25 @@ func (actor Actor) CreateSharedDomain(domainName string, internal bool, routerGr routerGroupGUID = routerGroup.GUID } - _, warnings, err := actor.CloudControllerClient.CreateDomain(resources.Domain{ + domain := resources.Domain{ Name: domainName, Internal: types.NullBool{IsSet: true, Value: internal}, RouterGroup: routerGroupGUID, - }) + } + + // Set enforce_route_policies if specified + if enforceAccessRules { + domain.EnforceRoutePolicies = types.NullBool{IsSet: true, Value: true} + domain.RoutePoliciesScope = accessRulesScope + } + + _, warnings, err := actor.CloudControllerClient.CreateDomain(domain) allWarnings = append(allWarnings, Warnings(warnings)...) return allWarnings, err } -func (actor Actor) CreatePrivateDomain(domainName string, orgName string) (Warnings, error) { +func (actor Actor) CreatePrivateDomain(domainName string, orgName string, enforceAccessRules bool, accessRulesScope string) (Warnings, error) { allWarnings := Warnings{} organization, warnings, err := actor.GetOrganizationByName(orgName) allWarnings = append(allWarnings, warnings...) @@ -55,10 +63,19 @@ func (actor Actor) CreatePrivateDomain(domainName string, orgName string) (Warni if err != nil { return allWarnings, err } - _, apiWarnings, err := actor.CloudControllerClient.CreateDomain(resources.Domain{ + + domain := resources.Domain{ Name: domainName, OrganizationGUID: organization.GUID, - }) + } + + // Set enforce_route_policies if specified + if enforceAccessRules { + domain.EnforceRoutePolicies = types.NullBool{IsSet: true, Value: true} + domain.RoutePoliciesScope = accessRulesScope + } + + _, apiWarnings, err := actor.CloudControllerClient.CreateDomain(domain) actorWarnings := Warnings(apiWarnings) allWarnings = append(allWarnings, actorWarnings...) diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/label.go b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/label.go index cf7aa936..f977b886 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/label.go +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/label.go @@ -178,3 +178,19 @@ func (actor *Actor) updateResourceMetadata(resourceType string, resourceGUID str return warnings, nil } + +func (actor *Actor) GetRoutePolicyLabels(routeURL, spaceGUID, source string) (map[string]types.NullString, Warnings, error) { + _, metadata, warnings, err := actor.resolveRoutePolicyGUID(routeURL, spaceGUID, source) + if err != nil { + return nil, warnings, err + } + return actor.extractLabels(metadata, warnings, nil) +} + +func (actor *Actor) UpdateRoutePolicyLabels(routeURL, spaceGUID, source string, labels map[string]types.NullString) (Warnings, error) { + policyGUID, _, warnings, err := actor.resolveRoutePolicyGUID(routeURL, spaceGUID, source) + if err != nil { + return warnings, err + } + return actor.updateResourceMetadata("route-policy", policyGUID, resources.Metadata{Labels: labels}, warnings) +} diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/route.go b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/route.go index 702649a0..26bf9481 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/route.go +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/route.go @@ -460,6 +460,24 @@ func (actor Actor) MoveRoute(routeGUID string, spaceGUID string) (Warnings, erro return Warnings(warnings), err } +// GetRoutesByDomain gets routes for a domain with optional hostname and path filters. +func (actor Actor) GetRoutesByDomain(domainGUID, hostname, path string) ([]resources.Route, Warnings, error) { + queries := []ccv3.Query{ + {Key: ccv3.DomainGUIDFilter, Values: []string{domainGUID}}, + } + + if hostname != "" { + queries = append(queries, ccv3.Query{Key: ccv3.HostsFilter, Values: []string{hostname}}) + } + + if path != "" { + queries = append(queries, ccv3.Query{Key: ccv3.PathsFilter, Values: []string{path}}) + } + + routes, warnings, err := actor.CloudControllerClient.GetRoutes(queries...) + return routes, Warnings(warnings), err +} + func getDomainName(fullURL, host, path string, port int) string { domainWithoutHost := strings.TrimPrefix(fullURL, host+".") domainWithoutPath := strings.TrimSuffix(domainWithoutHost, path) diff --git a/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/route_policy.go b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/route_policy.go new file mode 100644 index 00000000..98d3f6e6 --- /dev/null +++ b/vendor/code.cloudfoundry.org/cli/v8/actor/v7action/route_policy.go @@ -0,0 +1,381 @@ +package v7action + +import ( + "code.cloudfoundry.org/cli/v8/actor/actionerror" + "code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3" + "code.cloudfoundry.org/cli/v8/resources" +) + +func (actor Actor) AddRoutePolicy(domainName, source, hostname, path string) (Warnings, error) { + allWarnings := Warnings{} + + // Get the domain and verify it has route policy enforcement enabled + domain, warnings, err := actor.GetDomainByName(domainName) + allWarnings = append(allWarnings, warnings...) + if err != nil { + return allWarnings, err + } + + if !domain.EnforceRoutePolicies.IsSet || !domain.EnforceRoutePolicies.Value { + return allWarnings, actionerror.DomainNotEnforcingRoutePoliciesError{Name: domainName} + } + + // Find the route + routes, routeWarnings, err := actor.GetRoutesByDomain(domain.GUID, hostname, path) + allWarnings = append(allWarnings, routeWarnings...) + if err != nil { + return allWarnings, err + } + + if len(routes) == 0 { + return allWarnings, actionerror.RouteNotFoundError{ + Host: hostname, + DomainName: domainName, + Path: path, + } + } + + route := routes[0] + + // Create the route policy + routePolicy := resources.RoutePolicy{ + Source: source, + RouteGUID: route.GUID, + } + + _, apiWarnings, err := actor.CloudControllerClient.CreateRoutePolicy(routePolicy) + allWarnings = append(allWarnings, Warnings(apiWarnings)...) + + return allWarnings, err +} + +func (actor Actor) GetRoutePoliciesByRoute(domainName, hostname, path string) ([]resources.RoutePolicy, Warnings, error) { + allWarnings := Warnings{} + + // Get the domain + domain, warnings, err := actor.GetDomainByName(domainName) + allWarnings = append(allWarnings, warnings...) + if err != nil { + return nil, allWarnings, err + } + + // Find the route + routes, routeWarnings, err := actor.GetRoutesByDomain(domain.GUID, hostname, path) + allWarnings = append(allWarnings, routeWarnings...) + if err != nil { + return nil, allWarnings, err + } + + if len(routes) == 0 { + return nil, allWarnings, actionerror.RouteNotFoundError{ + Host: hostname, + DomainName: domainName, + Path: path, + } + } + + route := routes[0] + + // Get route policies for this route + routePolicies, _, apiWarnings, err := actor.CloudControllerClient.GetRoutePolicies( + ccv3.Query{Key: ccv3.RouteGUIDFilter, Values: []string{route.GUID}}, + ) + allWarnings = append(allWarnings, Warnings(apiWarnings)...) + + var policies []resources.RoutePolicy + for _, policy := range routePolicies { + policies = append(policies, resources.RoutePolicy(policy)) + } + + return policies, allWarnings, err +} + +func (actor Actor) DeleteRoutePolicyBySource(domainName, source, hostname, path string) (Warnings, error) { + allWarnings := Warnings{} + + // Get the domain + domain, warnings, err := actor.GetDomainByName(domainName) + allWarnings = append(allWarnings, warnings...) + if err != nil { + return allWarnings, err + } + + // Find the route + routes, routeWarnings, err := actor.GetRoutesByDomain(domain.GUID, hostname, path) + allWarnings = append(allWarnings, routeWarnings...) + if err != nil { + return allWarnings, err + } + + if len(routes) == 0 { + return allWarnings, actionerror.RouteNotFoundError{ + Host: hostname, + DomainName: domainName, + Path: path, + } + } + + route := routes[0] + + // Get route policies for this route to find the one with matching source + routePolicies, _, apiWarnings, err := actor.CloudControllerClient.GetRoutePolicies( + ccv3.Query{Key: ccv3.RouteGUIDFilter, Values: []string{route.GUID}}, + ) + allWarnings = append(allWarnings, Warnings(apiWarnings)...) + if err != nil { + return allWarnings, err + } + + // Find the policy with matching source + var policyGUID string + for _, policy := range routePolicies { + if policy.Source == source { + policyGUID = policy.GUID + break + } + } + + if policyGUID == "" { + return allWarnings, actionerror.RoutePolicyNotFoundError{Source: source} + } + + // Delete the route policy + _, deleteWarnings, err := actor.CloudControllerClient.DeleteRoutePolicy(policyGUID) + allWarnings = append(allWarnings, Warnings(deleteWarnings)...) + + return allWarnings, err +} + +// resolveRoutePolicyGUID finds the GUID of the route policy to operate on. +// If source is non-empty, it finds the policy with that source. +// If source is empty, it requires exactly one policy (returns ambiguity or not-found error). +func (actor *Actor) resolveRoutePolicyGUID(routeURL, spaceGUID, source string) (string, *resources.Metadata, Warnings, error) { + route, routeWarnings, err := actor.GetRoute(routeURL, spaceGUID) + if err != nil { + return "", nil, routeWarnings, err + } + + routePolicies, _, policyWarnings, err := actor.CloudControllerClient.GetRoutePolicies( + ccv3.Query{Key: ccv3.RouteGUIDFilter, Values: []string{route.GUID}}, + ) + allWarnings := append(routeWarnings, Warnings(policyWarnings)...) + if err != nil { + return "", nil, allWarnings, err + } + + if source != "" { + for _, p := range routePolicies { + if p.Source == source { + return p.GUID, p.Metadata, allWarnings, nil + } + } + return "", nil, allWarnings, actionerror.RoutePolicyNotFoundError{Source: source} + } + + if len(routePolicies) == 0 { + return "", nil, allWarnings, actionerror.RoutePolicyNotFoundError{Source: ""} + } + if len(routePolicies) > 1 { + return "", nil, allWarnings, actionerror.RoutePolicyAmbiguityError{RouteURL: routeURL, Count: len(routePolicies)} + } + p := routePolicies[0] + return p.GUID, p.Metadata, allWarnings, nil +} + +// RoutePolicyWithRoute combines a route policy with its associated route information +type RoutePolicyWithRoute struct { + resources.RoutePolicy + Route resources.Route + DomainName string + ScopeType string // "app", "space", "org", or "any" + SourceName string // Resolved source name (app/space/org) or empty string +} + +// GetRoutePoliciesForSpace gets all route policies for routes in a space with optional filters +func (actor Actor) GetRoutePoliciesForSpace( + spaceGUID string, + domainName string, + hostname string, + path string, + labelSelector string, +) ([]RoutePolicyWithRoute, Warnings, error) { + allWarnings := Warnings{} + + // Build query for route policies filtered by space, with included routes and sources. + // ?include=route,source causes CAPI to return all referenced apps/spaces/orgs inline, + // avoiding per-policy follow-up lookups. + queries := []ccv3.Query{ + {Key: ccv3.SpaceGUIDFilter, Values: []string{spaceGUID}}, + {Key: ccv3.Include, Values: []string{"route,source"}}, + } + + // Add label selector if provided + if labelSelector != "" { + queries = append(queries, ccv3.Query{Key: ccv3.LabelSelectorFilter, Values: []string{labelSelector}}) + } + + // Fetch route policies directly by space GUID with included routes (single API call) + routePolicies, includedResources, apiWarnings, err := actor.CloudControllerClient.GetRoutePolicies(queries...) + allWarnings = append(allWarnings, Warnings(apiWarnings)...) + if err != nil { + return nil, allWarnings, err + } + + if len(routePolicies) == 0 { + // No route policies found - return empty list, not an error + return []RoutePolicyWithRoute{}, allWarnings, nil + } + + // Create domain name cache; pre-populated below if a domain filter is used. + domainCache := make(map[string]string) + + // Filter the routes slice before building the lookup map. + filteredRoutes := includedResources.Routes + + if domainName != "" { + domain, warnings, err := actor.GetDomainByName(domainName) + allWarnings = append(allWarnings, warnings...) + if err != nil { + return nil, allWarnings, err + } + // Pre-populate cache: all matching routes share this single domain GUID. + domainCache[domain.GUID] = domain.Name + var matched []resources.Route + for _, route := range filteredRoutes { + if route.DomainGUID == domain.GUID { + matched = append(matched, route) + } + } + filteredRoutes = matched + } + + if hostname != "" { + var matched []resources.Route + for _, route := range filteredRoutes { + if route.Host == hostname { + matched = append(matched, route) + } + } + filteredRoutes = matched + } + + if path != "" { + var matched []resources.Route + for _, route := range filteredRoutes { + if route.Path == path { + matched = append(matched, route) + } + } + filteredRoutes = matched + } + + // Build route lookup map from filtered routes only. + routeByGUID := make(map[string]resources.Route, len(filteredRoutes)) + for _, route := range filteredRoutes { + routeByGUID[route.GUID] = route + } + + // Populate domain cache for any domain GUIDs not yet known. + for _, route := range filteredRoutes { + if _, exists := domainCache[route.DomainGUID]; !exists { + domain, warnings, err := actor.GetDomain(route.DomainGUID) + allWarnings = append(allWarnings, warnings...) + if err != nil { + // If we can't get the domain, use the GUID as fallback + domainCache[route.DomainGUID] = route.DomainGUID + } else { + domainCache[route.DomainGUID] = domain.Name + } + } + } + + // Build name lookup maps from included source resources. + // CAPI returns all referenced apps/spaces/orgs inline when ?include=source is sent, + // so no additional API calls are required per policy. + appNameByGUID := make(map[string]string) + for _, app := range includedResources.Apps { + appNameByGUID[app.GUID] = app.Name + } + spaceNameByGUID := make(map[string]string) + for _, space := range includedResources.Spaces { + spaceNameByGUID[space.GUID] = space.Name + } + orgNameByGUID := make(map[string]string) + for _, org := range includedResources.Organizations { + orgNameByGUID[org.GUID] = org.Name + } + + // Build results with route information and resolved sources. + // Only include route policies whose routes match the filters. + var results []RoutePolicyWithRoute + for _, policy := range routePolicies { + route, exists := routeByGUID[policy.RouteGUID] + if !exists { + // Skip policies for routes that don't match the optional filters + continue + } + + scopeType, sourceName := sourceInfoFromIncluded(policy.Source, appNameByGUID, spaceNameByGUID, orgNameByGUID) + + results = append(results, RoutePolicyWithRoute{ + RoutePolicy: resources.RoutePolicy(policy), + Route: route, + DomainName: domainCache[route.DomainGUID], + ScopeType: scopeType, + SourceName: sourceName, + }) + } + + return results, allWarnings, nil +} + +// sourceInfoFromIncluded resolves a source string to a scope type and human-readable name +// using the name maps pre-built from CAPI's ?include=source response. +// It performs no API calls. +func sourceInfoFromIncluded(source string, apps, spaces, orgs map[string]string) (scopeType, sourceName string) { + if source == "cf:any" { + return "any", "" + } + + const prefix = "cf:" + if len(source) < len(prefix) { + return "unknown", "" + } + + parts := splitSource(source[len(prefix):]) + if len(parts) < 2 { + return "unknown", "" + } + + sourceType, guid := parts[0], parts[1] + switch sourceType { + case "app": + return "app", apps[guid] + case "space": + return "space", spaces[guid] + case "org": + return "org", orgs[guid] + default: + return "unknown", "" + } +} + +// splitSource splits a source body by colon, handling the case where +// the source might be "type:guid" format +func splitSource(s string) []string { + var parts []string + current := "" + for _, char := range s { + if char == ':' && len(parts) == 0 { + // First colon - split here + parts = append(parts, current) + current = "" + } else { + current += string(char) + } + } + if current != "" { + parts = append(parts, current) + } + return parts +} diff --git a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/included_resources.go b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/included_resources.go index aa25d3f8..f4eb0695 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/included_resources.go +++ b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/included_resources.go @@ -11,6 +11,7 @@ type IncludedResources struct { ServiceBrokers []resources.ServiceBroker `json:"service_brokers,omitempty"` ServicePlans []resources.ServicePlan `json:"service_plans,omitempty"` Apps []resources.Application `json:"apps,omitempty"` + Routes []resources.Route `json:"routes,omitempty"` } func (i *IncludedResources) Merge(resources IncludedResources) { @@ -22,4 +23,5 @@ func (i *IncludedResources) Merge(resources IncludedResources) { i.ServiceInstances = append(i.ServiceInstances, resources.ServiceInstances...) i.ServiceOfferings = append(i.ServiceOfferings, resources.ServiceOfferings...) i.ServicePlans = append(i.ServicePlans, resources.ServicePlans...) + i.Routes = append(i.Routes, resources.Routes...) } diff --git a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/internal/api_routes.go b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/internal/api_routes.go index e95ac23b..8ba612df 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/internal/api_routes.go +++ b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/internal/api_routes.go @@ -9,6 +9,7 @@ import "net/http" // If the request returns a single entity by GUID, use the singular (for example // /v3/organizations/:organization_guid is GetOrganization). const ( + DeleteRoutePolicyRequest = "DeleteRoutePolicyRequest" DeleteApplicationProcessInstanceRequest = "DeleteApplicationProcessInstance" DeleteApplicationRequest = "DeleteApplication" DeleteBuildpackRequest = "DeleteBuildpack" @@ -35,6 +36,8 @@ const ( DeleteSpaceRequest = "DeleteSpace" DeleteSpaceQuotaFromSpaceRequest = "DeleteSpaceQuotaFromSpace" DeleteUserRequest = "DeleteUser" + GetRoutePolicyRequest = "GetRoutePolicyRequest" + GetRoutePoliciesRequest = "GetRoutePoliciesRequest" GetApplicationDropletCurrentRequest = "GetApplicationDropletCurrent" GetApplicationEnvRequest = "GetApplicationEnv" GetApplicationFeaturesRequest = "GetApplicationFeatures" @@ -134,6 +137,8 @@ const ( PatchSpaceQuotaRequest = "PatchSpaceQuota" PatchStackRequest = "PatchStack" PatchMoveRouteRequest = "PatchMoveRouteRequest" + PatchRoutePolicyRequest = "PatchRoutePolicyRequest" + PostRoutePolicyRequest = "PostRoutePolicyRequest" PostApplicationActionApplyManifest = "PostApplicationActionApplyM" PostApplicationActionRestartRequest = "PostApplicationActionRestart" PostApplicationActionStartRequest = "PostApplicationActionStart" @@ -187,6 +192,11 @@ const ( // APIRoutes is a list of routes used by the router to construct request URLs. var APIRoutes = map[string]Route{ + GetRoutePoliciesRequest: {Path: "/v3/route_policies", Method: http.MethodGet}, + PostRoutePolicyRequest: {Path: "/v3/route_policies", Method: http.MethodPost}, + GetRoutePolicyRequest: {Path: "/v3/route_policies/:route_policy_guid", Method: http.MethodGet}, + DeleteRoutePolicyRequest: {Path: "/v3/route_policies/:route_policy_guid", Method: http.MethodDelete}, + PatchRoutePolicyRequest: {Path: "/v3/route_policies/:route_policy_guid", Method: http.MethodPatch}, GetApplicationsRequest: {Path: "/v3/apps", Method: http.MethodGet}, PostApplicationRequest: {Path: "/v3/apps", Method: http.MethodPost}, DeleteApplicationRequest: {Path: "/v3/apps/:app_guid", Method: http.MethodDelete}, diff --git a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/metadata.go b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/metadata.go index f8c277f6..40e77865 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/metadata.go +++ b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/metadata.go @@ -42,6 +42,12 @@ func (client *Client) UpdateResourceMetadata(resource string, resourceGUID strin RequestBody: requestMetadata, URIParams: internal.Params{"route_guid": resourceGUID}, } + case "route-policy": + params = RequestParams{ + RequestName: internal.PatchRoutePolicyRequest, + RequestBody: requestMetadata, + URIParams: internal.Params{"route_policy_guid": resourceGUID}, + } case "service-broker": params = RequestParams{ RequestName: internal.PatchServiceBrokerRequest, diff --git a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/query.go b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/query.go index 99b04aba..fdc7a43f 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/query.go +++ b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/query.go @@ -29,6 +29,10 @@ const ( SequenceIDFilter QueryKey = "sequence_ids" // RouteGUIDFilter is a query parameter for listing objects by Route GUID. RouteGUIDFilter QueryKey = "route_guids" + // SourcesFilter is a query parameter for listing route policies by source. + SourcesFilter QueryKey = "sources" + // SourceGuidsFilter is a query parameter for listing route policies by source GUID. + SourceGuidsFilter QueryKey = "source_guids" // ServiceInstanceGUIDFilter is a query parameter for listing objects by Service Instance GUID. ServiceInstanceGUIDFilter QueryKey = "service_instance_guids" // SpaceGUIDFilter is a query parameter for listing objects by Space GUID. diff --git a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/route_policy.go b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/route_policy.go new file mode 100644 index 00000000..40c3b4f2 --- /dev/null +++ b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/route_policy.go @@ -0,0 +1,59 @@ +package ccv3 + +import ( + "code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccv3/internal" + "code.cloudfoundry.org/cli/v8/resources" +) + +// CreateRoutePolicy creates a route policy for a route +func (client *Client) CreateRoutePolicy(routePolicy resources.RoutePolicy) (resources.RoutePolicy, Warnings, error) { + var responseBody resources.RoutePolicy + + _, warnings, err := client.MakeRequest(RequestParams{ + RequestName: internal.PostRoutePolicyRequest, + RequestBody: routePolicy, + ResponseBody: &responseBody, + }) + + return responseBody, warnings, err +} + +// GetRoutePolicies lists route policies +func (client *Client) GetRoutePolicies(query ...Query) ([]resources.RoutePolicy, IncludedResources, Warnings, error) { + var routePolicies []resources.RoutePolicy + + includedResources, warnings, err := client.MakeListRequest(RequestParams{ + RequestName: internal.GetRoutePoliciesRequest, + Query: query, + ResponseBody: resources.RoutePolicy{}, + AppendToList: func(item interface{}) error { + routePolicies = append(routePolicies, item.(resources.RoutePolicy)) + return nil + }, + }) + + return routePolicies, includedResources, warnings, err +} + +// GetRoutePolicy gets a single route policy by GUID +func (client *Client) GetRoutePolicy(guid string) (resources.RoutePolicy, Warnings, error) { + var responseBody resources.RoutePolicy + + _, warnings, err := client.MakeRequest(RequestParams{ + RequestName: internal.GetRoutePolicyRequest, + URIParams: internal.Params{"route_policy_guid": guid}, + ResponseBody: &responseBody, + }) + + return responseBody, warnings, err +} + +// DeleteRoutePolicy deletes a route policy +func (client *Client) DeleteRoutePolicy(guid string) (JobURL, Warnings, error) { + jobURLString, warnings, err := client.MakeRequest(RequestParams{ + RequestName: internal.DeleteRoutePolicyRequest, + URIParams: internal.Params{"route_policy_guid": guid}, + }) + + return JobURL(jobURLString), warnings, err +} diff --git a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion/minimum_version.go b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion/minimum_version.go index 564f1381..a1ed8a05 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion/minimum_version.go +++ b/vendor/code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion/minimum_version.go @@ -28,4 +28,10 @@ const ( MinVersionEmbeddedProcessInstances = "3.211.0" MinVersionUpdateStack = "3.211.0" + + // MinVersionRoutePolicies is the CC API version that introduces + // /v3/route_policies and the enforce_route_policies / route_policies_scope + // domain fields (RFC0055 Identity-Aware Routing), as shipped in + // capi-release 1.239.0. + MinVersionRoutePolicies = "3.224.0" ) diff --git a/vendor/code.cloudfoundry.org/cli/v8/resources/domain_resource.go b/vendor/code.cloudfoundry.org/cli/v8/resources/domain_resource.go index 591127ba..065b7245 100644 --- a/vendor/code.cloudfoundry.org/cli/v8/resources/domain_resource.go +++ b/vendor/code.cloudfoundry.org/cli/v8/resources/domain_resource.go @@ -6,12 +6,14 @@ import ( ) type Domain struct { - GUID string `json:"guid,omitempty"` - Name string `json:"name"` - Internal types.NullBool `json:"internal,omitempty"` - OrganizationGUID string `jsonry:"relationships.organization.data.guid,omitempty"` - RouterGroup string `jsonry:"router_group.guid,omitempty"` - Protocols []string `jsonry:"supported_protocols,omitempty"` + GUID string `json:"guid,omitempty"` + Name string `json:"name"` + Internal types.NullBool `json:"internal,omitempty"` + OrganizationGUID string `jsonry:"relationships.organization.data.guid,omitempty"` + RouterGroup string `jsonry:"router_group.guid,omitempty"` + Protocols []string `jsonry:"supported_protocols,omitempty"` + EnforceRoutePolicies types.NullBool `json:"enforce_route_policies,omitempty"` + RoutePoliciesScope string `json:"route_policies_scope,omitempty"` // Metadata is used for custom tagging of API resources Metadata *Metadata `json:"metadata,omitempty"` @@ -19,25 +21,31 @@ type Domain struct { func (d Domain) MarshalJSON() ([]byte, error) { type domainWithBoolPointer struct { - GUID string `jsonry:"guid,omitempty"` - Name string `jsonry:"name"` - Internal *bool `jsonry:"internal,omitempty"` - OrganizationGUID string `jsonry:"relationships.organization.data.guid,omitempty"` - RouterGroup string `jsonry:"router_group.guid,omitempty"` - Protocols []string `jsonry:"supported_protocols,omitempty"` + GUID string `jsonry:"guid,omitempty"` + Name string `jsonry:"name"` + Internal *bool `jsonry:"internal,omitempty"` + OrganizationGUID string `jsonry:"relationships.organization.data.guid,omitempty"` + RouterGroup string `jsonry:"router_group.guid,omitempty"` + Protocols []string `jsonry:"supported_protocols,omitempty"` + EnforceRoutePolicies *bool `jsonry:"enforce_route_policies,omitempty"` + RoutePoliciesScope string `jsonry:"route_policies_scope,omitempty"` } clone := domainWithBoolPointer{ - GUID: d.GUID, - Name: d.Name, - OrganizationGUID: d.OrganizationGUID, - RouterGroup: d.RouterGroup, - Protocols: d.Protocols, + GUID: d.GUID, + Name: d.Name, + OrganizationGUID: d.OrganizationGUID, + RouterGroup: d.RouterGroup, + Protocols: d.Protocols, + RoutePoliciesScope: d.RoutePoliciesScope, } if d.Internal.IsSet { clone.Internal = &d.Internal.Value } + if d.EnforceRoutePolicies.IsSet { + clone.EnforceRoutePolicies = &d.EnforceRoutePolicies.Value + } return jsonry.Marshal(clone) } diff --git a/vendor/code.cloudfoundry.org/cli/v8/resources/route_policy_resource.go b/vendor/code.cloudfoundry.org/cli/v8/resources/route_policy_resource.go new file mode 100644 index 00000000..83204336 --- /dev/null +++ b/vendor/code.cloudfoundry.org/cli/v8/resources/route_policy_resource.go @@ -0,0 +1,79 @@ +package resources + +import ( + "encoding/json" + "time" + + "code.cloudfoundry.org/cli/v8/api/cloudcontroller" +) + +type RoutePolicy struct { + GUID string `json:"guid,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Source string `json:"source"` + RouteGUID string `json:"-"` + + // Metadata is used for custom tagging of API resources + Metadata *Metadata `json:"metadata,omitempty"` +} + +func (r RoutePolicy) MarshalJSON() ([]byte, error) { + type alias struct { + GUID string `json:"guid,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Source string `json:"source"` + Metadata *Metadata `json:"metadata,omitempty"` + + Relationships struct { + Route struct { + Data struct { + GUID string `json:"guid"` + } `json:"data"` + } `json:"route"` + } `json:"relationships"` + } + + var aliasData alias + aliasData.GUID = r.GUID + aliasData.CreatedAt = r.CreatedAt + aliasData.UpdatedAt = r.UpdatedAt + aliasData.Source = r.Source + aliasData.Metadata = r.Metadata + aliasData.Relationships.Route.Data.GUID = r.RouteGUID + + return json.Marshal(aliasData) +} + +func (r *RoutePolicy) UnmarshalJSON(data []byte) error { + var alias struct { + GUID string `json:"guid,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Source string `json:"source"` + Metadata *Metadata `json:"metadata,omitempty"` + + Relationships struct { + Route struct { + Data struct { + GUID string `json:"guid,omitempty"` + } `json:"data,omitempty"` + } `json:"route,omitempty"` + } `json:"relationships,omitempty"` + } + + err := cloudcontroller.DecodeJSON(data, &alias) + if err != nil { + return err + } + + r.GUID = alias.GUID + r.CreatedAt = alias.CreatedAt + r.UpdatedAt = alias.UpdatedAt + r.Source = alias.Source + r.RouteGUID = alias.Relationships.Route.Data.GUID + r.Metadata = alias.Metadata + + return nil +} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go index 6b958fdd..33168549 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -4,6 +4,8 @@ import ( "os" "sort" "strings" + "sync" + "sync/atomic" "unicode/utf8" "github.com/clipperhouse/uax29/v2/graphemes" @@ -18,6 +20,14 @@ var ( // StrictEmojiNeutral should be set false if handle broken fonts StrictEmojiNeutral bool = true + // ZeroWidthJoiner is flag to set to use UTR#51 ZWJ. + // + // Deprecated: ZWJ sequences are always handled through Unicode + // grapheme cluster segmentation now, so this flag has no effect. + // It is kept only for compatibility with code written against + // v0.0.9 and earlier. + ZeroWidthJoiner bool + // DefaultCondition is a condition in current locale DefaultCondition = &Condition{ EastAsianWidth: false, @@ -26,20 +36,73 @@ var ( ) var ( - zerowidth table // combining + nonprint merged for faster zero-width lookup - widewidth table // ambiguous + doublewidth merged for EA path - eastAsianWidth widthTable - eastAsianWidth0 [0x300]byte + zerowidth table // combining + nonprint merged for faster zero-width lookup + widewidth table // ambiguous + doublewidth merged for EA path + eastAsianWidth widthTable + tablesOnce sync.Once + + // strictWidthLUT is mostly built lazily on the first width lookup so + // that importing the package costs neither the build time nor the 2 MB + // of resident memory; see issue #104. Only the entries below + // strictWidthLUTLimit are valid: init fills the first 0x300 entries of + // both planes, and the lazy build fills the rest — never rewriting the + // low region, so readers of it cannot race with the build. The limit + // is loaded with acquire semantics, which makes the non-atomic reads + // of the high region safe once it reports 0x110000. Keeping the whole + // check down to one compare-and-branch matters: RuneWidth is only a + // dozen instructions long. + strictWidthLUT [2][0x110000]byte + strictWidthLUTLimit atomic.Int32 + strictWidthLUTOnce sync.Once ) func init() { + initStrictWidthLUTLow() + strictWidthLUTLimit.Store(0x300) + handleEnv() +} + +// initStrictWidthLUTLow paints the first 0x300 entries of strictWidthLUT +// from the static interval tables. The result must stay identical to +// runeWidthNoLUT for runes below 0x300, which TestStrictWidthLUT verifies. +func initStrictWidthLUTLow() { + for i := 0; i < 0x300; i++ { + r := rune(i) + w := byte(1) + if r < 0x20 || (r >= 0x7F && r <= 0x9F) || r == 0xAD { // nonprint + w = 0 + } + strictWidthLUT[0][i] = w + } + + ea := strictWidthLUT[1][:0x300] + fillBytes(ea, 1) + paint := func(t table, w byte) { + for _, iv := range t { + if iv.first >= 0x300 { + break + } + last := iv.last + if last > 0x2FF { + last = 0x2FF + } + fillBytes(ea[iv.first:last+1], w) + } + } + paint(ambiguous, 2) + paint(doublewidth, 2) + // zero-width wins over wide on overlap, so paint it last. + paint(combining, 0) + paint(nonprint, 0) +} + +// initTables builds the merged lookup tables. It runs lazily through +// tablesOnce so that merely importing the package stays cheap; see issue +// #104. +func initTables() { zerowidth = mergeIntervals(combining, nonprint) widewidth = mergeIntervals(ambiguous, doublewidth) eastAsianWidth = makeWidthTable(zerowidth, widewidth) - for r := range eastAsianWidth0 { - eastAsianWidth0[r] = byte(runeWidthEastAsian(rune(r))) - } - handleEnv() } func mergeIntervals(t1, t2 table) table { @@ -189,13 +252,96 @@ func inWidthTable(r rune, t widthTable) (int, bool) { return 0, false } -func runeWidthEastAsian(r rune) int { +func runeWidthNoLUT(r rune, eastAsian, strictEmojiNeutral bool) int { + tablesOnce.Do(initTables) + if !eastAsian { + if r < 0x20 { + return 0 + } + if (r >= 0x7F && r <= 0x9F) || r == 0xAD { // nonprint + return 0 + } + if r < 0x300 { + return 1 + } + switch { + case inTable(r, zerowidth): + return 0 + case inTable(r, doublewidth): + return 2 + default: + return 1 + } + } + + if r < 0x300 { + return int(strictWidthLUT[1][r]) + } if w, ok := inWidthTable(r, eastAsianWidth); ok { return w } + if !strictEmojiNeutral && inTable(r, emoji) { + return 2 + } return 1 } +// fillBytes sets every byte of b to v. It doubles the copied region on each +// iteration so large slices are filled at memcpy speed instead of one byte +// per loop iteration. +func fillBytes(b []byte, v byte) { + if len(b) == 0 { + return + } + b[0] = v + for i := 1; i < len(b); i *= 2 { + copy(b[i:], b[:i]) + } +} + +// buildStrictWidthLUT builds the strict-width lookup table above 0x300 +// exactly once. It paints whole intervals instead of computing every rune +// through the binary searches in runeWidthNoLUT. It must not write below +// 0x300: that region was filled by init and may be read concurrently. The +// result must stay identical to runeWidthNoLUT(r, eastAsian, true), which +// TestStrictWidthLUT verifies. +func buildStrictWidthLUT() { + strictWidthLUTOnce.Do(func() { + tablesOnce.Do(initTables) + + // paintHigh fills lut with w over each interval, clipped to 0x300+. + paintHigh := func(lut []byte, first, last rune, w byte) { + if first < 0x300 { + if last < 0x300 { + return + } + first = 0x300 + } + fillBytes(lut[first:last+1], w) + } + + // EastAsianWidth=false, StrictEmojiNeutral=true + lut := strictWidthLUT[0][:] + fillBytes(lut[0x300:], 1) + for _, iv := range doublewidth { + paintHigh(lut, iv.first, iv.last, 2) + } + // zerowidth is checked before doublewidth, so it wins on overlap. + for _, iv := range zerowidth { + paintHigh(lut, iv.first, iv.last, 0) + } + + // EastAsianWidth=true, StrictEmojiNeutral=true + lut = strictWidthLUT[1][:] + fillBytes(lut[0x300:], 1) + for _, iv := range eastAsianWidth { + paintHigh(lut, iv.first, iv.last, iv.width) + } + + strictWidthLUTLimit.Store(0x110000) + }) +} + var private = table{ {0x00E000, 0x00F8FF}, {0x0F0000, 0x0FFFFD}, {0x100000, 0x10FFFD}, } @@ -212,6 +358,12 @@ type Condition struct { combinedLut []byte EastAsianWidth bool StrictEmojiNeutral bool + + // Deprecated: ZWJ sequences are always handled through Unicode + // grapheme cluster segmentation now, so this flag has no effect. + // It is kept only for compatibility with code written against + // v0.0.9 and earlier. + ZeroWidthJoiner bool } // NewCondition return new instance of Condition which is current locale. @@ -219,49 +371,47 @@ func NewCondition() *Condition { return &Condition{ EastAsianWidth: EastAsianWidth, StrictEmojiNeutral: StrictEmojiNeutral, + ZeroWidthJoiner: ZeroWidthJoiner, } } // RuneWidth returns the number of cells in r. // See http://www.unicode.org/reports/tr11/ func (c *Condition) RuneWidth(r rune) int { - if r < 0 || r > 0x10FFFF { - return 0 + // This one compare doubles as the range check and the lazy-LUT check: + // out-of-range runes and runes above the built portion of + // strictWidthLUT both take the slow path. Once the LUT is fully built + // the limit is 0x110000 and only invalid runes go slow. + if uint32(r) >= uint32(strictWidthLUTLimit.Load()) { + return c.runeWidthSlow(r) } if len(c.combinedLut) > 0 { return int(c.combinedLut[r>>1]>>(uint(r&1)*4)) & 3 } - // optimized version, verified by TestRuneWidthChecksums() - if !c.EastAsianWidth { - if r < 0x20 { - return 0 - } - if (r >= 0x7F && r <= 0x9F) || r == 0xAD { // nonprint - return 0 - } - if r < 0x300 { - return 1 - } - switch { - case inTable(r, zerowidth): - return 0 - case inTable(r, doublewidth): - return 2 - default: - return 1 + if c.StrictEmojiNeutral { + if c.EastAsianWidth { + return int(strictWidthLUT[1][r]) } + return int(strictWidthLUT[0][r]) } + return runeWidthNoLUT(r, c.EastAsianWidth, c.StrictEmojiNeutral) +} - if r < 0x300 { - return int(eastAsianWidth0[r]) +func (c *Condition) runeWidthSlow(r rune) int { + if r < 0 || r > 0x10FFFF { + return 0 } - if w, ok := inWidthTable(r, eastAsianWidth); ok { - return w + buildStrictWidthLUT() + if len(c.combinedLut) > 0 { + return int(c.combinedLut[r>>1]>>(uint(r&1)*4)) & 3 } - if !c.StrictEmojiNeutral && inTable(r, emoji) { - return 2 + if c.StrictEmojiNeutral { + if c.EastAsianWidth { + return int(strictWidthLUT[1][r]) + } + return int(strictWidthLUT[0][r]) } - return 1 + return runeWidthNoLUT(r, c.EastAsianWidth, c.StrictEmojiNeutral) } // CreateLUT will create an in-memory lookup table of 557056 bytes for faster operation. @@ -285,6 +435,21 @@ func (c *Condition) CreateLUT() { c.combinedLut = lut } +// graphemeWidth returns the width of a single grapheme cluster: the sum of +// the widths of its runes, capped at 2 cells. The cap keeps multi-rune +// sequences that render as a single glyph (ZWJ emoji, flags, Hangul jamo) +// from being counted wider than the two cells terminals give them. +func (c *Condition) graphemeWidth(cluster string) int { + width := 0 + for _, r := range cluster { + width += c.RuneWidth(r) + } + if width > 2 { + width = 2 + } + return width +} + // StringWidth return width as you can see func (c *Condition) StringWidth(s string) (width int) { if len(s) == 1 { @@ -316,14 +481,7 @@ graphemes: width = 0 g := graphemes.FromString(s) for g.Next() { - var chWidth int - for _, r := range g.Value() { - chWidth = c.RuneWidth(r) - if chWidth > 0 { - break // Our best guess at this point is to use the width of the first non-zero-width rune. - } - } - width += chWidth + width += c.graphemeWidth(g.Value()) } return } @@ -338,13 +496,7 @@ func (c *Condition) Truncate(s string, w int, tail string) string { pos := len(s) g := graphemes.FromString(s) for g.Next() { - var chWidth int - for _, r := range g.Value() { - chWidth = c.RuneWidth(r) - if chWidth > 0 { - break // See StringWidth() for details. - } - } + chWidth := c.graphemeWidth(g.Value()) if width+chWidth > w { pos = g.Start() break @@ -365,13 +517,7 @@ func (c *Condition) TruncateLeft(s string, w int, prefix string) string { g := graphemes.FromString(s) for g.Next() { - var chWidth int - for _, r := range g.Value() { - chWidth = c.RuneWidth(r) - if chWidth > 0 { - break // See StringWidth() for details. - } - } + chWidth := c.graphemeWidth(g.Value()) if width+chWidth > w { if width < w { @@ -390,6 +536,32 @@ func (c *Condition) TruncateLeft(s string, w int, prefix string) string { return prefix + s[pos:] } +// TruncatePrefix cuts the beginning of `s` so the result fits in w cells, with prefix prepended +func (c *Condition) TruncatePrefix(s string, w int, prefix string) string { + if c.StringWidth(prefix) >= w { + return prefix + } + + sw := c.StringWidth(s) + if sw <= w { + return s + } + w -= c.StringWidth(prefix) + var width int + var pos int + g := graphemes.FromString(s) + for g.Next() { + chWidth := c.graphemeWidth(g.Value()) + if sw-(width+chWidth) <= w { + pos = g.End() + break + } + width += chWidth + } + + return prefix + s[pos:] +} + // Wrap return string wrapped with w cells func (c *Condition) Wrap(s string, w int) string { width := 0 @@ -419,11 +591,7 @@ func (c *Condition) FillLeft(s string, w int) string { width := c.StringWidth(s) count := w - width if count > 0 { - b := make([]byte, count) - for i := range b { - b[i] = ' ' - } - return string(b) + s + return strings.Repeat(" ", count) + s } return s } @@ -433,11 +601,7 @@ func (c *Condition) FillRight(s string, w int) string { width := c.StringWidth(s) count := w - width if count > 0 { - b := make([]byte, count) - for i := range b { - b[i] = ' ' - } - return s + string(b) + return s + strings.Repeat(" ", count) } return s } @@ -478,6 +642,11 @@ func TruncateLeft(s string, w int, prefix string) string { return DefaultCondition.TruncateLeft(s, w, prefix) } +// TruncatePrefix cuts the beginning of `s` so the result fits in w cells, with prefix prepended +func TruncatePrefix(s string, w int, prefix string) string { + return DefaultCondition.TruncatePrefix(s, w, prefix) +} + // Wrap return string wrapped with w cells func Wrap(s string, w int) string { return DefaultCondition.Wrap(s, w) diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go index 5a31d738..16673af3 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go @@ -5,35 +5,50 @@ package runewidth import ( "os" - "regexp" "strings" ) -var reLoc = regexp.MustCompile(`^[a-z][a-z][a-z]?(?:_[A-Z][A-Z])?\.(.+)`) +func mblen(charset string) int { + switch charset { + case "utf-8", "utf8": + return 6 + case "jis": + return 8 + case "eucjp": + return 3 + case "euckr", "euccn", "sjis", "cp932", "cp51932", "cp936", "cp949", "cp950", "big5", "gbk", "gb2312": + return 2 + } + return 1 +} -var mblenTable = map[string]int{ - "utf-8": 6, - "utf8": 6, - "jis": 8, - "eucjp": 3, - "euckr": 2, - "euccn": 2, - "sjis": 2, - "cp932": 2, - "cp51932": 2, - "cp936": 2, - "cp949": 2, - "cp950": 2, - "big5": 2, - "gbk": 2, - "gb2312": 2, +// localeCharset extracts the charset part of a locale name of the form +// "ll.CHARSET" or "ll_CC.CHARSET" (two- or three-letter language code, +// optional uppercase country code). It returns "" if locale does not have +// that shape. +func localeCharset(locale string) string { + n := 0 + for n < len(locale) && locale[n] >= 'a' && locale[n] <= 'z' { + n++ + } + if n < 2 || n > 3 { + return "" + } + rest := locale[n:] + if len(rest) >= 3 && rest[0] == '_' && + rest[1] >= 'A' && rest[1] <= 'Z' && rest[2] >= 'A' && rest[2] <= 'Z' { + rest = rest[3:] + } + if len(rest) >= 2 && rest[0] == '.' { + return rest[1:] + } + return "" } func isEastAsian(locale string) bool { charset := strings.ToLower(locale) - r := reLoc.FindStringSubmatch(locale) - if len(r) == 2 { - charset = strings.ToLower(r[1]) + if cs := localeCharset(locale); cs != "" { + charset = strings.ToLower(cs) } if strings.HasSuffix(charset, "@cjk_narrow") { @@ -46,10 +61,7 @@ func isEastAsian(locale string) bool { break } } - max := 1 - if m, ok := mblenTable[charset]; ok { - max = m - } + max := mblen(charset) if max > 1 && (charset[0] != 'u' || strings.HasPrefix(locale, "ja") || strings.HasPrefix(locale, "ko") || diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_table.go b/vendor/github.com/mattn/go-runewidth/runewidth_table.go index cdd003e6..62488d97 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_table.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_table.go @@ -3,23 +3,127 @@ package runewidth var combining = table{ - {0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3}, - {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0CF3, 0x0CF3}, - {0x0D00, 0x0D01}, {0x135D, 0x135F}, {0x180B, 0x180D}, - {0x180F, 0x180F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1ADD}, - {0x1AE0, 0x1AEB}, {0x1B6B, 0x1B73}, {0x1DC0, 0x1DFF}, - {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF}, - {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, - {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1}, - {0xFE00, 0xFE0F}, {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, - {0x10376, 0x1037A}, {0x10EAB, 0x10EAC}, {0x10F46, 0x10F50}, - {0x10F82, 0x10F85}, {0x11300, 0x11301}, {0x1133B, 0x1133C}, - {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x16AF0, 0x16AF4}, - {0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, - {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, - {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, {0x1E000, 0x1E006}, - {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, - {0x1E026, 0x1E02A}, {0x1E08F, 0x1E08F}, {0x1E8D0, 0x1E8D6}, + {0x0300, 0x036F}, {0x0483, 0x0489}, {0x0591, 0x05BD}, + {0x05BF, 0x05BF}, {0x05C1, 0x05C2}, {0x05C4, 0x05C5}, + {0x05C7, 0x05C7}, {0x0610, 0x061A}, {0x064B, 0x065F}, + {0x0670, 0x0670}, {0x06D6, 0x06DC}, {0x06DF, 0x06E4}, + {0x06E7, 0x06E8}, {0x06EA, 0x06ED}, {0x0711, 0x0711}, + {0x0730, 0x074A}, {0x07A6, 0x07B0}, {0x07EB, 0x07F3}, + {0x07FD, 0x07FD}, {0x0816, 0x0819}, {0x081B, 0x0823}, + {0x0825, 0x0827}, {0x0829, 0x082D}, {0x0859, 0x085B}, + {0x0897, 0x089F}, {0x08CA, 0x08E1}, {0x08E3, 0x0902}, + {0x093A, 0x093A}, {0x093C, 0x093C}, {0x0941, 0x0948}, + {0x094D, 0x094D}, {0x0951, 0x0957}, {0x0962, 0x0963}, + {0x0981, 0x0981}, {0x09BC, 0x09BC}, {0x09C1, 0x09C4}, + {0x09CD, 0x09CD}, {0x09E2, 0x09E3}, {0x09FE, 0x09FE}, + {0x0A01, 0x0A02}, {0x0A3C, 0x0A3C}, {0x0A41, 0x0A42}, + {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, + {0x0A70, 0x0A71}, {0x0A75, 0x0A75}, {0x0A81, 0x0A82}, + {0x0ABC, 0x0ABC}, {0x0AC1, 0x0AC5}, {0x0AC7, 0x0AC8}, + {0x0ACD, 0x0ACD}, {0x0AE2, 0x0AE3}, {0x0AFA, 0x0AFF}, + {0x0B01, 0x0B01}, {0x0B3C, 0x0B3C}, {0x0B3F, 0x0B3F}, + {0x0B41, 0x0B44}, {0x0B4D, 0x0B4D}, {0x0B55, 0x0B56}, + {0x0B62, 0x0B63}, {0x0B82, 0x0B82}, {0x0BC0, 0x0BC0}, + {0x0BCD, 0x0BCD}, {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, + {0x0C3C, 0x0C3C}, {0x0C3E, 0x0C40}, {0x0C46, 0x0C48}, + {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, {0x0C62, 0x0C63}, + {0x0C81, 0x0C81}, {0x0CBC, 0x0CBC}, {0x0CBF, 0x0CBF}, + {0x0CC6, 0x0CC6}, {0x0CCC, 0x0CCD}, {0x0CE2, 0x0CE3}, + {0x0CF3, 0x0CF3}, {0x0D00, 0x0D01}, {0x0D3B, 0x0D3C}, + {0x0D41, 0x0D44}, {0x0D4D, 0x0D4D}, {0x0D62, 0x0D63}, + {0x0D81, 0x0D81}, {0x0DCA, 0x0DCA}, {0x0DD2, 0x0DD4}, + {0x0DD6, 0x0DD6}, {0x0E31, 0x0E31}, {0x0E34, 0x0E3A}, + {0x0E47, 0x0E4E}, {0x0EB1, 0x0EB1}, {0x0EB4, 0x0EBC}, + {0x0EC8, 0x0ECE}, {0x0F18, 0x0F19}, {0x0F35, 0x0F35}, + {0x0F37, 0x0F37}, {0x0F39, 0x0F39}, {0x0F71, 0x0F7E}, + {0x0F80, 0x0F84}, {0x0F86, 0x0F87}, {0x0F8D, 0x0F97}, + {0x0F99, 0x0FBC}, {0x0FC6, 0x0FC6}, {0x102D, 0x1030}, + {0x1032, 0x1037}, {0x1039, 0x103A}, {0x103D, 0x103E}, + {0x1058, 0x1059}, {0x105E, 0x1060}, {0x1071, 0x1074}, + {0x1082, 0x1082}, {0x1085, 0x1086}, {0x108D, 0x108D}, + {0x109D, 0x109D}, {0x135D, 0x135F}, {0x1712, 0x1714}, + {0x1732, 0x1733}, {0x1752, 0x1753}, {0x1772, 0x1773}, + {0x17B4, 0x17B5}, {0x17B7, 0x17BD}, {0x17C6, 0x17C6}, + {0x17C9, 0x17D3}, {0x17DD, 0x17DD}, {0x180B, 0x180D}, + {0x180F, 0x180F}, {0x1885, 0x1886}, {0x18A9, 0x18A9}, + {0x1920, 0x1922}, {0x1927, 0x1928}, {0x1932, 0x1932}, + {0x1939, 0x193B}, {0x1A17, 0x1A18}, {0x1A1B, 0x1A1B}, + {0x1A56, 0x1A56}, {0x1A58, 0x1A5E}, {0x1A60, 0x1A60}, + {0x1A62, 0x1A62}, {0x1A65, 0x1A6C}, {0x1A73, 0x1A7C}, + {0x1A7F, 0x1A7F}, {0x1AB0, 0x1ADD}, {0x1AE0, 0x1AEB}, + {0x1B00, 0x1B03}, {0x1B34, 0x1B34}, {0x1B36, 0x1B3A}, + {0x1B3C, 0x1B3C}, {0x1B42, 0x1B42}, {0x1B6B, 0x1B73}, + {0x1B80, 0x1B81}, {0x1BA2, 0x1BA5}, {0x1BA8, 0x1BA9}, + {0x1BAB, 0x1BAD}, {0x1BE6, 0x1BE6}, {0x1BE8, 0x1BE9}, + {0x1BED, 0x1BED}, {0x1BEF, 0x1BF1}, {0x1C2C, 0x1C33}, + {0x1C36, 0x1C37}, {0x1CD0, 0x1CD2}, {0x1CD4, 0x1CE0}, + {0x1CE2, 0x1CE8}, {0x1CED, 0x1CED}, {0x1CF4, 0x1CF4}, + {0x1CF8, 0x1CF9}, {0x1DC0, 0x1DFF}, {0x20D0, 0x20F0}, + {0x2CEF, 0x2CF1}, {0x2D7F, 0x2D7F}, {0x2DE0, 0x2DFF}, + {0x302A, 0x302D}, {0x3099, 0x309A}, {0xA66F, 0xA672}, + {0xA674, 0xA67D}, {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, + {0xA802, 0xA802}, {0xA806, 0xA806}, {0xA80B, 0xA80B}, + {0xA825, 0xA826}, {0xA82C, 0xA82C}, {0xA8C4, 0xA8C5}, + {0xA8E0, 0xA8F1}, {0xA8FF, 0xA8FF}, {0xA926, 0xA92D}, + {0xA947, 0xA951}, {0xA980, 0xA982}, {0xA9B3, 0xA9B3}, + {0xA9B6, 0xA9B9}, {0xA9BC, 0xA9BD}, {0xA9E5, 0xA9E5}, + {0xAA29, 0xAA2E}, {0xAA31, 0xAA32}, {0xAA35, 0xAA36}, + {0xAA43, 0xAA43}, {0xAA4C, 0xAA4C}, {0xAA7C, 0xAA7C}, + {0xAAB0, 0xAAB0}, {0xAAB2, 0xAAB4}, {0xAAB7, 0xAAB8}, + {0xAABE, 0xAABF}, {0xAAC1, 0xAAC1}, {0xAAEC, 0xAAED}, + {0xAAF6, 0xAAF6}, {0xABE5, 0xABE5}, {0xABE8, 0xABE8}, + {0xABED, 0xABED}, {0xFB1E, 0xFB1E}, {0xFE00, 0xFE0F}, + {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x102E0, 0x102E0}, + {0x10376, 0x1037A}, {0x10A01, 0x10A03}, {0x10A05, 0x10A06}, + {0x10A0C, 0x10A0F}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A3F}, + {0x10AE5, 0x10AE6}, {0x10D24, 0x10D27}, {0x10D69, 0x10D6D}, + {0x10EAB, 0x10EAC}, {0x10EFA, 0x10EFF}, {0x10F46, 0x10F50}, + {0x10F82, 0x10F85}, {0x11001, 0x11001}, {0x11038, 0x11046}, + {0x11070, 0x11070}, {0x11073, 0x11074}, {0x1107F, 0x11081}, + {0x110B3, 0x110B6}, {0x110B9, 0x110BA}, {0x110C2, 0x110C2}, + {0x11100, 0x11102}, {0x11127, 0x1112B}, {0x1112D, 0x11134}, + {0x11173, 0x11173}, {0x11180, 0x11181}, {0x111B6, 0x111BE}, + {0x111C9, 0x111CC}, {0x111CF, 0x111CF}, {0x1122F, 0x11231}, + {0x11234, 0x11234}, {0x11236, 0x11237}, {0x1123E, 0x1123E}, + {0x11241, 0x11241}, {0x112DF, 0x112DF}, {0x112E3, 0x112EA}, + {0x11300, 0x11301}, {0x1133B, 0x1133C}, {0x11340, 0x11340}, + {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x113BB, 0x113C0}, + {0x113CE, 0x113CE}, {0x113D0, 0x113D0}, {0x113D2, 0x113D2}, + {0x113E1, 0x113E2}, {0x11438, 0x1143F}, {0x11442, 0x11444}, + {0x11446, 0x11446}, {0x1145E, 0x1145E}, {0x114B3, 0x114B8}, + {0x114BA, 0x114BA}, {0x114BF, 0x114C0}, {0x114C2, 0x114C3}, + {0x115B2, 0x115B5}, {0x115BC, 0x115BD}, {0x115BF, 0x115C0}, + {0x115DC, 0x115DD}, {0x11633, 0x1163A}, {0x1163D, 0x1163D}, + {0x1163F, 0x11640}, {0x116AB, 0x116AB}, {0x116AD, 0x116AD}, + {0x116B0, 0x116B5}, {0x116B7, 0x116B7}, {0x1171D, 0x1171D}, + {0x1171F, 0x1171F}, {0x11722, 0x11725}, {0x11727, 0x1172B}, + {0x1182F, 0x11837}, {0x11839, 0x1183A}, {0x1193B, 0x1193C}, + {0x1193E, 0x1193E}, {0x11943, 0x11943}, {0x119D4, 0x119D7}, + {0x119DA, 0x119DB}, {0x119E0, 0x119E0}, {0x11A01, 0x11A0A}, + {0x11A33, 0x11A38}, {0x11A3B, 0x11A3E}, {0x11A47, 0x11A47}, + {0x11A51, 0x11A56}, {0x11A59, 0x11A5B}, {0x11A8A, 0x11A96}, + {0x11A98, 0x11A99}, {0x11B60, 0x11B60}, {0x11B62, 0x11B64}, + {0x11B66, 0x11B66}, {0x11C30, 0x11C36}, {0x11C38, 0x11C3D}, + {0x11C3F, 0x11C3F}, {0x11C92, 0x11CA7}, {0x11CAA, 0x11CB0}, + {0x11CB2, 0x11CB3}, {0x11CB5, 0x11CB6}, {0x11D31, 0x11D36}, + {0x11D3A, 0x11D3A}, {0x11D3C, 0x11D3D}, {0x11D3F, 0x11D45}, + {0x11D47, 0x11D47}, {0x11D90, 0x11D91}, {0x11D95, 0x11D95}, + {0x11D97, 0x11D97}, {0x11EF3, 0x11EF4}, {0x11F00, 0x11F01}, + {0x11F36, 0x11F3A}, {0x11F40, 0x11F40}, {0x11F42, 0x11F42}, + {0x11F5A, 0x11F5A}, {0x13440, 0x13440}, {0x13447, 0x13455}, + {0x1611E, 0x16129}, {0x1612D, 0x1612F}, {0x16AF0, 0x16AF4}, + {0x16B30, 0x16B36}, {0x16F4F, 0x16F4F}, {0x16F8F, 0x16F92}, + {0x16FE4, 0x16FE4}, {0x1BC9D, 0x1BC9E}, {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, + {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD}, + {0x1D242, 0x1D244}, {0x1DA00, 0x1DA36}, {0x1DA3B, 0x1DA6C}, + {0x1DA75, 0x1DA75}, {0x1DA84, 0x1DA84}, {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, + {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, + {0x1E08F, 0x1E08F}, {0x1E130, 0x1E136}, {0x1E2AE, 0x1E2AE}, + {0x1E2EC, 0x1E2EF}, {0x1E4EC, 0x1E4EF}, {0x1E5EE, 0x1E5EF}, + {0x1E6E3, 0x1E6E3}, {0x1E6E6, 0x1E6E6}, {0x1E6EE, 0x1E6EF}, + {0x1E6F5, 0x1E6F5}, {0x1E8D0, 0x1E8D6}, {0x1E944, 0x1E94A}, {0xE0100, 0xE01EF}, } diff --git a/vendor/modules.txt b/vendor/modules.txt index 551ab96d..3ed3eec7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -12,14 +12,14 @@ code.cloudfoundry.org/bbs/format # code.cloudfoundry.org/bbs/models v1.8.0 ## explicit; go 1.26.2 code.cloudfoundry.org/bbs/models -# code.cloudfoundry.org/bytefmt v0.78.0 +# code.cloudfoundry.org/bytefmt v0.86.0 ## explicit; go 1.25.0 code.cloudfoundry.org/bytefmt # code.cloudfoundry.org/cfhttp/v2 v2.83.0 ## explicit; go 1.25.0 code.cloudfoundry.org/cfhttp/v2 -# code.cloudfoundry.org/cli/v8 v8.18.4 -## explicit; go 1.26.4 +# code.cloudfoundry.org/cli/v8 v8.19.0 +## explicit; go 1.26.7 code.cloudfoundry.org/cli/v8/actor/actionerror code.cloudfoundry.org/cli/v8/actor/sharedaction code.cloudfoundry.org/cli/v8/actor/v7action @@ -69,7 +69,7 @@ code.cloudfoundry.org/cli/v8/util/trace code.cloudfoundry.org/cli/v8/util/ui code.cloudfoundry.org/cli/v8/util/unique code.cloudfoundry.org/cli/v8/version -# code.cloudfoundry.org/clock v1.76.0 +# code.cloudfoundry.org/clock v1.84.0 ## explicit; go 1.25.0 code.cloudfoundry.org/clock # code.cloudfoundry.org/go-log-cache/v2 v2.0.7 @@ -90,7 +90,7 @@ code.cloudfoundry.org/jsonry/internal/tree ## explicit; go 1.25.0 code.cloudfoundry.org/lager/v3 code.cloudfoundry.org/lager/v3/internal/truncate -# code.cloudfoundry.org/tlsconfig v0.60.0 +# code.cloudfoundry.org/tlsconfig v0.65.0 ## explicit; go 1.25.8 code.cloudfoundry.org/tlsconfig # code.cloudfoundry.org/ykk v0.0.0-20170424192843-e4df4ce2fd4d @@ -204,8 +204,8 @@ github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.22 ## explicit; go 1.21 github.com/mattn/go-isatty -# github.com/mattn/go-runewidth v0.0.24 -## explicit; go 1.20 +# github.com/mattn/go-runewidth v0.0.28 +## explicit; go 1.23 github.com/mattn/go-runewidth # github.com/moby/term v0.5.2 ## explicit; go 1.18 @@ -559,7 +559,7 @@ gopkg.in/tomb.v1 # gopkg.in/yaml.v2 v2.4.0 ## explicit; go 1.15 gopkg.in/yaml.v2 -# k8s.io/apimachinery v0.36.2 +# k8s.io/apimachinery v0.36.4 ## explicit; go 1.26.0 k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta @@ -602,7 +602,7 @@ k8s.io/apimachinery/pkg/util/yaml k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/client-go v0.36.2 +# k8s.io/client-go v0.36.4 ## explicit; go 1.26.0 k8s.io/client-go/features k8s.io/client-go/pkg/apis/clientauthentication