diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4b03c0..7267e92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,8 @@ jobs: uses: golangci/golangci-lint-action@36fe29c8f9dc696b104db0f7d49d1a87d2bbcd5b with: # Use a commit hash from https://github.com/golangci/golangci-lint/commits/main. - version: v2.11.4 + # Only supported when `install-mode` is `goinstall`. + version: 1500d9b7e750fcdc8ae4063b37a0190cc8ba7feb install-mode: goinstall args: --config=.golangci.yml --timeout=10m diff --git a/go.mod b/go.mod index 9e65870..5c95df9 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.26 require ( github.com/getkin/kin-openapi v0.136.0 - github.com/golang/glog v1.2.5 github.com/pkg/errors v0.9.1 - github.com/pulumi/pulumi/pkg/v3 v3.230.0 - github.com/pulumi/pulumi/sdk/v3 v3.230.0 + github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3 v3.103.2-0.20260424115536-036e8b30f046 + github.com/pulumi/pulumi/pkg/v3 v3.232.0 + github.com/pulumi/pulumi/sdk/v3 v3.232.0 github.com/stretchr/testify v1.11.1 ) @@ -26,7 +26,7 @@ require ( github.com/charmbracelet/bubbletea v1.3.10 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/lipgloss v1.1.0 // indirect - github.com/charmbracelet/x/ansi v0.11.6 // indirect + github.com/charmbracelet/x/ansi v0.11.7 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect github.com/cheggaaa/pb v1.0.29 // indirect @@ -35,7 +35,6 @@ require ( github.com/cloudflare/circl v1.6.3 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/djherbis/times v1.6.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -51,13 +50,11 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/google/uuid v1.6.0 - github.com/gorilla/mux v1.8.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-version v1.9.0 // indirect - github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/hcl/v2 v2.22.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect @@ -92,7 +89,6 @@ require ( github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect github.com/pulumi/esc v0.23.0 // indirect github.com/pulumi/inflector v0.2.1 // indirect - github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3 v3.103.1 github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect @@ -110,12 +106,11 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/woodsbury/decimal128 v1.3.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/zclconf/go-cty v1.14.4 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/collector/featuregate v1.55.0 // indirect - go.opentelemetry.io/collector/pdata v1.55.0 // indirect + go.opentelemetry.io/collector/featuregate v1.56.0 // indirect + go.opentelemetry.io/collector/pdata v1.56.0 // indirect go.opentelemetry.io/otel v1.43.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 // indirect @@ -125,17 +120,17 @@ require ( go.opentelemetry.io/proto/otlp v1.10.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.49.0 // indirect + golang.org/x/crypto v0.50.0 // indirect golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect - golang.org/x/mod v0.33.0 // indirect - golang.org/x/net v0.52.0 // indirect + golang.org/x/mod v0.34.0 // indirect + golang.org/x/net v0.53.0 // indirect golang.org/x/sync v0.20.0 // indirect golang.org/x/sys v0.43.0 // indirect - golang.org/x/term v0.41.0 // indirect - golang.org/x/text v0.35.0 // indirect - golang.org/x/tools v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260406210006-6f92a3bedf2d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d // indirect + golang.org/x/term v0.42.0 // indirect + golang.org/x/text v0.36.0 // indirect + golang.org/x/tools v0.43.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260420184626-e10c466a9529 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260420184626-e10c466a9529 // indirect google.golang.org/grpc v1.80.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect @@ -143,4 +138,7 @@ require ( lukechampine.com/frand v1.5.1 // indirect ) -require github.com/pgavlin/fx/v2 v2.0.10 // indirect +require ( + github.com/deckarep/golang-set/v2 v2.5.0 // indirect + github.com/pgavlin/fx/v2 v2.0.12 // indirect +) diff --git a/go.sum b/go.sum index e04c7b1..35abeef 100644 --- a/go.sum +++ b/go.sum @@ -96,8 +96,8 @@ github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= -github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8= -github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= +github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dAYC84jI= +github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ= github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= @@ -117,8 +117,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.5.0 h1:hn6cEZtQ0h3J8kFrHR/NrzyOoTnjgW1+FmNJzQ7y/sA= +github.com/deckarep/golang-set/v2 v2.5.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c= github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= @@ -176,8 +176,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang/glog v1.2.5 h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I= -github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= @@ -197,10 +195,10 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= -github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= -github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -222,8 +220,8 @@ github.com/hashicorp/go-sockaddr v1.0.6 h1:RSG8rKU28VTUTvEKghe5gIhIQpv8evvNpnDEy github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/go-version v1.9.0 h1:CeOIz6k+LoN3qX9Z0tyQrPtiB1DFYRPfCIBtaXPSCnA= github.com/hashicorp/go-version v1.9.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= -github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.22.0 h1:hkZ3nCtqeJsDhPRFz5EA9iwcG1hNWGePOTw6oyul12M= github.com/hashicorp/hcl/v2 v2.22.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/vault/api v1.12.0 h1:meCpJSesvzQyao8FCOgk2fGdoADAnbDu2WPJN1lDLJ4= @@ -315,8 +313,8 @@ github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pgavlin/fx v0.1.6 h1:r9jEg69DhNoCd3Xh0+5mIbdbS3PqWrVWujkY76MFRTU= github.com/pgavlin/fx v0.1.6/go.mod h1:KWZJ6fqBBSh8GxHYqwYCf3rYE7Gp2p0N8tJp8xv9u9M= -github.com/pgavlin/fx/v2 v2.0.10 h1:ggyQ6pB+lEQEbEae48Wh/X221eLOamMD7i01ISe88u4= -github.com/pgavlin/fx/v2 v2.0.10/go.mod h1:M/nF/ooAOy+NUBooYYXl2REARzJ/giPJxfMs8fINfKc= +github.com/pgavlin/fx/v2 v2.0.12 h1:SjjaJ68Dt8Z4zHwOpY/RPijd7lShs6xYupJbF9ra00M= +github.com/pgavlin/fx/v2 v2.0.12/go.mod h1:M/nF/ooAOy+NUBooYYXl2REARzJ/giPJxfMs8fINfKc= github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386 h1:LoCV5cscNVWyK5ChN/uCoIFJz8jZD63VQiGJIRgr6uo= github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386/go.mod h1:MRxHTJrf9FhdfNQ8Hdeh9gmHevC9RJE/fu8M3JIGjoE= github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4= @@ -336,12 +334,12 @@ github.com/pulumi/esc v0.23.0 h1:5lOXO+5vvXOEQxXw7cTuYhjg9lVng23f9XNLWDR9EP4= github.com/pulumi/esc v0.23.0/go.mod h1:mkghIFn/TvN3XnP4jmCB4U5BG1I4UjGluARi39ckrCE= github.com/pulumi/inflector v0.2.1 h1:bqyiish3tq//vLeLiEstSFE5K7RNjy/ce47ed4QATu8= github.com/pulumi/inflector v0.2.1/go.mod h1:HUFCjcPTz96YtTuUlwG3i3EZG4WlniBvR9bd+iJxCUY= -github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3 v3.103.1 h1:g04apzDR0UbF1f+TNtAmbj3T1WVdwTLNAhyKw/dMg5I= -github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3 v3.103.1/go.mod h1:21ULKvDIGaXBH0qGAWD+WmDwoHuXoMhjQWQN7359ZNg= -github.com/pulumi/pulumi/pkg/v3 v3.230.0 h1:SHjHvXskFXG/aSA2/f8ZTzHizX51nBoqzA76WpmYaRo= -github.com/pulumi/pulumi/pkg/v3 v3.230.0/go.mod h1:+PTJHGM/8Z9c85DFr53Q9FQGlfu8U0gvhSoQBsIpAWI= -github.com/pulumi/pulumi/sdk/v3 v3.230.0 h1:0TtF82Hlor39DLU0QtM7RZPwRaOmjn5UtQKPi1Mxo9M= -github.com/pulumi/pulumi/sdk/v3 v3.230.0/go.mod h1:u0fgmmPGwV5b4rmfuNABuYfRoqckuaTivufPn4EtfTk= +github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3 v3.103.2-0.20260424115536-036e8b30f046 h1:+NoPCq8rsZRXquI8dvOzv/XrdRMTTdz3NltGvu3F1+Q= +github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3 v3.103.2-0.20260424115536-036e8b30f046/go.mod h1:ceLn43TAMXb+QZNCvqQUVusciDdf4ffjcPg5rI6X7iA= +github.com/pulumi/pulumi/pkg/v3 v3.232.0 h1:XEfFaUvhZazyo9AHYQoaJ0H0rfkL1sfc8qROXyi7D7I= +github.com/pulumi/pulumi/pkg/v3 v3.232.0/go.mod h1:KWvm9fb1yvVDgJxqWSD026l5PA+z3Mk14bWIf4YZHZ8= +github.com/pulumi/pulumi/sdk/v3 v3.232.0 h1:pU9j5qYHYtYZGaIKha1KFuB9ggp2obcMD1U523tpEnk= +github.com/pulumi/pulumi/sdk/v3 v3.232.0/go.mod h1:33NoTpvQXlTtAuaPbompgZNA3Ye4XEvxNydELFlWza8= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= @@ -393,8 +391,8 @@ github.com/woodsbury/decimal128 v1.3.0 h1:8pffMNWIlC0O5vbyHWFZAt5yWvWcrHA+3ovIIj github.com/woodsbury/decimal128 v1.3.0/go.mod h1:C5UTmyTjW3JftjUFzOVhC20BEQa2a4ZKOB5I6Zjb+ds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= @@ -411,12 +409,12 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= 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/collector/featuregate v1.55.0 h1:s/bE8135+8GZpVlQ9qLXQjvprE9KNOGsLhNkqm+EDEU= -go.opentelemetry.io/collector/featuregate v1.55.0/go.mod h1:PS7zY/zaCb28EqciePVwRHVhc3oKortTFXsi3I6ee4g= -go.opentelemetry.io/collector/internal/testutil v0.149.0 h1:OWfUPO3NFKSaJtz/SBZph/2ENHbr/VbzzlBadKUhm8o= -go.opentelemetry.io/collector/internal/testutil v0.149.0/go.mod h1:Jkjs6rkqs973LqgZ0Fe3zrokQRKULYXPIf4HuqStiEE= -go.opentelemetry.io/collector/pdata v1.55.0 h1:WBgye8bo8koUyV9Vmp/r2Q3lgDezdsgfKDQAaM1oT2I= -go.opentelemetry.io/collector/pdata v1.55.0/go.mod h1:6jPrbM4tuliCPACDznjFtxnnHisfKfzwrBVoeuESYuk= +go.opentelemetry.io/collector/featuregate v1.56.0 h1:NjcbOZkdCSXddAJmFLdO+pv1gmAgrU6sC5PBga2KlKI= +go.opentelemetry.io/collector/featuregate v1.56.0/go.mod h1:4ga1QBMPEejXXmpyJS8lmaRpknJ3Lb9Bvk6e420bUFU= +go.opentelemetry.io/collector/internal/testutil v0.150.0 h1:J4PLQGPfbLVaL5eI1aMc0m0TMixV9wzBhNhoHU00J0I= +go.opentelemetry.io/collector/internal/testutil v0.150.0/go.mod h1:Jkjs6rkqs973LqgZ0Fe3zrokQRKULYXPIf4HuqStiEE= +go.opentelemetry.io/collector/pdata v1.56.0 h1:W+QAfN2Iz8SNss1T5JNzRWFnw+7oP1vXBQH9ZuOJkXY= +go.opentelemetry.io/collector/pdata v1.56.0/go.mod h1:usR9utboXufbD1rp1oJy+3smQXXpZ+CsI3WN7QsiOs0= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= @@ -458,26 +456,26 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= -golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 h1:R9PFI6EUdfVKgwKjZef7QIwGcBKu86OEFpJ9nUEP2l4= golang.org/x/exp v0.0.0-20250718183923-645b1fa84792/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= -golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= +golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= +golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= -golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= -golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ= -golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= +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= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -500,13 +498,13 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= -golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= +golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -515,8 +513,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= -golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= +golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= +golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -529,10 +527,10 @@ google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 h1:ImUcDPHjTrAqNhlOkSocDLfG9rrNHH7w7uoKWPaWZ8s= google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7/go.mod h1:/3XmxOjePkvmKrHuBy4zNFw7IzxJXtAgdpXi8Ll990U= -google.golang.org/genproto/googleapis/api v0.0.0-20260406210006-6f92a3bedf2d h1:/aDRtSZJjyLQzm75d+a1wOJaqyKBMvIAfeQmoa3ORiI= -google.golang.org/genproto/googleapis/api v0.0.0-20260406210006-6f92a3bedf2d/go.mod h1:etfGUgejTiadZAUaEP14NP97xi1RGeawqkjDARA/UOs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d h1:wT2n40TBqFY6wiwazVK9/iTWbsQrgk5ZfCSVFLO9LQA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto/googleapis/api v0.0.0-20260420184626-e10c466a9529 h1:zUWMZsvo/IJcD1t6MNCPO/azZTwz0TvwCBqr5aifoVY= +google.golang.org/genproto/googleapis/api v0.0.0-20260420184626-e10c466a9529/go.mod h1:a5OGAgyRr4lqco7AG9hQM9Fwh0N2ZV4grR0eXFEsXQg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260420184626-e10c466a9529 h1:XF8+t6QQiS0o9ArVan/HW8Q7cycNPGsJf6GA2nXxYAg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260420184626-e10c466a9529/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= diff --git a/pkg/bug_103_test.go b/pkg/bug_103_test.go index d977078..327f865 100644 --- a/pkg/bug_103_test.go +++ b/pkg/bug_103_test.go @@ -16,7 +16,7 @@ func TestBug103(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } providerMetadata, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/bug_105_test.go b/pkg/bug_105_test.go index cfb2ee1..0de7090 100644 --- a/pkg/bug_105_test.go +++ b/pkg/bug_105_test.go @@ -18,7 +18,7 @@ func TestBug104(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } providerMetadata, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/bug_131_test.go b/pkg/bug_131_test.go index 26ba2a4..211ab11 100644 --- a/pkg/bug_131_test.go +++ b/pkg/bug_131_test.go @@ -16,7 +16,7 @@ func TestBug131(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } providerMetadata, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/common_path_params_test.go b/pkg/common_path_params_test.go index 0fc69e6..7b9f68a 100644 --- a/pkg/common_path_params_test.go +++ b/pkg/common_path_params_test.go @@ -18,7 +18,7 @@ func TestCommonPathParams(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } _, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/dont_override_response_prop_test.go b/pkg/dont_override_response_prop_test.go index baf9c5c..4936844 100644 --- a/pkg/dont_override_response_prop_test.go +++ b/pkg/dont_override_response_prop_test.go @@ -19,7 +19,7 @@ func TestDontOverrideResponseProp(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } _, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/enum_item_name_collision_test.go b/pkg/enum_item_name_collision_test.go index 7d25c3b..5b0a45e 100644 --- a/pkg/enum_item_name_collision_test.go +++ b/pkg/enum_item_name_collision_test.go @@ -19,7 +19,7 @@ func TestEnumItemNameCollision(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } _, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/exclusion_integration_test.go b/pkg/exclusion_integration_test.go index 8717231..9f988c6 100644 --- a/pkg/exclusion_integration_test.go +++ b/pkg/exclusion_integration_test.go @@ -1,12 +1,15 @@ package pkg import ( + "net/http" "testing" "github.com/cloudy-sky-software/pulschema/pkg/exclusions" "github.com/stretchr/testify/assert" ) +const testDebugWildcardPath = "/debug/*" + // TestExclusionIntegration tests the new exclusion feature with OpenAPIContext func TestExclusionIntegration(t *testing.T) { // Test 1: Backward compatibility with ExcludedPaths @@ -21,10 +24,10 @@ func TestExclusionIntegration(t *testing.T) { assert.NotNil(t, evaluator) // Test exclusions - assert.True(t, evaluator.ShouldExclude("GET", "/health")) - assert.True(t, evaluator.ShouldExclude("POST", "/health")) - assert.True(t, evaluator.ShouldExclude("GET", "/metrics")) - assert.False(t, evaluator.ShouldExclude("GET", "/api/users")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/health")) + assert.True(t, evaluator.ShouldExclude(http.MethodPost, "/health")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/metrics")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/api/users")) }) // Test 2: New wildcard exclusions @@ -41,10 +44,10 @@ func TestExclusionIntegration(t *testing.T) { evaluator, err := exclusions.NewExclusionEvaluator(ctx.Exclusions, nil) assert.NoError(t, err) - assert.True(t, evaluator.ShouldExclude("GET", "/internal/debug")) - assert.True(t, evaluator.ShouldExclude("POST", "/internal/debug")) - assert.False(t, evaluator.ShouldExclude("GET", "/internal/debug/deep")) - assert.False(t, evaluator.ShouldExclude("GET", "/api/users")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/internal/debug")) + assert.True(t, evaluator.ShouldExclude(http.MethodPost, "/internal/debug")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/internal/debug/deep")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/api/users")) }) // Test 3: Method-specific exclusions @@ -52,8 +55,8 @@ func TestExclusionIntegration(t *testing.T) { ctx := &OpenAPIContext{ Exclusions: []exclusions.Exclusion{ { - Method: "GET", - PathPattern: "/debug/*", + Method: http.MethodGet, + PathPattern: testDebugWildcardPath, PatternType: exclusions.PatternTypeWildcard, }, }, @@ -62,9 +65,9 @@ func TestExclusionIntegration(t *testing.T) { evaluator, err := exclusions.NewExclusionEvaluator(ctx.Exclusions, nil) assert.NoError(t, err) - assert.True(t, evaluator.ShouldExclude("GET", "/debug/metrics")) - assert.False(t, evaluator.ShouldExclude("POST", "/debug/metrics")) - assert.False(t, evaluator.ShouldExclude("GET", "/api/debug")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/debug/metrics")) + assert.False(t, evaluator.ShouldExclude(http.MethodPost, "/debug/metrics")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/api/debug")) }) // Test 4: Regex exclusions @@ -81,10 +84,10 @@ func TestExclusionIntegration(t *testing.T) { evaluator, err := exclusions.NewExclusionEvaluator(ctx.Exclusions, nil) assert.NoError(t, err) - assert.True(t, evaluator.ShouldExclude("GET", "/api/v1/test/endpoint")) - assert.True(t, evaluator.ShouldExclude("POST", "/api/v2/test/resource")) - assert.False(t, evaluator.ShouldExclude("GET", "/api/vX/test/endpoint")) - assert.False(t, evaluator.ShouldExclude("GET", "/api/v1/prod/endpoint")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/api/v1/test/endpoint")) + assert.True(t, evaluator.ShouldExclude(http.MethodPost, "/api/v2/test/resource")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/api/vX/test/endpoint")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/api/v1/prod/endpoint")) }) // Test 5: Mixed configuration @@ -93,8 +96,8 @@ func TestExclusionIntegration(t *testing.T) { ExcludedPaths: []string{"/health"}, Exclusions: []exclusions.Exclusion{ { - Method: "GET", - PathPattern: "/debug/*", + Method: http.MethodGet, + PathPattern: testDebugWildcardPath, PatternType: exclusions.PatternTypeWildcard, }, { @@ -108,16 +111,16 @@ func TestExclusionIntegration(t *testing.T) { assert.NoError(t, err) // Legacy exclusion - assert.True(t, evaluator.ShouldExclude("GET", "/health")) - assert.True(t, evaluator.ShouldExclude("POST", "/health")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/health")) + assert.True(t, evaluator.ShouldExclude(http.MethodPost, "/health")) // Method-specific exclusion - assert.True(t, evaluator.ShouldExclude("GET", "/debug/metrics")) - assert.False(t, evaluator.ShouldExclude("POST", "/debug/metrics")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/debug/metrics")) + assert.False(t, evaluator.ShouldExclude(http.MethodPost, "/debug/metrics")) // Wildcard exclusion (all methods) - assert.True(t, evaluator.ShouldExclude("GET", "/internal/a/b/c")) - assert.True(t, evaluator.ShouldExclude("DELETE", "/internal/x/y/z")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/internal/a/b/c")) + assert.True(t, evaluator.ShouldExclude(http.MethodDelete, "/internal/x/y/z")) }) // Test 6: Invalid configuration error handling @@ -146,8 +149,8 @@ func TestExclusionIntegration(t *testing.T) { }, // Exclude GET requests to debug endpoints { - Method: "GET", - PathPattern: "/debug/*", + Method: http.MethodGet, + PathPattern: testDebugWildcardPath, PatternType: exclusions.PatternTypeWildcard, }, // Exclude versioned test endpoints using regex @@ -157,12 +160,12 @@ func TestExclusionIntegration(t *testing.T) { }, // Exclude specific admin operations { - Method: "POST", + Method: http.MethodPost, PathPattern: "/admin/users", PatternType: exclusions.PatternTypeExact, }, { - Method: "DELETE", + Method: http.MethodDelete, PathPattern: "/admin/users", PatternType: exclusions.PatternTypeExact, }, @@ -174,14 +177,14 @@ func TestExclusionIntegration(t *testing.T) { assert.Equal(t, 5, evaluator.Count()) // Test each exclusion - assert.True(t, evaluator.ShouldExclude("GET", "/internal/secret")) - assert.True(t, evaluator.ShouldExclude("GET", "/debug/metrics")) - assert.False(t, evaluator.ShouldExclude("POST", "/debug/metrics")) - assert.True(t, evaluator.ShouldExclude("GET", "/api/v1/test/foo")) - assert.False(t, evaluator.ShouldExclude("GET", "/api/v1/prod/foo")) - assert.True(t, evaluator.ShouldExclude("POST", "/admin/users")) - assert.True(t, evaluator.ShouldExclude("DELETE", "/admin/users")) - assert.False(t, evaluator.ShouldExclude("GET", "/admin/users")) - assert.False(t, evaluator.ShouldExclude("PATCH", "/admin/users")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/internal/secret")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/debug/metrics")) + assert.False(t, evaluator.ShouldExclude(http.MethodPost, "/debug/metrics")) + assert.True(t, evaluator.ShouldExclude(http.MethodGet, "/api/v1/test/foo")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/api/v1/prod/foo")) + assert.True(t, evaluator.ShouldExclude(http.MethodPost, "/admin/users")) + assert.True(t, evaluator.ShouldExclude(http.MethodDelete, "/admin/users")) + assert.False(t, evaluator.ShouldExclude(http.MethodGet, "/admin/users")) + assert.False(t, evaluator.ShouldExclude(http.MethodPatch, "/admin/users")) }) } diff --git a/pkg/exclusions/evaluator.go b/pkg/exclusions/evaluator.go index abc9ca4..d34e3c0 100644 --- a/pkg/exclusions/evaluator.go +++ b/pkg/exclusions/evaluator.go @@ -2,6 +2,7 @@ package exclusions import ( "fmt" + "net/http" "slices" "strings" ) @@ -98,7 +99,7 @@ func validateExclusion(excl *Exclusion) error { // Validate method if specified. if excl.Method != "" { method := strings.ToUpper(excl.Method) - validMethods := []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"} + validMethods := []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete, http.MethodHead, http.MethodOptions, http.MethodConnect, http.MethodTrace} valid := slices.Contains(validMethods, method) if !valid { return fmt.Errorf("invalid HTTP method: %s", excl.Method) diff --git a/pkg/exclusions/evaluator_test.go b/pkg/exclusions/evaluator_test.go index 4ce3f27..1ec6157 100644 --- a/pkg/exclusions/evaluator_test.go +++ b/pkg/exclusions/evaluator_test.go @@ -1,9 +1,16 @@ package exclusions import ( + "net/http" "testing" ) +const ( + testAPIPostsPath = "/api/posts" + testAPIUsersWildPath = "/api/users/*" + testInvalidValue = "invalid" +) + func TestNewExclusionEvaluator(t *testing.T) { tests := []struct { name string @@ -20,23 +27,23 @@ func TestNewExclusionEvaluator(t *testing.T) { }, { name: "only legacy paths", - legacyPaths: []string{"/api/users", "/api/posts"}, + legacyPaths: []string{"/api/users", testAPIPostsPath}, wantCount: 2, }, { name: "only new exclusions", exclusions: []Exclusion{ - {PathPattern: "/api/users/*", PatternType: PatternTypeWildcard}, - {Method: "GET", PathPattern: "/api/posts", PatternType: PatternTypeExact}, + {PathPattern: testAPIUsersWildPath, PatternType: PatternTypeWildcard}, + {Method: http.MethodGet, PathPattern: testAPIPostsPath, PatternType: PatternTypeExact}, }, wantCount: 2, }, { name: "mixed legacy and new", exclusions: []Exclusion{ - {PathPattern: "/api/users/*"}, + {PathPattern: testAPIUsersWildPath}, }, - legacyPaths: []string{"/api/posts"}, + legacyPaths: []string{testAPIPostsPath}, wantCount: 2, }, { @@ -56,7 +63,7 @@ func TestNewExclusionEvaluator(t *testing.T) { { name: "invalid exclusion - invalid pattern type", exclusions: []Exclusion{ - {PathPattern: "/api/users", PatternType: "invalid"}, + {PathPattern: "/api/users", PatternType: testInvalidValue}, }, wantErr: true, }, @@ -70,11 +77,11 @@ func TestNewExclusionEvaluator(t *testing.T) { { name: "valid methods", exclusions: []Exclusion{ - {Method: "GET", PathPattern: "/api/users"}, - {Method: "post", PathPattern: "/api/posts"}, // lowercase should work - {Method: "PUT", PathPattern: "/api/items"}, - {Method: "PATCH", PathPattern: "/api/items"}, - {Method: "DELETE", PathPattern: "/api/items"}, + {Method: http.MethodGet, PathPattern: "/api/users"}, + {Method: "post", PathPattern: testAPIPostsPath}, // lowercase should work + {Method: http.MethodPut, PathPattern: "/api/items"}, + {Method: http.MethodPatch, PathPattern: "/api/items"}, + {Method: http.MethodDelete, PathPattern: "/api/items"}, }, wantCount: 5, }, @@ -122,42 +129,42 @@ func TestExclusionEvaluator_ShouldExclude(t *testing.T) { path string want bool }{ - {"GET", "/api/users", true}, - {"POST", "/api/users", true}, - {"GET", "/api/users/123", false}, - {"GET", "/api/posts", false}, + {http.MethodGet, "/api/users", true}, + {http.MethodPost, "/api/users", true}, + {http.MethodGet, "/api/users/123", false}, + {http.MethodGet, testAPIPostsPath, false}, }, }, { name: "wildcard pattern - all methods", exclusions: []Exclusion{ - {PathPattern: "/api/users/*"}, + {PathPattern: testAPIUsersWildPath}, }, testCases: []struct { method string path string want bool }{ - {"GET", "/api/users/123", true}, - {"POST", "/api/users/123", true}, - {"DELETE", "/api/users/123", true}, - {"GET", "/api/users", false}, - {"GET", "/api/users/123/posts", false}, + {http.MethodGet, "/api/users/123", true}, + {http.MethodPost, "/api/users/123", true}, + {http.MethodDelete, "/api/users/123", true}, + {http.MethodGet, "/api/users", false}, + {http.MethodGet, "/api/users/123/posts", false}, }, }, { name: "wildcard pattern - specific method", exclusions: []Exclusion{ - {Method: "GET", PathPattern: "/api/users/*"}, + {Method: http.MethodGet, PathPattern: testAPIUsersWildPath}, }, testCases: []struct { method string path string want bool }{ - {"GET", "/api/users/123", true}, - {"POST", "/api/users/123", false}, - {"DELETE", "/api/users/123", false}, + {http.MethodGet, "/api/users/123", true}, + {http.MethodPost, "/api/users/123", false}, + {http.MethodDelete, "/api/users/123", false}, }, }, { @@ -170,10 +177,10 @@ func TestExclusionEvaluator_ShouldExclude(t *testing.T) { path string want bool }{ - {"GET", "/internal/debug", true}, - {"GET", "/internal/debug/metrics", true}, - {"GET", "/internal/debug/metrics/cpu", true}, - {"GET", "/api/internal/debug", false}, + {http.MethodGet, "/internal/debug", true}, + {http.MethodGet, "/internal/debug/metrics", true}, + {http.MethodGet, "/internal/debug/metrics/cpu", true}, + {http.MethodGet, "/api/internal/debug", false}, }, }, { @@ -186,17 +193,17 @@ func TestExclusionEvaluator_ShouldExclude(t *testing.T) { path string want bool }{ - {"GET", "/api/v1/internal/debug", true}, - {"GET", "/api/v2/internal/metrics", true}, - {"GET", "/api/vX/internal/debug", false}, - {"GET", "/api/v1/public/users", false}, + {http.MethodGet, "/api/v1/internal/debug", true}, + {http.MethodGet, "/api/v2/internal/metrics", true}, + {http.MethodGet, "/api/vX/internal/debug", false}, + {http.MethodGet, "/api/v1/public/users", false}, }, }, { name: "multiple exclusions", exclusions: []Exclusion{ - {Method: "GET", PathPattern: "/api/users/*"}, - {Method: "POST", PathPattern: "/api/posts/*"}, + {Method: http.MethodGet, PathPattern: testAPIUsersWildPath}, + {Method: http.MethodPost, PathPattern: "/api/posts/*"}, {PathPattern: "/internal/**"}, }, testCases: []struct { @@ -204,12 +211,12 @@ func TestExclusionEvaluator_ShouldExclude(t *testing.T) { path string want bool }{ - {"GET", "/api/users/123", true}, - {"POST", "/api/users/123", false}, - {"POST", "/api/posts/456", true}, - {"GET", "/api/posts/456", false}, - {"DELETE", "/internal/debug", true}, - {"GET", "/internal/metrics/cpu", true}, + {http.MethodGet, "/api/users/123", true}, + {http.MethodPost, "/api/users/123", false}, + {http.MethodPost, "/api/posts/456", true}, + {http.MethodGet, "/api/posts/456", false}, + {http.MethodDelete, "/internal/debug", true}, + {http.MethodGet, "/internal/metrics/cpu", true}, }, }, { @@ -222,7 +229,7 @@ func TestExclusionEvaluator_ShouldExclude(t *testing.T) { path string want bool }{ - {"GET", "/api/users", true}, + {http.MethodGet, "/api/users", true}, {"get", "/api/users", true}, {"Get", "/api/users", true}, }, @@ -249,8 +256,8 @@ func TestExclusionEvaluator_ShouldExclude(t *testing.T) { func TestExclusionEvaluator_GetMatchingExclusions(t *testing.T) { exclusions := []Exclusion{ - {Method: "GET", PathPattern: "/api/users/*", PatternType: PatternTypeWildcard}, - {Method: "GET", PathPattern: "/api/v1/users/*", PatternType: PatternTypeWildcard}, + {Method: http.MethodGet, PathPattern: testAPIUsersWildPath, PatternType: PatternTypeWildcard}, + {Method: http.MethodGet, PathPattern: "/api/v1/users/*", PatternType: PatternTypeWildcard}, {PathPattern: "/internal/**", PatternType: PatternTypeWildcard}, {PathPattern: "^/api/v[0-9]+/.*", PatternType: PatternTypeRegex}, } @@ -268,25 +275,25 @@ func TestExclusionEvaluator_GetMatchingExclusions(t *testing.T) { }{ { name: "single match", - method: "GET", + method: http.MethodGet, path: "/api/users/123", wantCount: 1, }, { name: "multiple matches", - method: "GET", + method: http.MethodGet, path: "/api/v1/users/123", wantCount: 2, // matches both GET /api/users/* and regex }, { name: "no matches", - method: "POST", - path: "/api/posts", + method: http.MethodPost, + path: testAPIPostsPath, wantCount: 0, }, { name: "internal path matches all methods", - method: "DELETE", + method: http.MethodDelete, path: "/internal/debug", wantCount: 1, }, @@ -314,33 +321,33 @@ func TestEndpointMatcher_Matches(t *testing.T) { }{ { name: "exact method and path match", - matcherMethod: "GET", + matcherMethod: http.MethodGet, matcherPattern: "/api/users", - testMethod: "GET", + testMethod: http.MethodGet, testPath: "/api/users", want: true, }, { name: "method mismatch", - matcherMethod: "GET", + matcherMethod: http.MethodGet, matcherPattern: "/api/users", - testMethod: "POST", + testMethod: http.MethodPost, testPath: "/api/users", want: false, }, { name: "path mismatch", - matcherMethod: "GET", + matcherMethod: http.MethodGet, matcherPattern: "/api/users", - testMethod: "GET", - testPath: "/api/posts", + testMethod: http.MethodGet, + testPath: testAPIPostsPath, want: false, }, { name: "all methods wildcard", matcherMethod: "", matcherPattern: "/api/users", - testMethod: "DELETE", + testMethod: http.MethodDelete, testPath: "/api/users", want: true, }, @@ -369,8 +376,8 @@ func TestValidateExclusion(t *testing.T) { { name: "valid exclusion", exclusion: Exclusion{ - Method: "GET", - PathPattern: "/api/users/*", + Method: http.MethodGet, + PathPattern: testAPIUsersWildPath, PatternType: PatternTypeWildcard, }, wantErr: false, @@ -394,21 +401,21 @@ func TestValidateExclusion(t *testing.T) { name: "invalid pattern type", exclusion: Exclusion{ PathPattern: "/api/users", - PatternType: "invalid", + PatternType: testInvalidValue, }, wantErr: true, }, { name: "valid - no method", exclusion: Exclusion{ - PathPattern: "/api/users/*", + PathPattern: testAPIUsersWildPath, }, wantErr: false, }, { name: "valid - no pattern type (defaults to wildcard)", exclusion: Exclusion{ - PathPattern: "/api/users/*", + PathPattern: testAPIUsersWildPath, }, wantErr: false, }, diff --git a/pkg/get_empty_response_body_test.go b/pkg/get_empty_response_body_test.go index 47e77fa..89b9d67 100644 --- a/pkg/get_empty_response_body_test.go +++ b/pkg/get_empty_response_body_test.go @@ -16,7 +16,7 @@ func TestGetEmptyResponseBody(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } providerMetadata, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/multiple_paths_using_same_refs_test.go b/pkg/multiple_paths_using_same_refs_test.go index 0a5f6bb..682b1b8 100644 --- a/pkg/multiple_paths_using_same_refs_test.go +++ b/pkg/multiple_paths_using_same_refs_test.go @@ -21,7 +21,7 @@ func TestMultiplePathsUsingSameRef(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } count := 0 diff --git a/pkg/openapi.go b/pkg/openapi.go index 01c0e5e..161560e 100644 --- a/pkg/openapi.go +++ b/pkg/openapi.go @@ -4,14 +4,13 @@ package pkg import ( "fmt" + "log/slog" "net/http" "regexp" "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/golang/glog" - "github.com/pkg/errors" dotnetgen "github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/codegen" @@ -142,7 +141,7 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri o.exclusionEvaluator = evaluator if evaluator.Count() > 0 { - glog.V(1).Infof("Loaded %d exclusion rules", evaluator.Count()) + slog.Debug("Loaded exclusion rules", "count", evaluator.Count()) } o.resourceCRUDMap = make(map[string]*CRUDOperationsMap) @@ -187,7 +186,7 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri // Skip this entire path if ALL methods are excluded allMethodsExcluded := len(methods) > 0 && allExcluded(o.exclusionEvaluator, methods, path) if allMethodsExcluded { - glog.V(2).Infof("Excluding all methods for path %s", path) + slog.Debug("Excluding all methods for path", "path", path) continue } @@ -195,17 +194,17 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri csharpNamespaces[module] = moduleToPascalCase(module) } - glog.V(3).Infof("Processing path %s as %s\n", path, currentPath) + slog.Debug("Processing path", "path", path, "currentPath", currentPath) if pathItem.Get != nil { if o.exclusionEvaluator.ShouldExclude("GET", path) { - glog.V(2).Infof("Excluding GET %s", path) + slog.Debug("Excluding GET", "path", path) continue } contract.Assertf(pathItem.Get.OperationID != "", "operationId is missing for path GET %s", currentPath) - glog.V(3).Infof("GET: Parent path for %s is %s\n", currentPath, parentPath) + slog.Debug("GET: Parent path", "currentPath", currentPath, "parentPath", parentPath) // GET endpoints may not have a response body at all. // For example, ad-hoc actions like restarting a VM or @@ -291,13 +290,13 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri if pathItem.Patch != nil { if o.exclusionEvaluator.ShouldExclude("PATCH", path) { - glog.V(2).Infof("Excluding PATCH %s", path) + slog.Debug("Excluding PATCH", "path", path) continue } contract.Assertf(pathItem.Patch.OperationID != "", "operationId is missing for path PATCH %s", currentPath) - glog.V(3).Infof("PATCH: Parent path for %s is %s\n", currentPath, parentPath) + slog.Debug("PATCH: Parent path", "currentPath", currentPath, "parentPath", parentPath) jsonReq := pathItem.Patch.RequestBody.Value.Content.Get(jsonMimeType) if jsonReq.Schema.Value == nil { @@ -355,13 +354,13 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri if pathItem.Put != nil { if o.exclusionEvaluator.ShouldExclude("PUT", path) { - glog.V(2).Infof("Excluding PUT %s", path) + slog.Debug("Excluding PUT", "path", path) continue } contract.Assertf(pathItem.Put.OperationID != "", "operationId is missing for path PUT %s", currentPath) - glog.V(3).Infof("PUT: Parent path for %s is %s\n", currentPath, parentPath) + slog.Debug("PUT: Parent path", "currentPath", currentPath, "parentPath", parentPath) jsonReq := pathItem.Put.RequestBody.Value.Content.Get(jsonMimeType) if jsonReq.Schema.Value == nil { @@ -397,13 +396,13 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri if pathItem.Delete != nil { if o.exclusionEvaluator.ShouldExclude("DELETE", path) { - glog.V(2).Infof("Excluding DELETE %s", path) + slog.Debug("Excluding DELETE", "path", path) continue } contract.Assertf(pathItem.Delete.OperationID != "", "operationId is missing for path DELETE %s", currentPath) - glog.V(3).Infof("DELETE: Parent path for %s is %s\n", currentPath, parentPath) + slog.Debug("DELETE: Parent path", "currentPath", currentPath, "parentPath", parentPath) setDeleteOperationMapping := func(tok string) { if existing, ok := o.resourceCRUDMap[tok]; ok { @@ -450,7 +449,7 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri } if o.exclusionEvaluator.ShouldExclude("POST", path) { - glog.V(2).Infof("Excluding POST %s", path) + slog.Debug("Excluding POST", "path", path) continue } @@ -561,7 +560,7 @@ func (o *OpenAPIContext) GatherResourcesFromAPI(csharpNamespaces map[string]stri func (o *OpenAPIContext) genListFunc(pathItem openapi3.PathItem, returnTypeSchema openapi3.SchemaRef, module, funcName string) (*pschema.FunctionSpec, error) { parentName := ToPascalCase(funcName) if funcName == "listReservedIPs" { - glog.Info("HELLO!") + slog.Info("HELLO!") } funcPkgCtx := &resourceContext{ mod: module, @@ -796,7 +795,7 @@ func (o *OpenAPIContext) gatherResource( } if len(resourceRequestType.OneOf) > 0 { - glog.Infof("OneOf definition missing discriminator. Will treat it as AllOf for resource %s. All input properties will be optional.", resourceName) + slog.Info("OneOf definition missing discriminator. Will treat it as AllOf. All input properties will be optional.", "resource", resourceName) schemaRefs := resourceRequestType.OneOf for _, schemaRef := range schemaRefs { schemaRef.Value.Required = nil @@ -986,7 +985,7 @@ func (o *OpenAPIContext) gatherResourceProperties(resourceName string, requestBo // (or should) have this property already, // so ignore it. if propSchema == nil { - glog.Warningf("Schema not found for required property: %s (type: %s)", requiredProp, resourceName) + slog.Warn("Schema not found for required property", "property", requiredProp, "type", resourceName) continue } @@ -1458,7 +1457,7 @@ func (ctx *resourceContext) genPropertiesFromAllOf(parentName string, allOf open for _, schemaRef := range allOf { if schemaRef.Ref == "" && !schemaRef.Value.Type.Is(openapi3.TypeObject) { - glog.Warningf("Prop type %s uses allOf schema but one of the schema refs is invalid", parentName) + slog.Warn("Prop type uses allOf schema but one of the schema refs is invalid", "parentName", parentName) continue } diff --git a/pkg/prefix_enum_type_on_collision_test.go b/pkg/prefix_enum_type_on_collision_test.go index f0dc451..7274b35 100644 --- a/pkg/prefix_enum_type_on_collision_test.go +++ b/pkg/prefix_enum_type_on_collision_test.go @@ -20,7 +20,7 @@ func TestGenEnumType(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } _, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/put_create_resource_with_path_param_test.go b/pkg/put_create_resource_with_path_param_test.go index e5a530b..5e87251 100644 --- a/pkg/put_create_resource_with_path_param_test.go +++ b/pkg/put_create_resource_with_path_param_test.go @@ -18,7 +18,7 @@ func TestPutCreateResourceWithPathParam(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } metadata, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/resource_inputs_oneof_no_discriminator_test.go b/pkg/resource_inputs_oneof_no_discriminator_test.go index b4640d9..bd43fac 100644 --- a/pkg/resource_inputs_oneof_no_discriminator_test.go +++ b/pkg/resource_inputs_oneof_no_discriminator_test.go @@ -20,7 +20,7 @@ func TestResourceInputsWithOneOfNoDiscriminator(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } _, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/resource_naming.go b/pkg/resource_naming.go index e0824d8..f296274 100644 --- a/pkg/resource_naming.go +++ b/pkg/resource_naming.go @@ -2,11 +2,11 @@ package pkg import ( "fmt" + "log/slog" "net/http" "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/golang/glog" "github.com/google/uuid" ) @@ -142,7 +142,7 @@ func getResourceTitleFromOperationID(originalOperationID, method string, isSepar resourceTitle := ToPascalCase(result) - glog.Infof("converted operation ID %s to resource title %s\n", originalOperationID, resourceTitle) + slog.Info("converted operation ID to resource title", "operationID", originalOperationID, "resourceTitle", resourceTitle) return resourceTitle } diff --git a/pkg/secret_property_test.go b/pkg/secret_property_test.go index cec4a6c..b9913a4 100644 --- a/pkg/secret_property_test.go +++ b/pkg/secret_property_test.go @@ -18,7 +18,7 @@ func TestSecretProperty(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } _, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/simple_property_ref_test.go b/pkg/simple_property_ref_test.go index 29d03d5..b507268 100644 --- a/pkg/simple_property_ref_test.go +++ b/pkg/simple_property_ref_test.go @@ -19,7 +19,7 @@ func TestSimplePropertyRef(t *testing.T) { } csharpNamespaces := map[string]string{ - "": "Provider", + "": testCSharpProviderName, } _, _, err := openAPICtx.GatherResourcesFromAPI(csharpNamespaces) diff --git a/pkg/testmain_test.go b/pkg/testmain_test.go index 82edfa1..21a8abf 100644 --- a/pkg/testmain_test.go +++ b/pkg/testmain_test.go @@ -14,6 +14,8 @@ import ( const packageName = "fake-package" +const testCSharpProviderName = "Provider" + var testOpenAPIDocBytes []byte var testOpenAPIDoc *openapi3.T