diff --git a/go.mod b/go.mod index 5c3bd1c52ba..881aec52f82 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ replace github.com/hashicorp/boundary/api => ./api replace github.com/hashicorp/boundary/sdk => ./sdk require ( - github.com/fatih/color v1.16.0 + github.com/fatih/color v1.17.0 github.com/fatih/structs v1.1.0 github.com/favadi/protoc-go-inject-tag v1.4.0 github.com/godbus/dbus/v5 v5.1.0 // indirect @@ -46,7 +46,6 @@ require ( github.com/hashicorp/vault/api v1.12.0 github.com/iancoleman/strcase v0.3.0 github.com/jackc/pgconn v1.14.3 - github.com/jackc/pgx/v4 v4.18.3 // indirect github.com/jefferai/keyring v1.1.7-0.20220316160357-58a74bb55891 github.com/kr/pretty v0.3.1 github.com/kr/text v0.2.0 @@ -67,22 +66,22 @@ require ( github.com/stretchr/testify v1.9.0 github.com/zalando/go-keyring v0.2.3 go.uber.org/atomic v1.11.0 - golang.org/x/crypto v0.21.0 - golang.org/x/sync v0.6.0 - golang.org/x/sys v0.20.0 - golang.org/x/term v0.18.0 - golang.org/x/tools v0.17.0 + golang.org/x/crypto v0.25.0 + golang.org/x/sync v0.7.0 + golang.org/x/sys v0.22.0 + golang.org/x/term v0.22.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 google.golang.org/grpc v1.61.1 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 - google.golang.org/protobuf v1.33.0 - gorm.io/driver/postgres v1.5.7 - gorm.io/gorm v1.25.7 // indirect + google.golang.org/protobuf v1.34.2 + gorm.io/driver/postgres v1.5.9 + gorm.io/gorm v1.25.11 // indirect mvdan.cc/gofumpt v0.5.0 nhooyr.io/websocket v1.8.10 ) -require github.com/hashicorp/go-dbw v0.1.3-0.20240312210008-7ed943176e5b +require github.com/hashicorp/go-dbw v0.1.4 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 @@ -96,7 +95,7 @@ require ( github.com/hashicorp/go-rate v0.0.0-20231204194614-cc8d401f70ab github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/nodeenrollment v0.2.13 - github.com/jackc/pgx/v5 v5.5.5 + github.com/jackc/pgx/v5 v5.6.0 github.com/jimlambrt/gldap v0.1.10 github.com/kelseyhightower/envconfig v1.4.0 github.com/miekg/dns v1.1.58 @@ -104,13 +103,13 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/sevlyar/go-daemon v0.1.6 golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 - golang.org/x/net v0.23.0 + golang.org/x/net v0.25.0 google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 ) require ( github.com/dustin/go-humanize v1.0.1 // indirect - github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect + github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect modernc.org/libc v1.41.0 // indirect modernc.org/mathutil v1.6.0 // indirect @@ -137,7 +136,7 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 // indirect go.opentelemetry.io/otel/sdk v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect - gorm.io/driver/sqlite v1.5.5 // indirect + gorm.io/driver/sqlite v1.5.6 // indirect ) require ( @@ -189,8 +188,7 @@ require ( github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgproto3/v2 v2.3.3 // indirect - github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect - github.com/jackc/pgtype v1.14.2 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jefferai/go-libsecret v0.0.0-20210525195240-b53481abef97 // indirect github.com/jefferai/isbadcipher v0.0.0-20190226160619-51d2077c035f // indirect github.com/jinzhu/gorm v1.9.16 // indirect @@ -222,10 +220,10 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/xo/dburl v0.21.1 // indirect - golang.org/x/mod v0.15.0 // indirect + github.com/xo/dburl v0.23.1 // indirect + golang.org/x/mod v0.17.0 // indirect golang.org/x/oauth2 v0.17.0 // indirect - golang.org/x/text v0.14.0 + golang.org/x/text v0.16.0 golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect diff --git a/go.sum b/go.sum index 32cc962fc0c..1cdb774d6eb 100644 --- a/go.sum +++ b/go.sum @@ -63,20 +63,15 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/coreos/go-oidc/v3 v3.9.0 h1:0J/ogVOd4y8P0f0xUh8l9t07xRP/d8tccvjHl2dcsSo= github.com/coreos/go-oidc/v3 v3.9.0/go.mod h1:rTKz2PYwftcrtoCzV5g5kvfJoWcm0Mk8AF8y1iAQro4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -112,8 +107,8 @@ github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DP github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/favadi/protoc-go-inject-tag v1.4.0 h1:K3KXxbgRw5WT4f43LbglARGz/8jVsDOS7uMjG4oNvXY= @@ -151,8 +146,6 @@ github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncV github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-migrate/migrate/v4 v4.17.0 h1:rd40H3QXU0AA4IoLllFcEAEo9dYKRHYND2gB4p7xcaU= @@ -178,7 +171,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -209,8 +201,8 @@ github.com/hashicorp/go-bexpr v0.1.13 h1:HNwp7vZrMpRq8VZXj8VF90LbZpRjQQpim1oJF0D github.com/hashicorp/go-bexpr v0.1.13/go.mod h1:gN7hRKB3s7yT+YvTdnhZVLTENejvhlkZ8UE4YVBS+Q8= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-dbw v0.1.3-0.20240312210008-7ed943176e5b h1:DKThhRxpCyHtmzCwdZUPTSM+DRSOHCUv7eBs+AqIJ7c= -github.com/hashicorp/go-dbw v0.1.3-0.20240312210008-7ed943176e5b/go.mod h1:dEiD86O4U0CNjS6p4xgRLjXCyMfj1DUQtpsnG/ORU38= +github.com/hashicorp/go-dbw v0.1.4 h1:FipsEg7UbWiB8hBQylTYWJobG6jVr0LNoRdo9IClGs4= +github.com/hashicorp/go-dbw v0.1.4/go.mod h1:/YHbfK7mgG9k09aB74Imw3fEOwno0eTtlFTTYGZ7SFk= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-kms-wrapping/extras/kms/v2 v2.0.0-20231219183231-6bac757bb482 h1:1DqTnLaNk658AEenlF4PNGYd9b1hXE/+0jSOBIGOAms= @@ -290,55 +282,23 @@ github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47 github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w= github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag= github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= -github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.14.2 h1:QBdZQTKpPdBlw2AdKwHEyqUcm/lrl2cwWAHjCMyln/o= -github.com/jackc/pgtype v1.14.2/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.18.3 h1:dE2/TrEsGX3RBprb3qryqSV9Y60iZN1C6i8IrmW9/BA= -github.com/jackc/pgx/v4 v4.18.3/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= -github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= -github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= +github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jefferai/go-libsecret v0.0.0-20210525195240-b53481abef97 h1:/jVRo4KmyL3FgEYAqFe+S8nxo6xRkFLm+CvIV0qG7PU= @@ -370,7 +330,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -383,24 +342,18 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= @@ -408,8 +361,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v2.0.1+incompatible h1:xQ15muvnzGBHpIpdrNi1DA5x0+TcBZzsIDwmw9uTHzw= -github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= @@ -489,31 +442,24 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sethvargo/go-diceware v0.3.0 h1:UVVEfmN/uF50JfWAN7nbY6CiAlp5xeSx+5U0lWKkMCQ= github.com/sethvargo/go-diceware v0.3.0/go.mod h1:lH5Q/oSPMivseNdhMERAC7Ti5oOPqsaVddU1BcN1CY0= github.com/sevlyar/go-daemon v0.1.6 h1:EUh1MDjEM4BI109Jign0EaknA2izkOyi0LV3ro3QQGs= github.com/sevlyar/go-daemon v0.1.6/go.mod h1:6dJpPatBT9eUwM5VCw9Bt6CdX9Tk6UWvhW3MebLDRKE= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -525,7 +471,6 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= @@ -557,14 +502,13 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo 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= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xo/dburl v0.21.1 h1:n5mfH1fh51RQbvuaKKykGslodt8pZqyZJMNohVo2zK0= -github.com/xo/dburl v0.21.1/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco= +github.com/xo/dburl v0.23.1 h1:PX1RgQaaJV1S5iADcM1TT39OLrg5daeV6Hp7RYwVoYw= +github.com/xo/dburl v0.23.1/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms= github.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 h1:doUP+ExOpH3spVTLS0FcWGLnQrPct/hD/bCPbDRUEAU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA= go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= @@ -581,10 +525,6 @@ go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6 go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -592,36 +532,23 @@ go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= @@ -630,7 +557,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 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= @@ -638,8 +564,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20211102181907-3a5865c02020/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -648,7 +574,6 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 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-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/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-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -658,8 +583,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= @@ -670,18 +595,14 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -704,9 +625,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -715,46 +635,37 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 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-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= 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= @@ -783,8 +694,8 @@ google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -793,7 +704,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -809,17 +719,16 @@ gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.5.7 h1:8ptbNJTDbEmhdr62uReG5BGkdQyeasu/FZHxI0IMGnM= -gorm.io/driver/postgres v1.5.7/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA= -gorm.io/driver/sqlite v1.5.5 h1:7MDMtUZhV065SilG62E0MquljeArQZNfJnjd9i9gx3E= -gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATavE= -gorm.io/gorm v1.25.7 h1:VsD6acwRjz2zFxGO50gPO6AkNs7KKnvfzUjHQhZDz/A= -gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/driver/postgres v1.5.9 h1:DkegyItji119OlcaLjqN11kHoUgZ/j13E0jkJZgD6A8= +gorm.io/driver/postgres v1.5.9/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI= +gorm.io/driver/sqlite v1.5.6 h1:fO/X46qn5NUEEOZtnjJRWRzZMe8nqJiQ9E+0hi+hKQE= +gorm.io/driver/sqlite v1.5.6/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4= +gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg= +gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= modernc.org/libc v1.41.0 h1:g9YAc6BkKlgORsUWj+JwqoB1wU3o4DE3bM3yvA3k+Gk= modernc.org/libc v1.41.0/go.mod h1:w0eszPsiXoOnoMJgrXjglgLuDy/bt5RR4y3QzUUeodY= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= diff --git a/internal/auth/ldap/auth_method.go b/internal/auth/ldap/auth_method.go index bc0affa030a..4ae52c2f348 100644 --- a/internal/auth/ldap/auth_method.go +++ b/internal/auth/ldap/auth_method.go @@ -141,14 +141,14 @@ func (am *AuthMethod) oplog(ctx context.Context, opType oplog.OpType) (oplog.Met } type convertedValues struct { - Urls []any - Certs []any - UserEntrySearchConf any - GroupEntrySearchConf any - ClientCertificate any - BindCredential any - AccountAttributeMaps []any - DerefAliases any + Urls []*Url + Certs []*Certificate + UserEntrySearchConf *UserEntrySearchConf + GroupEntrySearchConf *GroupEntrySearchConf + ClientCertificate *ClientCertificate + BindCredential *BindCredential + AccountAttributeMaps []*AccountAttributeMap + DerefAliases *DerefAliases } // convertValueObjects converts the embedded value objects. It will return an @@ -199,15 +199,15 @@ func (am *AuthMethod) convertValueObjects(ctx context.Context) (*convertedValues return converted, nil } -// convertCertificates converts any embedded URLs from []string -// to []any where each slice element is a *Url. It will return an error if the -// AuthMethod's public id is not set. -func (am *AuthMethod) convertUrls(ctx context.Context) ([]any, error) { +// convertUrls converts any embedded URLs from []string to []*Url where each +// slice element is a *Url. It will return an error if the AuthMethod's public +// id is not set. +func (am *AuthMethod) convertUrls(ctx context.Context) ([]*Url, error) { const op = "ldap.(AuthMethod).convertUrls" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newValObjs := make([]any, 0, len(am.Urls)) + newValObjs := make([]*Url, 0, len(am.Urls)) for priority, u := range am.Urls { parsed, err := url.Parse(u) if err != nil { @@ -223,14 +223,14 @@ func (am *AuthMethod) convertUrls(ctx context.Context) ([]any, error) { } // convertCertificates converts any embedded certificates from []string -// to []any where each slice element is a *Certificate. It will return an error -// if the AuthMethod's public id is not set. -func (am *AuthMethod) convertCertificates(ctx context.Context) ([]any, error) { +// to []*Certificate. It will return an error if the AuthMethod's public id is +// not set. +func (am *AuthMethod) convertCertificates(ctx context.Context) ([]*Certificate, error) { const op = "ldap.(AuthMethod).convertCertificates" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newValObjs := make([]any, 0, len(am.Certificates)) + newValObjs := make([]*Certificate, 0, len(am.Certificates)) for _, cert := range am.Certificates { obj, err := NewCertificate(ctx, am.PublicId, cert) if err != nil { @@ -242,9 +242,9 @@ func (am *AuthMethod) convertCertificates(ctx context.Context) ([]any, error) { } // convertUserEntrySearchConf converts an embedded user entry search fields -// into an any type. It will return an error if the AuthMethod's public id is -// not set. -func (am *AuthMethod) convertUserEntrySearchConf(ctx context.Context) (any, error) { +// into an *UserEntrySearchConf type. It will return an error if the +// AuthMethod's public id is not set. +func (am *AuthMethod) convertUserEntrySearchConf(ctx context.Context) (*UserEntrySearchConf, error) { const op = "ldap.(AuthMethod).convertUserEntrySearchConf" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") @@ -257,9 +257,9 @@ func (am *AuthMethod) convertUserEntrySearchConf(ctx context.Context) (any, erro } // convertGroupEntrySearchConf converts an embedded group entry search fields -// into an any type. It will return an error if the AuthMethod's public id is -// not set. -func (am *AuthMethod) convertGroupEntrySearchConf(ctx context.Context) (any, error) { +// into an *GroupEntrySearchConf type. It will return an error if the +// AuthMethod's public id is not set. +func (am *AuthMethod) convertGroupEntrySearchConf(ctx context.Context) (*GroupEntrySearchConf, error) { const op = "ldap.(AuthMethod).convertGroupEntrySearchConf" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") @@ -272,9 +272,9 @@ func (am *AuthMethod) convertGroupEntrySearchConf(ctx context.Context) (any, err } // convertClientCertificate converts an embedded client certificate entry into -// an any type. It will return an error if the AuthMethod's public id is not -// set. -func (am *AuthMethod) convertClientCertificate(ctx context.Context) (any, error) { +// an *ClientCertificate type. It will return an error if the AuthMethod's +// public id is not set. +func (am *AuthMethod) convertClientCertificate(ctx context.Context) (*ClientCertificate, error) { const op = "ldap.(AuthMethod).convertClientCertificate" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing auth method id") @@ -287,9 +287,9 @@ func (am *AuthMethod) convertClientCertificate(ctx context.Context) (any, error) } // convertBindCredential converts an embedded bind credential entry into -// an any type. It will return an error if the AuthMethod's public id is not -// set. -func (am *AuthMethod) convertBindCredential(ctx context.Context) (any, error) { +// an *BindCredential type. It will return an error if the AuthMethod's public +// id is not set. +func (am *AuthMethod) convertBindCredential(ctx context.Context) (*BindCredential, error) { const op = "ldap.(AuthMethod).convertBindCredentials" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing auth method id") @@ -302,9 +302,9 @@ func (am *AuthMethod) convertBindCredential(ctx context.Context) (any, error) { } // convertDerefAliases converts an embedded deref aliases entry into -// an any type. It will return an error if the AuthMethod's public id is not -// set. -func (am *AuthMethod) convertDerefAliases(ctx context.Context) (any, error) { +// an *DerefAliases type. It will return an error if the AuthMethod's public id +// is not set. +func (am *AuthMethod) convertDerefAliases(ctx context.Context) (*DerefAliases, error) { const op = "ldap.(AuthMethod).convertDerefAliases" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing auth method id") @@ -317,15 +317,15 @@ func (am *AuthMethod) convertDerefAliases(ctx context.Context) (any, error) { } // convertAccountAttributeMaps converts the embedded account attribute maps from -// []string to []interface{} where each slice element is a *AccountAttributeMap. It -// will return an error if the AuthMethod's public id is not set or it can -// convert the account attribute maps. -func (am *AuthMethod) convertAccountAttributeMaps(ctx context.Context) ([]any, error) { +// []string to []*AccountAttributeMap. It will return an error if the +// AuthMethod's public id is not set or it can convert the account attribute +// maps. +func (am *AuthMethod) convertAccountAttributeMaps(ctx context.Context) ([]*AccountAttributeMap, error) { const op = "ldap.(AuthMethod).convertAccountAttributeMaps" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newInterfaces := make([]any, 0, len(am.AccountAttributeMaps)) + acctAttribMaps := make([]*AccountAttributeMap, 0, len(am.AccountAttributeMaps)) const ( from = 0 to = 1 @@ -343,7 +343,7 @@ func (am *AuthMethod) convertAccountAttributeMaps(ctx context.Context) ([]any, e if err != nil { return nil, errors.Wrap(ctx, err, op) } - newInterfaces = append(newInterfaces, obj) + acctAttribMaps = append(acctAttribMaps, obj) } - return newInterfaces, nil + return acctAttribMaps, nil } diff --git a/internal/auth/ldap/auth_method_test.go b/internal/auth/ldap/auth_method_test.go index d4819504b8d..7fd6d361026 100644 --- a/internal/auth/ldap/auth_method_test.go +++ b/internal/auth/ldap/auth_method_test.go @@ -348,9 +348,9 @@ func Test_convertValueObjects(t *testing.T) { testCerts := []string{pem} c, err := NewCertificate(testCtx, testPublicId, pem) require.NoError(t, err) - testCertificates := []any{c} + testCertificates := []*Certificate{c} - testUrls := make([]any, 0, len(testLdapServers)) + testUrls := make([]*Url, 0, len(testLdapServers)) for priority, uu := range TestConvertToUrls(t, testLdapServers...) { u, err := NewUrl(testCtx, testPublicId, priority+1, uu) require.NoError(t, err) @@ -358,7 +358,7 @@ func Test_convertValueObjects(t *testing.T) { } testAttrMaps := []string{"email_address=email", "display_name=fullName"} - testAccountAttributeMaps := make([]any, 0, len(testAttrMaps)) + testAccountAttributeMaps := make([]*AccountAttributeMap, 0, len(testAttrMaps)) acms, err := ParseAccountAttributeMaps(testCtx, testAttrMaps...) require.NoError(t, err) for _, m := range acms { @@ -618,6 +618,23 @@ func (a converted) Less(i, j int) bool { } func testSortConverted(t *testing.T, c *convertedValues) { - sort.Sort(converted(c.Urls)) - sort.Sort(converted(c.Certs)) + t.Helper() + sort.Sort(sortableUrls(c.Urls)) + sort.Sort(sortableCerts(c.Certs)) +} + +type sortableUrls []*Url + +func (u sortableUrls) Len() int { return len(u) } +func (u sortableUrls) Swap(i, j int) { u[i], u[j] = u[j], u[i] } +func (u sortableUrls) Less(i, j int) bool { + return u[i].GetServerUrl() < u[j].GetServerUrl() +} + +type sortableCerts []*Certificate + +func (c sortableCerts) Len() int { return len(c) } +func (c sortableCerts) Swap(i, j int) { c[i], c[j] = c[j], c[i] } +func (c sortableCerts) Less(i, j int) bool { + return c[i].GetCert() < c[j].GetCert() } diff --git a/internal/auth/ldap/repository_auth_method_create.go b/internal/auth/ldap/repository_auth_method_create.go index 2aee67cb3ca..93ed5290746 100644 --- a/internal/auth/ldap/repository_auth_method_create.go +++ b/internal/auth/ldap/repository_auth_method_create.go @@ -68,20 +68,12 @@ func (r *Repository) CreateAuthMethod(ctx context.Context, am *AuthMethod, opt . } if cv.BindCredential != nil { - bc, ok := cv.BindCredential.(*BindCredential) - if !ok { - return nil, errors.New(ctx, errors.Internal, op, fmt.Sprintf("invalid type (%T) is not a bind credential", cv.BindCredential)) - } - if err := bc.encrypt(ctx, dbWrapper); err != nil { + if err := cv.BindCredential.encrypt(ctx, dbWrapper); err != nil { return nil, errors.Wrap(ctx, err, op, errors.WithMsg("failed to encrypt bind credential")) } } if cv.ClientCertificate != nil { - cc, ok := cv.ClientCertificate.(*ClientCertificate) - if !ok { - return nil, errors.New(ctx, errors.Internal, op, fmt.Sprintf("invalid type (%T) is not a client certificate", cv.ClientCertificate)) - } - if err := cc.encrypt(ctx, dbWrapper); err != nil { + if err := cv.ClientCertificate.encrypt(ctx, dbWrapper); err != nil { return nil, errors.Wrap(ctx, err, op, errors.WithMsg("failed to encrypt client certificate")) } } diff --git a/internal/auth/ldap/repository_auth_method_update.go b/internal/auth/ldap/repository_auth_method_update.go index 2c61c45add5..65acd17f4d1 100644 --- a/internal/auth/ldap/repository_auth_method_update.go +++ b/internal/auth/ldap/repository_auth_method_update.go @@ -155,18 +155,42 @@ func (r *Repository) UpdateAuthMethod(ctx context.Context, am *AuthMethod, versi if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op, errors.WithMsg("unable to get database wrapper")) } - addUrls, deleteUrls, err := valueObjectChanges(ctx, origAm.PublicId, UrlVO, am.Urls, origAm.Urls, dbMask, nullFields) + au, du, err := valueObjectChanges(ctx, origAm.PublicId, UrlVO, am.Urls, origAm.Urls, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op, errors.WithMsg("unable to update urls")) } - addCerts, deleteCerts, err := valueObjectChanges(ctx, origAm.PublicId, CertificateVO, am.Certificates, origAm.Certificates, dbMask, nullFields) + addUrls := []*Url{} + for _, u := range au { + addUrls = append(addUrls, u.(*Url)) + } + deleteUrls := []*Url{} + for _, u := range du { + deleteUrls = append(deleteUrls, u.(*Url)) + } + ac, dc, err := valueObjectChanges(ctx, origAm.PublicId, CertificateVO, am.Certificates, origAm.Certificates, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op, errors.WithMsg("unable to update certificates")) } - addMaps, deleteMaps, err := valueObjectChanges(ctx, origAm.PublicId, AccountAttributeMapsVO, am.AccountAttributeMaps, origAm.AccountAttributeMaps, dbMask, nullFields) + deleteCerts := []*Certificate{} + for _, c := range dc { + deleteCerts = append(deleteCerts, c.(*Certificate)) + } + addCerts := []*Certificate{} + for _, c := range ac { + addCerts = append(addCerts, c.(*Certificate)) + } + addM, deleteM, err := valueObjectChanges(ctx, origAm.PublicId, AccountAttributeMapsVO, am.AccountAttributeMaps, origAm.AccountAttributeMaps, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op, errors.WithMsg("unable to update account attribute maps")) } + addMaps := []*AccountAttributeMap{} + for _, m := range addM { + addMaps = append(addMaps, m.(*AccountAttributeMap)) + } + deleteMaps := []*AccountAttributeMap{} + for _, m := range deleteM { + deleteMaps = append(deleteMaps, m.(*AccountAttributeMap)) + } combinedMasks := append(dbMask, nullFields...) diff --git a/internal/auth/ldap/repository_authenticate.go b/internal/auth/ldap/repository_authenticate.go index 0e758391c51..2b0dfd31407 100644 --- a/internal/auth/ldap/repository_authenticate.go +++ b/internal/auth/ldap/repository_authenticate.go @@ -117,18 +117,13 @@ func (r *Repository) Authenticate(ctx context.Context, authMethodId, loginName, } for _, attrMap := range attrMaps { - aam, ok := attrMap.(*AccountAttributeMap) - if !ok { - return nil, errors.New(ctx, errors.Internal, op, "failed to convert attribute map into AccountAttributeMap type") - } - - switch aam.ToAttribute { + switch attrMap.ToAttribute { case DefaultEmailAttribute: - emailAttr = aam.FromAttribute + emailAttr = attrMap.FromAttribute case DefaultFullNameAttribute: - fullNameAttr = aam.FromAttribute + fullNameAttr = attrMap.FromAttribute default: - return nil, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("invalid to attribute %q", aam.ToAttribute)) + return nil, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("invalid to attribute %q", attrMap.ToAttribute)) } } diff --git a/internal/auth/oidc/auth_method.go b/internal/auth/oidc/auth_method.go index 981a9faef2f..20fb86dd18f 100644 --- a/internal/auth/oidc/auth_method.go +++ b/internal/auth/oidc/auth_method.go @@ -289,12 +289,12 @@ func (am *AuthMethod) isComplete(ctx context.Context) error { } type convertedValues struct { - Algs []any - Auds []any - Certs []any - ClaimsScopes []any - AccountClaimMaps []any - Prompts []any + Algs []*SigningAlg + Auds []*AudClaim + Certs []*Certificate + ClaimsScopes []*ClaimsScope + AccountClaimMaps []*AccountClaimMap + Prompts []*Prompt } // convertValueObjects converts the embedded value objects. It will return an @@ -305,121 +305,113 @@ func (am *AuthMethod) convertValueObjects(ctx context.Context) (*convertedValues return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } var err error - var addAlgs, addAuds, addCerts, addScopes, addAccountClaimMaps, addPrompts []any - if addAlgs, err = am.convertSigningAlgs(ctx); err != nil { + converted := &convertedValues{} + if converted.Algs, err = am.convertSigningAlgs(ctx); err != nil { return nil, errors.Wrap(ctx, err, op) } - if addAuds, err = am.convertAudClaims(ctx); err != nil { + if converted.Auds, err = am.convertAudClaims(ctx); err != nil { return nil, errors.Wrap(ctx, err, op) } - if addCerts, err = am.convertCertificates(ctx); err != nil { + if converted.Certs, err = am.convertCertificates(ctx); err != nil { return nil, errors.Wrap(ctx, err, op) } - if addScopes, err = am.convertClaimsScopes(ctx); err != nil { + if converted.ClaimsScopes, err = am.convertClaimsScopes(ctx); err != nil { return nil, errors.Wrap(ctx, err, op) } - if addAccountClaimMaps, err = am.convertAccountClaimMaps(ctx); err != nil { + if converted.AccountClaimMaps, err = am.convertAccountClaimMaps(ctx); err != nil { return nil, errors.Wrap(ctx, err, op) } - if addPrompts, err = am.convertPrompts(ctx); err != nil { + if converted.Prompts, err = am.convertPrompts(ctx); err != nil { return nil, errors.Wrap(ctx, err, op) } - return &convertedValues{ - Algs: addAlgs, - Auds: addAuds, - Certs: addCerts, - ClaimsScopes: addScopes, - AccountClaimMaps: addAccountClaimMaps, - Prompts: addPrompts, - }, nil + return converted, nil } // convertSigningAlgs converts the embedded signing algorithms from []string -// to []interface{} where each slice element is a *SigningAlg. It will return an -// error if the AuthMethod's public id is not set. -func (am *AuthMethod) convertSigningAlgs(ctx context.Context) ([]any, error) { +// to []*SigningAlg. It will return an error if the AuthMethod's public id is +// not set. +func (am *AuthMethod) convertSigningAlgs(ctx context.Context) ([]*SigningAlg, error) { const op = "oidc.(AuthMethod).convertSigningAlgs" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newInterfaces := make([]any, 0, len(am.SigningAlgs)) + newAlgs := make([]*SigningAlg, 0, len(am.SigningAlgs)) for _, a := range am.SigningAlgs { obj, err := NewSigningAlg(ctx, am.PublicId, Alg(a)) if err != nil { return nil, errors.Wrap(ctx, err, op) } - newInterfaces = append(newInterfaces, obj) + newAlgs = append(newAlgs, obj) } - return newInterfaces, nil + return newAlgs, nil } // convertAudClaims converts the embedded audience claims from []string -// to []interface{} where each slice element is a *AudClaim. It will return an -// error if the AuthMethod's public id is not set. -func (am *AuthMethod) convertAudClaims(ctx context.Context) ([]any, error) { +// to []*AudClaim. It will return an error if the AuthMethod's public id is not +// set. +func (am *AuthMethod) convertAudClaims(ctx context.Context) ([]*AudClaim, error) { const op = "oidc.(AuthMethod).convertAudClaims" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newInterfaces := make([]any, 0, len(am.AudClaims)) + newClaims := make([]*AudClaim, 0, len(am.AudClaims)) for _, a := range am.AudClaims { obj, err := NewAudClaim(ctx, am.PublicId, a) if err != nil { return nil, errors.Wrap(ctx, err, op) } - newInterfaces = append(newInterfaces, obj) + newClaims = append(newClaims, obj) } - return newInterfaces, nil + return newClaims, nil } // convertCertificates converts the embedded certificates from []string -// to []interface{} where each slice element is a *Certificate. It will return an -// error if the AuthMethod's public id is not set. -func (am *AuthMethod) convertCertificates(ctx context.Context) ([]any, error) { +// to []*Certificate. It will return an error if the AuthMethod's public id is +// not set. +func (am *AuthMethod) convertCertificates(ctx context.Context) ([]*Certificate, error) { const op = "oidc.(AuthMethod).convertCertificates" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newInterfaces := make([]any, 0, len(am.Certificates)) + newCerts := make([]*Certificate, 0, len(am.Certificates)) for _, cert := range am.Certificates { obj, err := NewCertificate(ctx, am.PublicId, cert) if err != nil { return nil, errors.Wrap(ctx, err, op) } - newInterfaces = append(newInterfaces, obj) + newCerts = append(newCerts, obj) } - return newInterfaces, nil + return newCerts, nil } // convertClaimsScopes converts the embedded claims scopes from []string -// to []interface{} where each slice element is a *ClaimsScope. It will return an -// error if the AuthMethod's public id is not set. -func (am *AuthMethod) convertClaimsScopes(ctx context.Context) ([]any, error) { +// to []*ClaimsScope. It will return an error if the AuthMethod's public id is +// not set. +func (am *AuthMethod) convertClaimsScopes(ctx context.Context) ([]*ClaimsScope, error) { const op = "oidc.(AuthMethod).convertClaimsScopes" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newInterfaces := make([]any, 0, len(am.ClaimsScopes)) + newClaimsScopes := make([]*ClaimsScope, 0, len(am.ClaimsScopes)) for _, cs := range am.ClaimsScopes { obj, err := NewClaimsScope(ctx, am.PublicId, cs) if err != nil { return nil, errors.Wrap(ctx, err, op) } - newInterfaces = append(newInterfaces, obj) + newClaimsScopes = append(newClaimsScopes, obj) } - return newInterfaces, nil + return newClaimsScopes, nil } // convertAccountClaimMaps converts the embedded account claim maps from -// []string to []interface{} where each slice element is a *AccountClaimMap. It -// will return an error if the AuthMethod's public id is not set or it can -// convert the account claim maps. -func (am *AuthMethod) convertAccountClaimMaps(ctx context.Context) ([]any, error) { +// []string to []*AccountClaimMap. It will return an error if the AuthMethod's +// public id is not set or it can convert the account claim maps. +func (am *AuthMethod) convertAccountClaimMaps(ctx context.Context) ([]*AccountClaimMap, error) { const op = "oidc.(AuthMethod).convertAccountClaimMaps" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newInterfaces := make([]any, 0, len(am.AccountClaimMaps)) + newAccountClaimMaps := make([]*AccountClaimMap, 0, len(am.AccountClaimMaps)) const ( from = 0 to = 1 @@ -437,9 +429,9 @@ func (am *AuthMethod) convertAccountClaimMaps(ctx context.Context) ([]any, error if err != nil { return nil, errors.Wrap(ctx, err, op) } - newInterfaces = append(newInterfaces, obj) + newAccountClaimMaps = append(newAccountClaimMaps, obj) } - return newInterfaces, nil + return newAccountClaimMaps, nil } // ClaimMap defines the To and From of an oidc claim map @@ -477,20 +469,20 @@ func ParseAccountClaimMaps(ctx context.Context, m ...string) ([]ClaimMap, error) } // convertPrompts converts the embedded prompts from []string -// to []interface{} where each slice element is a *Prompt. It will return an -// error if the AuthMethod's public id is not set. -func (am *AuthMethod) convertPrompts(ctx context.Context) ([]any, error) { +// to []*Prompt. It will return an error if the AuthMethod's public id is not +// set. +func (am *AuthMethod) convertPrompts(ctx context.Context) ([]*Prompt, error) { const op = "oidc.(AuthMethod).convertPrompts" if am.PublicId == "" { return nil, errors.New(ctx, errors.InvalidPublicId, op, "missing public id") } - newInterfaces := make([]any, 0, len(am.Prompts)) + newPrompts := make([]*Prompt, 0, len(am.Prompts)) for _, a := range am.Prompts { obj, err := NewPrompt(ctx, am.PublicId, PromptParam(a)) if err != nil { return nil, errors.Wrap(ctx, err, op) } - newInterfaces = append(newInterfaces, obj) + newPrompts = append(newPrompts, obj) } - return newInterfaces, nil + return newPrompts, nil } diff --git a/internal/auth/oidc/auth_method_test.go b/internal/auth/oidc/auth_method_test.go index 11ec01b2ad1..67c7017832e 100644 --- a/internal/auth/oidc/auth_method_test.go +++ b/internal/auth/oidc/auth_method_test.go @@ -550,7 +550,7 @@ func Test_convertValueObjects(t *testing.T) { testPublicId := "test-id" testAlgs := []string{string(RS256), string(RS384)} - var testSigningAlgs []any + var testSigningAlgs []*SigningAlg for _, a := range []Alg{RS256, RS384} { obj, err := NewSigningAlg(ctx, testPublicId, Alg(a)) require.NoError(t, err) @@ -558,7 +558,7 @@ func Test_convertValueObjects(t *testing.T) { } testAuds := []string{"alice", "eve"} - var testAudiences []any + var testAudiences []*AudClaim for _, a := range testAuds { obj, err := NewAudClaim(ctx, testPublicId, a) require.NoError(t, err) @@ -569,10 +569,10 @@ func Test_convertValueObjects(t *testing.T) { testCerts := []string{pem} c, err := NewCertificate(ctx, testPublicId, pem) require.NoError(t, err) - testCertificates := []any{c} + testCertificates := []*Certificate{c} testScopes := []string{"profile", "email"} - testClaimsScopes := make([]any, 0, len(testScopes)) + testClaimsScopes := make([]*ClaimsScope, 0, len(testScopes)) for _, s := range testScopes { obj, err := NewClaimsScope(ctx, testPublicId, s) require.NoError(t, err) @@ -580,7 +580,7 @@ func Test_convertValueObjects(t *testing.T) { } testClaimMaps := []string{"oid=sub", "display_name=name"} - testAccountClaimMaps := make([]any, 0, len(testClaimMaps)) + testAccountClaimMaps := make([]*AccountClaimMap, 0, len(testClaimMaps)) acms, err := ParseAccountClaimMaps(ctx, testClaimMaps...) require.NoError(t, err) for _, m := range acms { @@ -592,7 +592,7 @@ func Test_convertValueObjects(t *testing.T) { } testPrompts := []string{"consent", "select_account"} - testExpectedPrompts := make([]any, 0, len(testPrompts)) + testExpectedPrompts := make([]*Prompt, 0, len(testPrompts)) for _, a := range testPrompts { obj, err := NewPrompt(ctx, testPublicId, PromptParam(a)) require.NoError(t, err) @@ -690,11 +690,11 @@ func Test_convertValueObjects(t *testing.T) { } else { want := make([]*AccountClaimMap, 0, len(tt.wantValues.AccountClaimMaps)) for _, v := range tt.wantValues.AccountClaimMaps { - want = append(want, v.(*AccountClaimMap)) + want = append(want, v) } got := make([]*AccountClaimMap, 0, len(convertedMaps)) for _, v := range convertedMaps { - got = append(got, v.(*AccountClaimMap)) + got = append(got, v) } sort.Slice(want, func(a, b int) bool { return want[a].ToClaim < want[b].ToClaim @@ -730,30 +730,51 @@ func Test_convertValueObjects(t *testing.T) { } } -type converted []any - -func (a converted) Len() int { return len(a) } -func (a converted) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a converted) Less(i, j int) bool { - switch a[i].(type) { - case *SigningAlg: - return a[i].(*SigningAlg).GetAlg() < a[j].(*SigningAlg).GetAlg() - case *Certificate: - return a[i].(*Certificate).GetCert() < a[j].(*Certificate).GetCert() - case *AccountClaimMap: - return a[i].(*AccountClaimMap).GetToClaim() < a[j].(*AccountClaimMap).GetToClaim() - case *AudClaim: - return a[i].(*AudClaim).GetAud() < a[j].(*AudClaim).GetAud() - case *ClaimsScope: - return a[i].(*ClaimsScope).GetScope() < a[j].(*ClaimsScope).GetScope() - } - return false +type sortableAlgs []*SigningAlg + +func (s sortableAlgs) Len() int { return len(s) } +func (s sortableAlgs) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s sortableAlgs) Less(i, j int) bool { + return s[i].GetAlg() < s[j].GetAlg() +} + +type sortableCerts []*Certificate + +func (s sortableCerts) Len() int { return len(s) } +func (s sortableCerts) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s sortableCerts) Less(i, j int) bool { + return s[i].GetCert() < s[j].GetCert() +} + +type sortableAccountClaimMaps []*AccountClaimMap + +func (s sortableAccountClaimMaps) Len() int { return len(s) } +func (s sortableAccountClaimMaps) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s sortableAccountClaimMaps) Less(i, j int) bool { + return s[i].GetFromClaim()+s[i].GetToClaim() < s[j].GetFromClaim()+s[j].GetToClaim() +} + +type sortableAuds []*AudClaim + +func (s sortableAuds) Len() int { return len(s) } +func (s sortableAuds) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s sortableAuds) Less(i, j int) bool { + return s[i].GetAud() < s[j].GetAud() +} + +type sortableClaimsScopes []*ClaimsScope + +func (s sortableClaimsScopes) Len() int { return len(s) } +func (s sortableClaimsScopes) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s sortableClaimsScopes) Less(i, j int) bool { + return s[i].GetScope() < s[j].GetScope() } func testSortConverted(t *testing.T, c *convertedValues) { - sort.Sort(converted(c.Algs)) - sort.Sort(converted(c.Certs)) - sort.Sort(converted(c.AccountClaimMaps)) - sort.Sort(converted(c.Auds)) - sort.Sort(converted(c.ClaimsScopes)) + t.Helper() + sort.Sort(sortableAlgs(c.Algs)) + sort.Sort(sortableCerts(c.Certs)) + sort.Sort(sortableAccountClaimMaps(c.AccountClaimMaps)) + sort.Sort(sortableAuds(c.Auds)) + sort.Sort(sortableClaimsScopes(c.ClaimsScopes)) } diff --git a/internal/auth/oidc/repository_auth_method_update.go b/internal/auth/oidc/repository_auth_method_update.go index 71487422681..12faaacac1a 100644 --- a/internal/auth/oidc/repository_auth_method_update.go +++ b/internal/auth/oidc/repository_auth_method_update.go @@ -155,47 +155,93 @@ func (r *Repository) UpdateAuthMethod(ctx context.Context, am *AuthMethod, versi } } - addAlgs, deleteAlgs, err := valueObjectChanges(ctx, origAm.PublicId, SigningAlgVO, am.SigningAlgs, origAm.SigningAlgs, dbMask, nullFields) + aa, ad, err := valueObjectChanges(ctx, origAm.PublicId, SigningAlgVO, am.SigningAlgs, origAm.SigningAlgs, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op) } + addAlgs := []*SigningAlg{} + for _, a := range aa { + addAlgs = append(addAlgs, a.(*SigningAlg)) + } + deleteAlgs := []*SigningAlg{} + for _, a := range ad { + deleteAlgs = append(deleteAlgs, a.(*SigningAlg)) + } - addCerts, deleteCerts, err := valueObjectChanges(ctx, origAm.PublicId, CertificateVO, am.Certificates, origAm.Certificates, dbMask, nullFields) + ac, dc, err := valueObjectChanges(ctx, origAm.PublicId, CertificateVO, am.Certificates, origAm.Certificates, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op) } + addCerts := []*Certificate{} + for _, c := range ac { + addCerts = append(addCerts, c.(*Certificate)) + } + deleteCerts := []*Certificate{} + for _, c := range dc { + deleteCerts = append(deleteCerts, c.(*Certificate)) + } - addAuds, deleteAuds, err := valueObjectChanges(ctx, origAm.PublicId, AudClaimVO, am.AudClaims, origAm.AudClaims, dbMask, nullFields) + aa, ad, err = valueObjectChanges(ctx, origAm.PublicId, AudClaimVO, am.AudClaims, origAm.AudClaims, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op) } + addAuds := []*AudClaim{} + for _, a := range aa { + addAuds = append(addAuds, a.(*AudClaim)) + } + deleteAuds := []*AudClaim{} + for _, a := range ad { + deleteAuds = append(deleteAuds, a.(*AudClaim)) + } - addScopes, deleteScopes, err := valueObjectChanges(ctx, origAm.PublicId, ClaimsScopesVO, am.ClaimsScopes, origAm.ClaimsScopes, dbMask, nullFields) + as, ds, err := valueObjectChanges(ctx, origAm.PublicId, ClaimsScopesVO, am.ClaimsScopes, origAm.ClaimsScopes, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op) } + addScopes := []*ClaimsScope{} + for _, s := range as { + addScopes = append(addScopes, s.(*ClaimsScope)) + } + deleteScopes := []*ClaimsScope{} + for _, s := range ds { + deleteScopes = append(deleteScopes, s.(*ClaimsScope)) + } - addMaps, deleteMaps, err := valueObjectChanges(ctx, origAm.PublicId, AccountClaimMapsVO, am.AccountClaimMaps, origAm.AccountClaimMaps, dbMask, nullFields) + aacm, dacm, err := valueObjectChanges(ctx, origAm.PublicId, AccountClaimMapsVO, am.AccountClaimMaps, origAm.AccountClaimMaps, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op) } + addMaps := []*AccountClaimMap{} + for _, m := range aacm { + addMaps = append(addMaps, m.(*AccountClaimMap)) + } + deleteMaps := []*AccountClaimMap{} + for _, m := range dacm { + deleteMaps = append(deleteMaps, m.(*AccountClaimMap)) + } - addPrompts, deletePrompts, err := valueObjectChanges(ctx, origAm.PublicId, PromptsVO, am.Prompts, origAm.Prompts, dbMask, nullFields) + ap, dp, err := valueObjectChanges(ctx, origAm.PublicId, PromptsVO, am.Prompts, origAm.Prompts, dbMask, nullFields) if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op) } + addPrompts := []*Prompt{} + for _, p := range ap { + addPrompts = append(addPrompts, p.(*Prompt)) + } + deletePrompts := []*Prompt{} + for _, p := range dp { + deletePrompts = append(deletePrompts, p.(*Prompt)) + } // we don't allow updates for "sub" claim maps, because we have no way to // determine if the updated "from" claim in the map might create collisions // with any existing account's subject. - for _, rawCm := range addMaps { - cm := rawCm.(*AccountClaimMap) + for _, cm := range addMaps { if cm.ToClaim == string(ToSubClaim) { return nil, db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("you cannot update account claim map %s=%s for the \"sub\" claim", cm.FromClaim, cm.ToClaim)) } } - for _, rawCm := range deleteMaps { - cm := rawCm.(*AccountClaimMap) + for _, cm := range deleteMaps { if cm.ToClaim == string(ToSubClaim) { return nil, db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("you cannot update account claim map %s=%s for the \"sub\" claim", cm.FromClaim, cm.ToClaim)) } diff --git a/internal/auth/oidc/repository_managed_group_members.go b/internal/auth/oidc/repository_managed_group_members.go index 1cb3b587440..96e04b60b9c 100644 --- a/internal/auth/oidc/repository_managed_group_members.go +++ b/internal/auth/oidc/repository_managed_group_members.go @@ -117,7 +117,7 @@ func (r *Repository) SetManagedGroupMemberships(ctx context.Context, am *AuthMet } // Figure out which ones to delete and which ones we already have - toDelete := make([]any, 0, len(mgs)) + toDelete := make([]*ManagedGroupMemberAccount, 0, len(mgs)) for _, currMg := range currentMemberships { currMgId := currMg.ManagedGroupId if newMgPublicIds[currMgId] { @@ -161,7 +161,7 @@ func (r *Repository) SetManagedGroupMemberships(ctx context.Context, am *AuthMet if len(newMgPublicIds) > 0 { metadata["op-type"] = append(metadata["op-type"], oplog.OpType_OP_TYPE_CREATE.String()) addOplogMsgs := make([]*oplog.Message, 0, len(newMgPublicIds)) - toAdd := make([]any, 0, len(newMgPublicIds)) + toAdd := make([]*ManagedGroupMemberAccount, 0, len(newMgPublicIds)) for mgId := range newMgPublicIds { newMg := AllocManagedGroupMemberAccount() newMg.ManagedGroupId = mgId diff --git a/internal/auth/oidc/testing.go b/internal/auth/oidc/testing.go index be4e924d38d..5ec87d0f0f1 100644 --- a/internal/auth/oidc/testing.go +++ b/internal/auth/oidc/testing.go @@ -68,7 +68,7 @@ func TestAuthMethod( require.NoError(err) if len(opts.withAudClaims) > 0 { - newAudClaims := make([]any, 0, len(opts.withAudClaims)) + newAudClaims := make([]*AudClaim, 0, len(opts.withAudClaims)) for _, a := range opts.withAudClaims { aud, err := NewAudClaim(ctx, authMethod.PublicId, a) require.NoError(err) @@ -79,7 +79,7 @@ func TestAuthMethod( require.Equal(len(opts.withAudClaims), len(authMethod.AudClaims)) } if len(opts.withCertificates) > 0 { - newCerts := make([]any, 0, len(opts.withCertificates)) + newCerts := make([]*Certificate, 0, len(opts.withCertificates)) for _, c := range opts.withCertificates { pem, err := EncodeCertificates(ctx, c) require.NoError(err) @@ -92,7 +92,7 @@ func TestAuthMethod( require.Equal(len(opts.withCertificates), len(authMethod.Certificates)) } if len(opts.withSigningAlgs) > 0 { - newAlgs := make([]any, 0, len(opts.withSigningAlgs)) + newAlgs := make([]*SigningAlg, 0, len(opts.withSigningAlgs)) for _, a := range opts.withSigningAlgs { alg, err := NewSigningAlg(ctx, authMethod.PublicId, a) require.NoError(err) @@ -103,7 +103,7 @@ func TestAuthMethod( require.Equal(len(opts.withSigningAlgs), len(authMethod.SigningAlgs)) } if len(opts.withClaimsScopes) > 0 { - newClaimsScopes := make([]any, 0, len(opts.withClaimsScopes)) + newClaimsScopes := make([]*ClaimsScope, 0, len(opts.withClaimsScopes)) for _, cs := range opts.withClaimsScopes { s, err := NewClaimsScope(ctx, authMethod.PublicId, cs) require.NoError(err) @@ -114,7 +114,7 @@ func TestAuthMethod( require.Equal(len(opts.withClaimsScopes), len(authMethod.ClaimsScopes)) } if len(opts.withAccountClaimMap) > 0 { - newAccountClaimMaps := make([]any, 0, len(opts.withAccountClaimMap)) + newAccountClaimMaps := make([]*AccountClaimMap, 0, len(opts.withAccountClaimMap)) for k, v := range opts.withAccountClaimMap { acm, err := NewAccountClaimMap(ctx, authMethod.PublicId, k, v) require.NoError(err) @@ -124,7 +124,7 @@ func TestAuthMethod( require.Equal(len(opts.withAccountClaimMap), len(authMethod.AccountClaimMaps)) } if len(opts.withPrompts) > 0 { - newPrompts := make([]any, 0, len(opts.withPrompts)) + newPrompts := make([]*Prompt, 0, len(opts.withPrompts)) for _, p := range opts.withPrompts { prompt, err := NewPrompt(ctx, authMethod.PublicId, p) require.NoError(err) diff --git a/internal/auth/service_list_auth_methods_ext_test.go b/internal/auth/service_list_auth_methods_ext_test.go index d368d724488..0e3f5db3018 100644 --- a/internal/auth/service_list_auth_methods_ext_test.go +++ b/internal/auth/service_list_auth_methods_ext_test.go @@ -34,6 +34,7 @@ import ( type fakeReader struct { db.Reader } + type fakeWriter struct { db.Writer } diff --git a/internal/clientcache/internal/cache/search_test.go b/internal/clientcache/internal/cache/search_test.go index b8bc008215c..e5f047eb0de 100644 --- a/internal/clientcache/internal/cache/search_test.go +++ b/internal/clientcache/internal/cache/search_test.go @@ -204,21 +204,21 @@ func TestSearch(t *testing.T) { require.NoError(t, rw.Create(ctx, u)) require.NoError(t, rw.Create(ctx, at)) - aliases := []any{ - &ResolvableAlias{FkUserId: u.Id, Id: "alt_1", Value: "one", Type: "target", Item: `{"id": "alt_1", "value": "one", "type": "target"}`}, - &ResolvableAlias{FkUserId: u.Id, Id: "alt_2", Value: "two", Type: "target", Item: `{"id": "alt_2", "value": "two", "type": "target"}`}, + aliases := []*ResolvableAlias{ + {FkUserId: u.Id, Id: "alt_1", Value: "one", Type: "target", Item: `{"id": "alt_1", "value": "one", "type": "target"}`}, + {FkUserId: u.Id, Id: "alt_2", Value: "two", Type: "target", Item: `{"id": "alt_2", "value": "two", "type": "target"}`}, } require.NoError(t, rw.CreateItems(ctx, aliases)) - targets := []any{ - &Target{FkUserId: u.Id, Id: "t_1", Name: "one", Type: "tcp", Item: `{"id": "t_1", "name": "one", "type": "tcp"}`}, - &Target{FkUserId: u.Id, Id: "t_2", Name: "two", Type: "tcp", Item: `{"id": "t_2", "name": "two", "type": "tcp"}`}, + targets := []*Target{ + {FkUserId: u.Id, Id: "t_1", Name: "one", Type: "tcp", Item: `{"id": "t_1", "name": "one", "type": "tcp"}`}, + {FkUserId: u.Id, Id: "t_2", Name: "two", Type: "tcp", Item: `{"id": "t_2", "name": "two", "type": "tcp"}`}, } require.NoError(t, rw.CreateItems(ctx, targets)) - sessions := []any{ - &Session{FkUserId: u.Id, Id: "s_1", Endpoint: "one", Type: "tcp", UserId: "u123", Item: `{"id": "s_1", "endpoint": "one", "type": "tcp", "user_id": "u123"}`}, - &Session{FkUserId: u.Id, Id: "s_2", Endpoint: "two", Type: "ssh", UserId: "u321", Item: `{"id": "s_2", "endpoint": "two", "type": "ssh", "user_id": "u321"}`}, + sessions := []*Session{ + {FkUserId: u.Id, Id: "s_1", Endpoint: "one", Type: "tcp", UserId: "u123", Item: `{"id": "s_1", "endpoint": "one", "type": "tcp", "user_id": "u123"}`}, + {FkUserId: u.Id, Id: "s_2", Endpoint: "two", Type: "ssh", UserId: "u321", Item: `{"id": "s_2", "endpoint": "two", "type": "ssh", "user_id": "u321"}`}, } require.NoError(t, rw.CreateItems(ctx, sessions)) } diff --git a/internal/credential/service_list_stores_ext_test.go b/internal/credential/service_list_stores_ext_test.go index 13c1feb915b..c7131430601 100644 --- a/internal/credential/service_list_stores_ext_test.go +++ b/internal/credential/service_list_stores_ext_test.go @@ -30,6 +30,7 @@ import ( type fakeReader struct { db.Reader } + type fakeWriter struct { db.Writer } diff --git a/internal/daemon/cluster/handlers/upstream_message_service_controller.go b/internal/daemon/cluster/handlers/upstream_message_service_controller.go index 111f78ed87a..ecc7c9227a8 100644 --- a/internal/daemon/cluster/handlers/upstream_message_service_controller.go +++ b/internal/daemon/cluster/handlers/upstream_message_service_controller.go @@ -30,7 +30,6 @@ type UpstreamMessageHandler interface { // Handler for the request. All errors returned must be a error created // using google.golang.org/grpc/status Handler(ctx context.Context, request proto.Message) (response proto.Message, statusErr error) - UpstreamMessageTypeSpecifier } diff --git a/internal/daemon/worker/session/session.go b/internal/daemon/worker/session/session.go index c3ff2539f4f..e684ce0a562 100644 --- a/internal/daemon/worker/session/session.go +++ b/internal/daemon/worker/session/session.go @@ -63,11 +63,9 @@ type Session interface { // in the SessionJobInfo are not present, however, it still applies the // status change to the session and the connections which are present. ApplyLocalStatus(st pbs.SESSIONSTATUS) - GetStatus() pbs.SESSIONSTATUS // GetLocalConnections returns the connections this session is handling. GetLocalConnections() map[string]ConnInfo - GetTofuToken() string GetConnectionLimit() int32 GetEndpoint() string diff --git a/internal/db/changesafe_reader_writer.go b/internal/db/changesafe_reader_writer.go index 02e3ca149d9..7a62d3dab5a 100644 --- a/internal/db/changesafe_reader_writer.go +++ b/internal/db/changesafe_reader_writer.go @@ -75,7 +75,7 @@ func (w *changeSafeDbwWriter) Create(ctx context.Context, i any, opt ...dbw.Opti return dbw.New(w.db.underlying.wrapped.Load()).Create(ctx, i, opt...) } -func (w *changeSafeDbwWriter) CreateItems(ctx context.Context, createItems []any, opt ...dbw.Option) error { +func (w *changeSafeDbwWriter) CreateItems(ctx context.Context, createItems any, opt ...dbw.Option) error { return dbw.New(w.db.underlying.wrapped.Load()).CreateItems(ctx, createItems, opt...) } @@ -83,7 +83,7 @@ func (w *changeSafeDbwWriter) Delete(ctx context.Context, i any, opt ...dbw.Opti return dbw.New(w.db.underlying.wrapped.Load()).Delete(ctx, i, opt...) } -func (w *changeSafeDbwWriter) DeleteItems(ctx context.Context, deleteItems []any, opt ...dbw.Option) (int, error) { +func (w *changeSafeDbwWriter) DeleteItems(ctx context.Context, deleteItems any, opt ...dbw.Option) (int, error) { return dbw.New(w.db.underlying.wrapped.Load()).DeleteItems(ctx, deleteItems, opt...) } diff --git a/internal/db/read_writer.go b/internal/db/read_writer.go index adf1dfbe0c7..29f3da7b5ec 100644 --- a/internal/db/read_writer.go +++ b/internal/db/read_writer.go @@ -112,7 +112,7 @@ type Writer interface { // cycle of the writer and if an error is returned the caller must decide // what to do with the transaction, which almost always should be to // rollback. - CreateItems(ctx context.Context, createItems []any, opt ...Option) error + CreateItems(ctx context.Context, createItems any, opt ...Option) error // Delete an object in the db with options: WithOplog, WithDebug. // The caller is responsible for the transaction life cycle of the writer @@ -127,7 +127,7 @@ type Writer interface { // transaction life cycle of the writer and if an error is returned the // caller must decide what to do with the transaction, which almost always // should be to rollback. Delete returns the number of rows deleted or an error. - DeleteItems(ctx context.Context, deleteItems []any, opt ...Option) (int, error) + DeleteItems(ctx context.Context, deleteItems any, opt ...Option) (int, error) // Exec will execute the sql with the values as parameters. The int returned // is the number of rows affected by the sql. No options are currently @@ -311,7 +311,7 @@ func (rw *Db) Create(ctx context.Context, i any, opt ...Option) error { // WithDebug, WithOplog, WithOplogMsgs, WithReturnRowsAffected, OnConflict, // WithVersion, and WithWhere WithOplog and WithOplogMsgs may not be used // together. WithLookup is not a supported option. -func (rw *Db) CreateItems(ctx context.Context, createItems []any, opt ...Option) error { +func (rw *Db) CreateItems(ctx context.Context, createItems any, opt ...Option) error { const op = "db.CreateItems" if rw.underlying == nil { return errors.New(ctx, errors.InvalidParameter, op, "missing underlying db") @@ -389,7 +389,7 @@ func (rw *Db) Delete(ctx context.Context, i any, opt ...Option) (int, error) { // DeleteItems will delete multiple items of the same type. Supported options: // WithOplog and WithOplogMsgs. WithOplog and WithOplogMsgs may not be used // together. -func (rw *Db) DeleteItems(ctx context.Context, deleteItems []any, opt ...Option) (int, error) { +func (rw *Db) DeleteItems(ctx context.Context, deleteItems any, opt ...Option) (int, error) { const op = "db.DeleteItems" if rw.underlying == nil { return NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, "missing underlying db") diff --git a/internal/db/read_writer_ext_test.go b/internal/db/read_writer_ext_test.go index 816be2ada9e..10338b69516 100644 --- a/internal/db/read_writer_ext_test.go +++ b/internal/db/read_writer_ext_test.go @@ -219,7 +219,7 @@ func TestDb_Create_OnConflict(t *testing.T) { Target: db.Constraint("db_test_user_public_id_key"), Action: db.SetColumns([]string{"name"}), } - users := []any{} + users := []*db_test.TestUser{} users = append(users, conflictUser) var rowsAffected int64 err = rw.CreateItems(ctx, users, db.WithOnConflict(&onConflict), db.WithOplog(oplogWrapper, md), db.WithReturnRowsAffected(&rowsAffected)) diff --git a/internal/db/read_writer_oplog.go b/internal/db/read_writer_oplog.go index bf3af721519..299b012f959 100644 --- a/internal/db/read_writer_oplog.go +++ b/internal/db/read_writer_oplog.go @@ -108,7 +108,7 @@ func (rw *Db) generateOplogBeforeAfterOpts(ctx context.Context, i any, opType Op case withOplog && (opType == CreateItemsOp || opType == DeleteItemsOp): afterFn = func(i any, rowsAffected int) error { const op = "db.afterFnMultiItem" - err := rw.addOplogForItems(ctx, opType, opts, ticket, i.([]any)) + err := rw.addOplogForItems(ctx, opType, opts, ticket, items) if err != nil { return errors.Wrap(ctx, err, op, errors.WithMsg("returning oplog msgs failed")) } diff --git a/internal/db/read_writer_test.go b/internal/db/read_writer_test.go index 787b5a8ec29..0340dcfdd37 100644 --- a/internal/db/read_writer_test.go +++ b/internal/db/read_writer_test.go @@ -1682,8 +1682,8 @@ func TestDb_CreateItems(t *testing.T) { oplogWrapper := TestOplogWrapper(t, db) testOplogResourceId := testId(t) - createFn := func() []any { - results := []any{} + createFn := func() []*db_test.TestUser { + results := []*db_test.TestUser{} for i := 0; i < 10; i++ { u, err := db_test.NewTestUser() require.NoError(t, err) @@ -1705,7 +1705,7 @@ func TestDb_CreateItems(t *testing.T) { returnedMsgs := []*oplog.Message{} type args struct { - createItems []any + createItems any opt []Option } tests := []struct { @@ -1865,21 +1865,19 @@ func TestDb_CreateItems(t *testing.T) { return } require.NoError(err) - for _, item := range tt.args.createItems { + for _, item := range tt.args.createItems.([]*db_test.TestUser) { u := db_test.AllocTestUser() - u.PublicId = item.(*db_test.TestUser).PublicId + u.PublicId = item.PublicId err := rw.LookupByPublicId(context.Background(), &u) assert.NoError(err) - if _, ok := item.(*db_test.TestUser); ok { - assert.Truef(proto.Equal(item.(*db_test.TestUser).StoreTestUser, u.StoreTestUser), "%s and %s should be equal", item, u) - } + assert.Truef(proto.Equal(item.StoreTestUser, u.StoreTestUser), "%s and %s should be equal", item, u) } if tt.wantOplogId != "" { err = TestVerifyOplog(t, rw, tt.wantOplogId, WithOperation(oplog.OpType_OP_TYPE_CREATE), WithCreateNotBefore(10*time.Second)) assert.NoError(err) } if tt.wantOplogMsgs { - assert.Equal(len(tt.args.createItems), len(returnedMsgs)) + assert.Equal(len(tt.args.createItems.([]*db_test.TestUser)), len(returnedMsgs)) for _, m := range returnedMsgs { assert.Equal(m.OpType, oplog.OpType_OP_TYPE_CREATE) } @@ -1894,8 +1892,8 @@ func TestDb_DeleteItems(t *testing.T) { oplogWrapper := TestOplogWrapper(t, db) testOplogResourceId := testId(t) - createFn := func() []any { - results := []any{} + createFn := func() []*db_test.TestUser { + results := []*db_test.TestUser{} for i := 0; i < 10; i++ { u := testUser(t, db, "", "", "") results = append(results, u) @@ -1906,7 +1904,7 @@ func TestDb_DeleteItems(t *testing.T) { returnedMsgs := []*oplog.Message{} type args struct { - deleteItems []any + deleteItems []*db_test.TestUser opt []Option } tests := []struct { @@ -2034,7 +2032,7 @@ func TestDb_DeleteItems(t *testing.T) { name: "empty items", underlying: db, args: args{ - deleteItems: []any{}, + deleteItems: []*db_test.TestUser{}, }, wantErr: true, wantErrIs: errors.InvalidParameter, @@ -2063,7 +2061,7 @@ func TestDb_DeleteItems(t *testing.T) { assert.Equal(tt.wantRowsDeleted, rowsDeleted) for _, item := range tt.args.deleteItems { u := db_test.AllocTestUser() - u.PublicId = item.(*db_test.TestUser).PublicId + u.PublicId = item.PublicId err := rw.LookupByPublicId(context.Background(), &u) require.Error(err) require.Truef(errors.Match(errors.T(errors.RecordNotFound), err), "found item %s that should be deleted", u.PublicId) diff --git a/internal/db/schema/migrations/oss/postgres_20_05_test.go b/internal/db/schema/migrations/oss/postgres_20_05_test.go index f9288b5d80a..5246a83dbc7 100644 --- a/internal/db/schema/migrations/oss/postgres_20_05_test.go +++ b/internal/db/schema/migrations/oss/postgres_20_05_test.go @@ -222,7 +222,7 @@ values require.NoError(err) // Add items to insert - var items []any + var items []*host.PreferredEndpoint for _, cond := range tt.conditions { ep := host.AllocPreferredEndpoint() ep.HostSetId = tt.hostSetId diff --git a/internal/db/schema/migrations/oss/postgres_30_01_test.go b/internal/db/schema/migrations/oss/postgres_30_01_test.go index 24d3c2aa602..edd32f449dc 100644 --- a/internal/db/schema/migrations/oss/postgres_30_01_test.go +++ b/internal/db/schema/migrations/oss/postgres_30_01_test.go @@ -474,6 +474,7 @@ type dek struct { CreateTime time.Time Purpose string } + type dekVersion struct { PrivateId string DataKeyId string diff --git a/internal/gen/controller.swagger.json b/internal/gen/controller.swagger.json index 06563206f9b..ad35405d4b2 100644 --- a/internal/gen/controller.swagger.json +++ b/internal/gen/controller.swagger.json @@ -15,7 +15,7 @@ }, "tags": [ { - "name": "Account service", + "name": "controller.api.services.v1.AccountService", "description": "The account service exposes endpoints for interacting with accounts in Boundary. Accounts belong to an auth method and are associated with users.", "externalDocs": { "description": "Read about accounts in the Boundary domain model", @@ -23,11 +23,11 @@ } }, { - "name": "Alias service", + "name": "controller.api.services.v1.AliasService", "description": "The alias service exposes endpoints for interacting with aliases in Boundary. An alias acts as a reference or an alternate ID for an existing entity within the Boundary access control system. It provides a way to simplify access control by offering a more user-friendly or descriptive identifier for an entity." }, { - "name": "Auth method service", + "name": "controller.api.services.v1.AuthMethodService", "description": "The auth method service exposes endpoints for interacting with auth methods in Boundary. An auth method defines how users can authenticate themselves within the system. It acts as a bridge between Boundary and various external identity providers or authentication mechanisms.", "externalDocs": { "description": "Read about auth methods in the Boundary domain model", @@ -35,15 +35,15 @@ } }, { - "name": "Auth token service", + "name": "controller.api.services.v1.AuthTokenService", "description": "The auth token service provides the ability to manage and retrieve auth tokens. An auth token serves as a temporary credential issued to a user after successful authentication. It grants the user access to Boundary's resources and capabilities for a limited duration." }, { - "name": "Billing service", + "name": "controller.api.services.v1.BillingService", "description": "The billing service provides the usage data. It includes the active users in a given time period." }, { - "name": "Credential library service", + "name": "controller.api.services.v1.CredentialLibraryService", "description": "The credential library service acts as a centralized repository for managing credentials used during sessions. It offers a secure and efficient way to store, rotate, and manage various the various types of credentials that are required for infrastructure access. The credential library service provides endpoints for interacting with credential libraries.", "externalDocs": { "description": "Read about credential libraries in the Boundary domain model", @@ -51,7 +51,7 @@ } }, { - "name": "Credential service", + "name": "controller.api.services.v1.CredentialService", "description": "A credential is a data structure that contains one or more secrets that bind an identity to a set of permissions or capabilities on a host for a session. The credential service provides endpoints for managing credentials in Boundary. ", "externalDocs": { "description": "Read about credentials in the Boundary domain model", @@ -59,7 +59,7 @@ } }, { - "name": "Credential store service", + "name": "controller.api.services.v1.CredentialStoreService", "description": "A credential store is a resource that can retrieve, store, and potentially generate credentials of differing types and differing access levels. The credential store service provides endpoints for managing credential stores in Boundary. ", "externalDocs": { "description": "Read about credential stores in the Boundary domain model", @@ -67,7 +67,7 @@ } }, { - "name": "Group service", + "name": "controller.api.services.v1.GroupService", "description": "A group is a resource that represents a collection of users that can be treated equally for the purposes of access control. The group service provides endpoints for managing groups in Boundary. ", "externalDocs": { "description": "Read about groups in the Boundary domain model", @@ -75,7 +75,7 @@ } }, { - "name": "Host catalog service", + "name": "controller.api.services.v1.HostCatalogService", "description": "A host catalog serves as a central repository for managing and organizing the target hosts or resources that Boundary can access and control. The host catalog service provides endpoints for managing host catalogs in Boundary.", "externalDocs": { "description": "Read about host catalogs in the Boundary domain model", @@ -83,7 +83,7 @@ } }, { - "name": "Host service", + "name": "controller.api.services.v1.HostService", "description": "A host is a resource that represents a computing element with a network address that is reachable from a Boundary worker. The host service provides endpoints for managing hosts in Boundary.", "externalDocs": { "description": "Read about hosts in the Boundary domain model", @@ -91,7 +91,7 @@ } }, { - "name": "Host set service", + "name": "controller.api.services.v1.HostSetService", "description": "A host set is a resource that represents a collection of hosts that are considered equivalent for the purposes of access control. The host set service provides endpoints for managing host sets in Boundary.", "externalDocs": { "description": "Read about host sets in the Boundary domain model", @@ -99,7 +99,7 @@ } }, { - "name": "Managed group service", + "name": "controller.api.services.v1.ManagedGroupService", "description": "A managed group is a resource that represents a collection of accounts. The managed group service provides endpoints for creating, reading, updating, and deleting managed groups in Boundary.", "externalDocs": { "description": "Read about managed groups in the Boundary domain model", @@ -107,7 +107,7 @@ } }, { - "name": "Policy service", + "name": "controller.api.services.v1.PolicyService", "description": "The policy service provides endpoints that let you manage policies in Boundary. Policies are used to define rules for the lifecycle of session recordings.", "externalDocs": { "description": "Read about policies in the Boundary domain model", @@ -115,7 +115,7 @@ } }, { - "name": "Role service", + "name": "controller.api.services.v1.RoleService", "description": "A role represents a collection of permissions that define what actions a user or service account can perform within the system. The role service provides endpoints that let you manage roles in Boundary.", "externalDocs": { "description": "Read about roles in the Boundary domain model", @@ -123,7 +123,7 @@ } }, { - "name": "Scope service", + "name": "controller.api.services.v1.ScopeService", "description": "A scope acts as a permission Boundary modeled using the concept of a container. It creates a hierarchical structure that lets you organize your resources and manage access control within Boundary. The scope service provides endpoints to let you manage scopes in Boundary.", "externalDocs": { "description": "Read about scopes in the Boundary domain model", @@ -131,7 +131,7 @@ } }, { - "name": "Session recording service", + "name": "controller.api.services.v1.SessionRecordingService", "description": "A session recording is a feature that enables administrators to record and play back user access sessions to target resources. It provides an audit trail of user activity and lets administrators monitor access. The session recording service provides endpoints that let you manage session recordings in Boundary.", "externalDocs": { "description": "Read about session recordings in the Boundary domain model", @@ -139,7 +139,7 @@ } }, { - "name": "Session service", + "name": "controller.api.services.v1.SessionService", "description": "A session represents a temporary, authorized access connection between a user and a target resource. The session service provides endpoints that let you manage sessions in Boundary.", "externalDocs": { "description": "Read about sessions in the Boundary domain model", @@ -147,7 +147,7 @@ } }, { - "name": "Storage bucket service", + "name": "controller.api.services.v1.StorageBucketService", "description": "A storage bucket is an external storage location used to store recordings of user access sessions. The storage bucket service provides endpoints that let you manage storage buckets in Boundary.", "externalDocs": { "description": "Read about storage buckets in the Boundary domain model", @@ -155,7 +155,7 @@ } }, { - "name": "Target service", + "name": "controller.api.services.v1.TargetService", "description": "A target represents an endpoint or resource that users can access through Boundary sessions. The target service provides endpoints that let you manage targets in Boundary.", "externalDocs": { "description": "Read about targets in the Boundary domain model", @@ -163,7 +163,7 @@ } }, { - "name": "User service", + "name": "controller.api.services.v1.UserService", "description": "A user can be a human individual or a service account that accesses resources. The user service provides endpoints that let you manage users in Boundary.", "externalDocs": { "description": "Read about users in the Boundary domain model", @@ -171,7 +171,7 @@ } }, { - "name": "Worker service", + "name": "controller.api.services.v1.WorkerService", "description": "A worker is a service that acts as a network proxy for Boundary sessions. It functions as a bridge between users and the target resources they need to access. The worker service provides endpoints that let you manage workers in Boundary." } ], @@ -237,7 +237,7 @@ } ], "tags": [ - "Account service" + "controller.api.services.v1.AccountService" ] }, "post": { @@ -268,7 +268,7 @@ } ], "tags": [ - "Account service" + "controller.api.services.v1.AccountService" ] } }, @@ -300,7 +300,7 @@ } ], "tags": [ - "Account service" + "controller.api.services.v1.AccountService" ] }, "delete": { @@ -330,7 +330,7 @@ } ], "tags": [ - "Account service" + "controller.api.services.v1.AccountService" ] }, "patch": { @@ -369,7 +369,7 @@ } ], "tags": [ - "Account service" + "controller.api.services.v1.AccountService" ] } }, @@ -404,12 +404,27 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.AccountService.ChangePasswordBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "current_password": { + "type": "string", + "description": "The current password for the account." + }, + "new_password": { + "type": "string", + "description": "The new password that should be set." + } + } } } ], "tags": [ - "Account service" + "controller.api.services.v1.AccountService" ] } }, @@ -444,12 +459,23 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.AccountService.SetPasswordBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "password": { + "type": "string", + "description": "The password that should be set." + } + } } } ], "tags": [ - "Account service" + "controller.api.services.v1.AccountService" ] } }, @@ -510,7 +536,7 @@ } ], "tags": [ - "Alias service" + "controller.api.services.v1.AliasService" ] }, "post": { @@ -541,7 +567,7 @@ } ], "tags": [ - "Alias service" + "controller.api.services.v1.AliasService" ] } }, @@ -573,7 +599,7 @@ } ], "tags": [ - "Alias service" + "controller.api.services.v1.AliasService" ] }, "delete": { @@ -603,7 +629,7 @@ } ], "tags": [ - "Alias service" + "controller.api.services.v1.AliasService" ] }, "patch": { @@ -642,7 +668,7 @@ } ], "tags": [ - "Alias service" + "controller.api.services.v1.AliasService" ] } }, @@ -703,7 +729,7 @@ } ], "tags": [ - "Auth method service" + "controller.api.services.v1.AuthMethodService" ] }, "post": { @@ -734,7 +760,7 @@ } ], "tags": [ - "Auth method service" + "controller.api.services.v1.AuthMethodService" ] } }, @@ -769,12 +795,34 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.AuthMethodService.AuthenticateBody" + "type": "object", + "properties": { + "token_type": { + "type": "string", + "description": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser. Deprecated, use \"type\" instead." + }, + "type": { + "type": "string", + "description": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser." + }, + "attributes": { + "type": "object", + "example": { + "login": "login", + "password": "password" + }, + "description": "The attributes that are used to authenticate to the auth method. The schema of this field depends on the type of the auth method. For password auth methods, the parameters are:\n```json\n{\n \"login_name\": \"login_name\",\n \"password\": \"password\"\n}\n```\nFor LDAP auth methods, the parameters are:\n```json\n{\n \"login_name\": \"login_name\",\n \"password\": \"password\"\n}\n```\nFor OIDC auth methods, the parameters are:\n```json\n{\n \"roundtrip_payload\": {}\n}\n```\nOIDC authentication requires multiple calls to this endpoint. After the initial call and successful authentication, the OIDC provider must redirect the user to the `callback` command:\n```json\n{\n \"code\": \"code\",\n \"state\": \"state\",\n \"error\": \"error\",\n \"error_description\": \"error_description\",\n \"error_uri\": \"error_uri\"\n}\n```\nOnce this has succeded, the issued auth token can be retrieved by using the `token` command:\n```json\n{\n \"token_id\": \"token_id_from_initial_response\"\n}\n```\n" + }, + "command": { + "type": "string", + "description": "The command to perform. One of \"login\", \"callback\", or \"token\"." + } + } } } ], "tags": [ - "Auth method service" + "controller.api.services.v1.AuthMethodService" ] } }, @@ -806,7 +854,7 @@ } ], "tags": [ - "Auth method service" + "controller.api.services.v1.AuthMethodService" ] }, "delete": { @@ -836,7 +884,7 @@ } ], "tags": [ - "Auth method service" + "controller.api.services.v1.AuthMethodService" ] }, "patch": { @@ -875,7 +923,7 @@ } ], "tags": [ - "Auth method service" + "controller.api.services.v1.AuthMethodService" ] } }, @@ -910,12 +958,27 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.AuthMethodService.ChangeStateBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "attributes": { + "type": "object", + "example": { + "state": "active-public", + "disable_discovered_config_validation": false + }, + "description": "The attributes that are applicable for the specific auth method type. The schema of this field depends on the type of the auth method. The only supported auth method type is OIDC.\nFor OIDC auth methods, the parameters are:\n```json\n{\n \"state\": \"active-public\",\n \"disable_discovered_config_validation\": false\n}\n```\n" + } + } } } ], "tags": [ - "Auth method service" + "controller.api.services.v1.AuthMethodService" ] } }, @@ -976,7 +1039,7 @@ } ], "tags": [ - "Auth token service" + "controller.api.services.v1.AuthTokenService" ] } }, @@ -1008,7 +1071,7 @@ } ], "tags": [ - "Auth token service" + "controller.api.services.v1.AuthTokenService" ] }, "delete": { @@ -1038,7 +1101,7 @@ } ], "tags": [ - "Auth token service" + "controller.api.services.v1.AuthTokenService" ] } }, @@ -1077,7 +1140,7 @@ } ], "tags": [ - "Billing service" + "controller.api.services.v1.BillingService" ] } }, @@ -1131,7 +1194,7 @@ } ], "tags": [ - "Credential library service" + "controller.api.services.v1.CredentialLibraryService" ] }, "post": { @@ -1162,7 +1225,7 @@ } ], "tags": [ - "Credential library service" + "controller.api.services.v1.CredentialLibraryService" ] } }, @@ -1194,7 +1257,7 @@ } ], "tags": [ - "Credential library service" + "controller.api.services.v1.CredentialLibraryService" ] }, "delete": { @@ -1224,7 +1287,7 @@ } ], "tags": [ - "Credential library service" + "controller.api.services.v1.CredentialLibraryService" ] }, "patch": { @@ -1262,7 +1325,7 @@ } ], "tags": [ - "Credential library service" + "controller.api.services.v1.CredentialLibraryService" ] } }, @@ -1323,7 +1386,7 @@ } ], "tags": [ - "Credential store service" + "controller.api.services.v1.CredentialStoreService" ] }, "post": { @@ -1354,7 +1417,7 @@ } ], "tags": [ - "Credential store service" + "controller.api.services.v1.CredentialStoreService" ] } }, @@ -1386,7 +1449,7 @@ } ], "tags": [ - "Credential store service" + "controller.api.services.v1.CredentialStoreService" ] }, "delete": { @@ -1416,7 +1479,7 @@ } ], "tags": [ - "Credential store service" + "controller.api.services.v1.CredentialStoreService" ] }, "patch": { @@ -1454,7 +1517,7 @@ } ], "tags": [ - "Credential store service" + "controller.api.services.v1.CredentialStoreService" ] } }, @@ -1508,7 +1571,7 @@ } ], "tags": [ - "Credential service" + "controller.api.services.v1.CredentialService" ] }, "post": { @@ -1539,7 +1602,7 @@ } ], "tags": [ - "Credential service" + "controller.api.services.v1.CredentialService" ] } }, @@ -1571,7 +1634,7 @@ } ], "tags": [ - "Credential service" + "controller.api.services.v1.CredentialService" ] }, "delete": { @@ -1601,7 +1664,7 @@ } ], "tags": [ - "Credential service" + "controller.api.services.v1.CredentialService" ] }, "patch": { @@ -1639,7 +1702,7 @@ } ], "tags": [ - "Credential service" + "controller.api.services.v1.CredentialService" ] } }, @@ -1700,7 +1763,7 @@ } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] }, "post": { @@ -1731,7 +1794,7 @@ } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] } }, @@ -1763,7 +1826,7 @@ } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] }, "delete": { @@ -1793,7 +1856,7 @@ } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] }, "patch": { @@ -1831,7 +1894,7 @@ } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] } }, @@ -1866,12 +1929,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.GroupService.AddGroupMembersBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] } }, @@ -1906,12 +1983,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.GroupService.RemoveGroupMembersBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] } }, @@ -1946,12 +2037,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.GroupService.SetGroupMembersBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Group service" + "controller.api.services.v1.GroupService" ] } }, @@ -2012,7 +2117,7 @@ } ], "tags": [ - "Host catalog service" + "controller.api.services.v1.HostCatalogService" ] }, "post": { @@ -2050,7 +2155,7 @@ } ], "tags": [ - "Host catalog service" + "controller.api.services.v1.HostCatalogService" ] } }, @@ -2082,7 +2187,7 @@ } ], "tags": [ - "Host catalog service" + "controller.api.services.v1.HostCatalogService" ] }, "delete": { @@ -2112,7 +2217,7 @@ } ], "tags": [ - "Host catalog service" + "controller.api.services.v1.HostCatalogService" ] }, "patch": { @@ -2150,7 +2255,7 @@ } ], "tags": [ - "Host catalog service" + "controller.api.services.v1.HostCatalogService" ] } }, @@ -2204,7 +2309,7 @@ } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] }, "post": { @@ -2235,7 +2340,7 @@ } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] } }, @@ -2267,7 +2372,7 @@ } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] }, "delete": { @@ -2297,7 +2402,7 @@ } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] }, "patch": { @@ -2335,7 +2440,7 @@ } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] } }, @@ -2370,12 +2475,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.HostSetService.AddHostSetHostsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "host_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Host IDs which will be added to this Host Set. Each Host referenced here must be a child of the same Host Catalog of which this Host Set is a child." + } + } } } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] } }, @@ -2410,12 +2529,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.HostSetService.RemoveHostSetHostsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "host_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Host IDs which will be removed from this Host Set." + } + } } } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] } }, @@ -2450,12 +2583,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.HostSetService.SetHostSetHostsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "host_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Host IDs which will be set on this Host Set. Each Host referenced here must be a child of the same Host Catalog of which this Host Set is a child." + } + } } } ], "tags": [ - "Host set service" + "controller.api.services.v1.HostSetService" ] } }, @@ -2509,7 +2656,7 @@ } ], "tags": [ - "Host service" + "controller.api.services.v1.HostService" ] }, "post": { @@ -2540,7 +2687,7 @@ } ], "tags": [ - "Host service" + "controller.api.services.v1.HostService" ] } }, @@ -2572,7 +2719,7 @@ } ], "tags": [ - "Host service" + "controller.api.services.v1.HostService" ] }, "delete": { @@ -2602,7 +2749,7 @@ } ], "tags": [ - "Host service" + "controller.api.services.v1.HostService" ] }, "patch": { @@ -2640,7 +2787,7 @@ } ], "tags": [ - "Host service" + "controller.api.services.v1.HostService" ] } }, @@ -2694,7 +2841,7 @@ } ], "tags": [ - "Managed group service" + "controller.api.services.v1.ManagedGroupService" ] }, "post": { @@ -2725,7 +2872,7 @@ } ], "tags": [ - "Managed group service" + "controller.api.services.v1.ManagedGroupService" ] } }, @@ -2757,7 +2904,7 @@ } ], "tags": [ - "Managed group service" + "controller.api.services.v1.ManagedGroupService" ] }, "delete": { @@ -2787,7 +2934,7 @@ } ], "tags": [ - "Managed group service" + "controller.api.services.v1.ManagedGroupService" ] }, "patch": { @@ -2825,7 +2972,7 @@ } ], "tags": [ - "Managed group service" + "controller.api.services.v1.ManagedGroupService" ] } }, @@ -2886,7 +3033,7 @@ } ], "tags": [ - "Policy service" + "controller.api.services.v1.PolicyService" ] }, "post": { @@ -2917,7 +3064,7 @@ } ], "tags": [ - "Policy service" + "controller.api.services.v1.PolicyService" ] } }, @@ -2949,7 +3096,7 @@ } ], "tags": [ - "Policy service" + "controller.api.services.v1.PolicyService" ] }, "delete": { @@ -2979,7 +3126,7 @@ } ], "tags": [ - "Policy service" + "controller.api.services.v1.PolicyService" ] }, "patch": { @@ -3017,7 +3164,7 @@ } ], "tags": [ - "Policy service" + "controller.api.services.v1.PolicyService" ] } }, @@ -3078,7 +3225,7 @@ } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] }, "post": { @@ -3109,7 +3256,7 @@ } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3141,7 +3288,7 @@ } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] }, "delete": { @@ -3171,7 +3318,7 @@ } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] }, "patch": { @@ -3209,7 +3356,7 @@ } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3244,12 +3391,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.AddRoleGrantScopesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "grant_scope_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3284,12 +3445,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.AddRoleGrantsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "grant_strings": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3324,12 +3499,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.AddRolePrincipalsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "principal_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3364,12 +3553,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.RemoveRoleGrantScopesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "grant_scope_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3404,12 +3607,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.RemoveRoleGrantsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "grant_strings": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3444,12 +3661,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.RemoveRolePrincipalsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "principal_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3484,12 +3715,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.SetRoleGrantScopesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "grant_scope_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3524,12 +3769,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.SetRoleGrantsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "grant_strings": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3564,12 +3823,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.RoleService.SetRolePrincipalsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "principal_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Role service" + "controller.api.services.v1.RoleService" ] } }, @@ -3630,7 +3903,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] }, "post": { @@ -3675,7 +3948,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -3707,7 +3980,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] }, "delete": { @@ -3737,7 +4010,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] }, "patch": { @@ -3775,7 +4048,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -3810,12 +4083,23 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.ScopeService.AttachStoragePolicyBody" + "type": "object", + "properties": { + "storage_policy_id": { + "type": "string", + "title": "" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + } + } } } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -3850,12 +4134,19 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.ScopeService.DetachStoragePolicyBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + } + } } } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -3887,7 +4178,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -3919,7 +4210,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -3952,7 +4243,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -3985,7 +4276,7 @@ } ], "tags": [ - "Scope service" + "controller.api.services.v1.ScopeService" ] } }, @@ -4039,7 +4330,7 @@ } ], "tags": [ - "Session recording service" + "controller.api.services.v1.SessionRecordingService" ] } }, @@ -4071,7 +4362,7 @@ } ], "tags": [ - "Session recording service" + "controller.api.services.v1.SessionRecordingService" ] }, "delete": { @@ -4101,7 +4392,7 @@ } ], "tags": [ - "Session recording service" + "controller.api.services.v1.SessionRecordingService" ] } }, @@ -4143,7 +4434,7 @@ } ], "tags": [ - "Session recording service" + "controller.api.services.v1.SessionRecordingService" ] } }, @@ -4175,7 +4466,7 @@ } ], "tags": [ - "Session recording service" + "controller.api.services.v1.SessionRecordingService" ] } }, @@ -4243,7 +4534,7 @@ } ], "tags": [ - "Session service" + "controller.api.services.v1.SessionService" ] } }, @@ -4275,7 +4566,7 @@ } ], "tags": [ - "Session service" + "controller.api.services.v1.SessionService" ] } }, @@ -4310,12 +4601,19 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.SessionService.CancelSessionBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "title": "" + } + } } } ], "tags": [ - "Session service" + "controller.api.services.v1.SessionService" ] } }, @@ -4376,7 +4674,7 @@ } ], "tags": [ - "Storage bucket service" + "controller.api.services.v1.StorageBucketService" ] }, "post": { @@ -4414,7 +4712,7 @@ } ], "tags": [ - "Storage bucket service" + "controller.api.services.v1.StorageBucketService" ] } }, @@ -4446,7 +4744,7 @@ } ], "tags": [ - "Storage bucket service" + "controller.api.services.v1.StorageBucketService" ] }, "delete": { @@ -4476,7 +4774,7 @@ } ], "tags": [ - "Storage bucket service" + "controller.api.services.v1.StorageBucketService" ] }, "patch": { @@ -4514,7 +4812,7 @@ } ], "tags": [ - "Storage bucket service" + "controller.api.services.v1.StorageBucketService" ] } }, @@ -4575,7 +4873,7 @@ } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] }, "post": { @@ -4606,7 +4904,7 @@ } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4638,7 +4936,7 @@ } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] }, "delete": { @@ -4668,7 +4966,7 @@ } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] }, "patch": { @@ -4706,7 +5004,7 @@ } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4741,12 +5039,33 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.TargetService.AddTargetCredentialSourcesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "brokered_credential_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Brokered credentials are returned to the user during session authorization." + }, + "injected_application_credential_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Injected application credentials are used by a Boundary worker to secure the\nconnection between the worker and the endpoint. Injected application credentials are\nnever returned to the user." + } + } } } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4781,12 +5100,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.TargetService.AddTargetHostSourcesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "host_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4822,12 +5155,30 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.TargetService.AuthorizeSessionBody" + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the target. When using this, scope_id or scope_name must be set." + }, + "scope_id": { + "type": "string", + "description": "The scope ID containing the target, if specifying the target by name." + }, + "scope_name": { + "type": "string", + "description": "The scope name containing the target, if specifying the target by name." + }, + "host_id": { + "type": "string", + "description": "An optional parameter allowing specification of the particular Host within the Target's configured Host Sets to connect to during this Session." + } + } } } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4862,12 +5213,33 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.TargetService.RemoveTargetCredentialSourcesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "brokered_credential_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Brokered credentials are returned to the user during session authorization." + }, + "injected_application_credential_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Injected application credentials are used by a Boundary worker to secure the\nconnection between the worker and the endpoint. Injected application credentials are\nnever returned to the user." + } + } } } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4902,12 +5274,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.TargetService.RemoveTargetHostSourcesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "host_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4942,12 +5328,34 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.TargetService.SetTargetCredentialSourcesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "brokered_credential_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Brokered credentials are returned to the user during session authorization." + }, + "injected_application_credential_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Injected application credentials are used by a Boundary worker to secure the\nconnection between the worker and the endpoint. Injected application credentials are\nnever returned to the user." + } + }, + "description": "Sets the values for credential sources. Any credential_source_id field that\nis not set in the request will result in those fields being cleared." } } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -4982,12 +5390,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.TargetService.SetTargetHostSourcesBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "host_source_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "Target service" + "controller.api.services.v1.TargetService" ] } }, @@ -5048,7 +5470,7 @@ } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] }, "post": { @@ -5079,7 +5501,7 @@ } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] } }, @@ -5111,7 +5533,7 @@ } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] }, "delete": { @@ -5141,7 +5563,7 @@ } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] }, "patch": { @@ -5179,7 +5601,7 @@ } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] } }, @@ -5214,12 +5636,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.UserService.AddUserAccountsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "The version ensures the User hasn't changed since it was last retrieved and if it has the request will fail." + }, + "account_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] } }, @@ -5266,7 +5702,7 @@ } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] } }, @@ -5301,12 +5737,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.UserService.RemoveUserAccountsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "The version ensures the User hasn't changed since it was last retrieved and if it has the request will fail." + }, + "account_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] } }, @@ -5341,12 +5791,26 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.UserService.SetUserAccountsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "The version ensures the User hasn't changed since it was last retrieved and if it has the request will fail." + }, + "account_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "" + } + } } } ], "tags": [ - "User service" + "controller.api.services.v1.UserService" ] } }, @@ -5392,7 +5856,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5424,7 +5888,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] }, "delete": { @@ -5454,7 +5918,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] }, "patch": { @@ -5492,7 +5956,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5527,12 +5991,29 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.WorkerService.AddWorkerTagsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "api_tags": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "object" + } + }, + "title": "" + } + } } } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5567,12 +6048,29 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.WorkerService.RemoveWorkerTagsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "api_tags": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "object" + } + }, + "title": "" + } + } } } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5607,12 +6105,29 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/controller.api.services.v1.WorkerService.SetWorkerTagsBody" + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + }, + "api_tags": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "object" + } + }, + "title": "" + } + } } } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5645,7 +6160,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5678,7 +6193,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5710,7 +6225,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } }, @@ -5742,7 +6257,7 @@ } ], "tags": [ - "Worker service" + "controller.api.services.v1.WorkerService" ] } } @@ -8638,38 +9153,6 @@ }, "title": "Worker contains all fields related to a Worker resource" }, - "controller.api.services.v1.AccountService.ChangePasswordBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "current_password": { - "type": "string", - "description": "The current password for the account." - }, - "new_password": { - "type": "string", - "description": "The new password that should be set." - } - } - }, - "controller.api.services.v1.AccountService.SetPasswordBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "password": { - "type": "string", - "description": "The password that should be set." - } - } - }, "controller.api.services.v1.AddGroupMembersResponse": { "type": "object", "properties": { @@ -8750,49 +9233,6 @@ } } }, - "controller.api.services.v1.AuthMethodService.AuthenticateBody": { - "type": "object", - "properties": { - "token_type": { - "type": "string", - "description": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser. Deprecated, use \"type\" instead." - }, - "type": { - "type": "string", - "description": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser." - }, - "attributes": { - "type": "object", - "example": { - "login": "login", - "password": "password" - }, - "description": "The attributes that are used to authenticate to the auth method. The schema of this field depends on the type of the auth method. For password auth methods, the parameters are:\n```json\n{\n \"login_name\": \"login_name\",\n \"password\": \"password\"\n}\n```\nFor LDAP auth methods, the parameters are:\n```json\n{\n \"login_name\": \"login_name\",\n \"password\": \"password\"\n}\n```\nFor OIDC auth methods, the parameters are:\n```json\n{\n \"roundtrip_payload\": {}\n}\n```\nOIDC authentication requires multiple calls to this endpoint. After the initial call and successful authentication, the OIDC provider must redirect the user to the `callback` command:\n```json\n{\n \"code\": \"code\",\n \"state\": \"state\",\n \"error\": \"error\",\n \"error_description\": \"error_description\",\n \"error_uri\": \"error_uri\"\n}\n```\nOnce this has succeded, the issued auth token can be retrieved by using the `token` command:\n```json\n{\n \"token_id\": \"token_id_from_initial_response\"\n}\n```\n" - }, - "command": { - "type": "string", - "description": "The command to perform. One of \"login\", \"callback\", or \"token\"." - } - } - }, - "controller.api.services.v1.AuthMethodService.ChangeStateBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "attributes": { - "type": "object", - "example": { - "state": "active-public", - "disable_discovered_config_validation": false - }, - "description": "The attributes that are applicable for the specific auth method type. The schema of this field depends on the type of the auth method. The only supported auth method type is OIDC.\nFor OIDC auth methods, the parameters are:\n```json\n{\n \"state\": \"active-public\",\n \"disable_discovered_config_validation\": false\n}\n```\n" - } - } - }, "controller.api.services.v1.AuthenticateResponse": { "type": "object", "properties": { @@ -9332,108 +9772,6 @@ } } }, - "controller.api.services.v1.GroupService.AddGroupMembersBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "member_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.GroupService.RemoveGroupMembersBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "member_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.GroupService.SetGroupMembersBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "member_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.HostSetService.AddHostSetHostsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "host_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of Host IDs which will be added to this Host Set. Each Host referenced here must be a child of the same Host Catalog of which this Host Set is a child." - } - } - }, - "controller.api.services.v1.HostSetService.RemoveHostSetHostsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "host_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of Host IDs which will be removed from this Host Set." - } - } - }, - "controller.api.services.v1.HostSetService.SetHostSetHostsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "host_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of Host IDs which will be set on this Host Set. Each Host referenced here must be a child of the same Host Catalog of which this Host Set is a child." - } - } - }, "controller.api.services.v1.ListAccountsResponse": { "type": "object", "properties": { @@ -10428,266 +10766,79 @@ } } }, - "controller.api.services.v1.RoleService.AddRoleGrantScopesBody": { + "controller.api.services.v1.RotateKeysRequest": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." + "scope_id": { + "type": "string", + "title": "" }, - "grant_scope_ids": { - "type": "array", - "items": { - "type": "string" - }, + "rewrap": { + "type": "boolean", "title": "" } } }, - "controller.api.services.v1.RoleService.AddRoleGrantsBody": { + "controller.api.services.v1.RotateKeysResponse": { + "type": "object" + }, + "controller.api.services.v1.SetGroupMembersResponse": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "grant_strings": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" + "item": { + "$ref": "#/definitions/controller.api.resources.groups.v1.Group" } } }, - "controller.api.services.v1.RoleService.AddRolePrincipalsBody": { + "controller.api.services.v1.SetHostSetHostsResponse": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "principal_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" + "item": { + "$ref": "#/definitions/controller.api.resources.hostsets.v1.HostSet" } } }, - "controller.api.services.v1.RoleService.RemoveRoleGrantScopesBody": { + "controller.api.services.v1.SetPasswordResponse": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "grant_scope_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" + "item": { + "$ref": "#/definitions/controller.api.resources.accounts.v1.Account" } } }, - "controller.api.services.v1.RoleService.RemoveRoleGrantsBody": { + "controller.api.services.v1.SetRoleGrantScopesResponse": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "grant_strings": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" + "item": { + "$ref": "#/definitions/controller.api.resources.roles.v1.Role" } } }, - "controller.api.services.v1.RoleService.RemoveRolePrincipalsBody": { + "controller.api.services.v1.SetRoleGrantsResponse": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "principal_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" + "item": { + "$ref": "#/definitions/controller.api.resources.roles.v1.Role" } } }, - "controller.api.services.v1.RoleService.SetRoleGrantScopesBody": { + "controller.api.services.v1.SetRolePrincipalsResponse": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "grant_scope_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" + "item": { + "$ref": "#/definitions/controller.api.resources.roles.v1.Role" } } }, - "controller.api.services.v1.RoleService.SetRoleGrantsBody": { + "controller.api.services.v1.SetTargetCredentialSourcesResponse": { "type": "object", "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "grant_strings": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" + "item": { + "$ref": "#/definitions/controller.api.resources.targets.v1.Target" } } }, - "controller.api.services.v1.RoleService.SetRolePrincipalsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "principal_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.RotateKeysRequest": { - "type": "object", - "properties": { - "scope_id": { - "type": "string", - "title": "" - }, - "rewrap": { - "type": "boolean", - "title": "" - } - } - }, - "controller.api.services.v1.RotateKeysResponse": { - "type": "object" - }, - "controller.api.services.v1.ScopeService.AttachStoragePolicyBody": { - "type": "object", - "properties": { - "storage_policy_id": { - "type": "string", - "title": "" - }, - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - } - } - }, - "controller.api.services.v1.ScopeService.DetachStoragePolicyBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - } - } - }, - "controller.api.services.v1.SessionService.CancelSessionBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "title": "" - } - } - }, - "controller.api.services.v1.SetGroupMembersResponse": { - "type": "object", - "properties": { - "item": { - "$ref": "#/definitions/controller.api.resources.groups.v1.Group" - } - } - }, - "controller.api.services.v1.SetHostSetHostsResponse": { - "type": "object", - "properties": { - "item": { - "$ref": "#/definitions/controller.api.resources.hostsets.v1.HostSet" - } - } - }, - "controller.api.services.v1.SetPasswordResponse": { - "type": "object", - "properties": { - "item": { - "$ref": "#/definitions/controller.api.resources.accounts.v1.Account" - } - } - }, - "controller.api.services.v1.SetRoleGrantScopesResponse": { - "type": "object", - "properties": { - "item": { - "$ref": "#/definitions/controller.api.resources.roles.v1.Role" - } - } - }, - "controller.api.services.v1.SetRoleGrantsResponse": { - "type": "object", - "properties": { - "item": { - "$ref": "#/definitions/controller.api.resources.roles.v1.Role" - } - } - }, - "controller.api.services.v1.SetRolePrincipalsResponse": { - "type": "object", - "properties": { - "item": { - "$ref": "#/definitions/controller.api.resources.roles.v1.Role" - } - } - }, - "controller.api.services.v1.SetTargetCredentialSourcesResponse": { - "type": "object", - "properties": { - "item": { - "$ref": "#/definitions/controller.api.resources.targets.v1.Target" - } - } - }, - "controller.api.services.v1.SetTargetHostSourcesResponse": { + "controller.api.services.v1.SetTargetHostSourcesResponse": { "type": "object", "properties": { "item": { @@ -10711,151 +10862,6 @@ } } }, - "controller.api.services.v1.TargetService.AddTargetCredentialSourcesBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "brokered_credential_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Brokered credentials are returned to the user during session authorization." - }, - "injected_application_credential_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Injected application credentials are used by a Boundary worker to secure the\nconnection between the worker and the endpoint. Injected application credentials are\nnever returned to the user." - } - } - }, - "controller.api.services.v1.TargetService.AddTargetHostSourcesBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "host_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.TargetService.AuthorizeSessionBody": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the target. When using this, scope_id or scope_name must be set." - }, - "scope_id": { - "type": "string", - "description": "The scope ID containing the target, if specifying the target by name." - }, - "scope_name": { - "type": "string", - "description": "The scope name containing the target, if specifying the target by name." - }, - "host_id": { - "type": "string", - "description": "An optional parameter allowing specification of the particular Host within the Target's configured Host Sets to connect to during this Session." - } - } - }, - "controller.api.services.v1.TargetService.RemoveTargetCredentialSourcesBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "brokered_credential_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Brokered credentials are returned to the user during session authorization." - }, - "injected_application_credential_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Injected application credentials are used by a Boundary worker to secure the\nconnection between the worker and the endpoint. Injected application credentials are\nnever returned to the user." - } - } - }, - "controller.api.services.v1.TargetService.RemoveTargetHostSourcesBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "host_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.TargetService.SetTargetCredentialSourcesBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "brokered_credential_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Brokered credentials are returned to the user during session authorization." - }, - "injected_application_credential_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Injected application credentials are used by a Boundary worker to secure the\nconnection between the worker and the endpoint. Injected application credentials are\nnever returned to the user." - } - }, - "description": "Sets the values for credential sources. Any credential_source_id field that\nis not set in the request will result in those fields being cleared." - }, - "controller.api.services.v1.TargetService.SetTargetHostSourcesBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "host_source_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, "controller.api.services.v1.UpdateAccountResponse": { "type": "object", "properties": { @@ -11000,117 +11006,6 @@ } } }, - "controller.api.services.v1.UserService.AddUserAccountsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "The version ensures the User hasn't changed since it was last retrieved and if it has the request will fail." - }, - "account_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.UserService.RemoveUserAccountsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "The version ensures the User hasn't changed since it was last retrieved and if it has the request will fail." - }, - "account_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.UserService.SetUserAccountsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "The version ensures the User hasn't changed since it was last retrieved and if it has the request will fail." - }, - "account_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "" - } - } - }, - "controller.api.services.v1.WorkerService.AddWorkerTagsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "api_tags": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "object" - } - }, - "title": "" - } - } - }, - "controller.api.services.v1.WorkerService.RemoveWorkerTagsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "api_tags": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "object" - } - }, - "title": "" - } - } - }, - "controller.api.services.v1.WorkerService.SetWorkerTagsBody": { - "type": "object", - "properties": { - "version": { - "type": "integer", - "format": "int64", - "description": "Version is used to ensure this resource has not changed.\nThe mutation will fail if the version does not match the latest known good version." - }, - "api_tags": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "object" - } - }, - "title": "" - } - } - }, "controller.api.v1.Error": { "type": "object", "properties": { diff --git a/internal/gen/controller/api/services/account_service.pb.gw.go b/internal/gen/controller/api/services/account_service.pb.gw.go index 183eacf9b42..bbb7fe00a9f 100644 --- a/internal/gen/controller/api/services/account_service.pb.gw.go +++ b/internal/gen/controller/api/services/account_service.pb.gw.go @@ -123,7 +123,11 @@ func request_AccountService_CreateAccount_0(ctx context.Context, marshaler runti var protoReq CreateAccountRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_AccountService_CreateAccount_0(ctx context.Context, marshaler var protoReq CreateAccountRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_AccountService_CreateAccount_0(ctx context.Context, marshaler } var ( - filter_AccountService_UpdateAccount_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_AccountService_UpdateAccount_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_AccountService_UpdateAccount_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -301,7 +309,11 @@ func request_AccountService_SetPassword_0(ctx context.Context, marshaler runtime var protoReq SetPasswordRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -331,7 +343,11 @@ func local_request_AccountService_SetPassword_0(ctx context.Context, marshaler r var protoReq SetPasswordRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -361,7 +377,11 @@ func request_AccountService_ChangePassword_0(ctx context.Context, marshaler runt var protoReq ChangePasswordRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -391,7 +411,11 @@ func local_request_AccountService_ChangePassword_0(ctx context.Context, marshale var protoReq ChangePasswordRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/alias_service.pb.gw.go b/internal/gen/controller/api/services/alias_service.pb.gw.go index 89cd2ecc201..1ee5044cfc2 100644 --- a/internal/gen/controller/api/services/alias_service.pb.gw.go +++ b/internal/gen/controller/api/services/alias_service.pb.gw.go @@ -123,7 +123,11 @@ func request_AliasService_CreateAlias_0(ctx context.Context, marshaler runtime.M var protoReq CreateAliasRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_AliasService_CreateAlias_0(ctx context.Context, marshaler run var protoReq CreateAliasRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_AliasService_CreateAlias_0(ctx context.Context, marshaler run } var ( - filter_AliasService_UpdateAlias_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_AliasService_UpdateAlias_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_AliasService_UpdateAlias_0(ctx context.Context, marshaler runtime.Marshaler, client AliasServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/auth_method_service.pb.gw.go b/internal/gen/controller/api/services/auth_method_service.pb.gw.go index 4066a346ecb..b62c4142afd 100644 --- a/internal/gen/controller/api/services/auth_method_service.pb.gw.go +++ b/internal/gen/controller/api/services/auth_method_service.pb.gw.go @@ -123,7 +123,11 @@ func request_AuthMethodService_CreateAuthMethod_0(ctx context.Context, marshaler var protoReq CreateAuthMethodRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_AuthMethodService_CreateAuthMethod_0(ctx context.Context, mar var protoReq CreateAuthMethodRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_AuthMethodService_CreateAuthMethod_0(ctx context.Context, mar } var ( - filter_AuthMethodService_UpdateAuthMethod_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_AuthMethodService_UpdateAuthMethod_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_AuthMethodService_UpdateAuthMethod_0(ctx context.Context, marshaler runtime.Marshaler, client AuthMethodServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -301,7 +309,11 @@ func request_AuthMethodService_ChangeState_0(ctx context.Context, marshaler runt var protoReq ChangeStateRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -331,7 +343,11 @@ func local_request_AuthMethodService_ChangeState_0(ctx context.Context, marshale var protoReq ChangeStateRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -361,7 +377,11 @@ func request_AuthMethodService_Authenticate_0(ctx context.Context, marshaler run var protoReq AuthenticateRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -391,7 +411,11 @@ func local_request_AuthMethodService_Authenticate_0(ctx context.Context, marshal var protoReq AuthenticateRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/credential_library_service.pb.gw.go b/internal/gen/controller/api/services/credential_library_service.pb.gw.go index 384a5543867..18ee0138836 100644 --- a/internal/gen/controller/api/services/credential_library_service.pb.gw.go +++ b/internal/gen/controller/api/services/credential_library_service.pb.gw.go @@ -123,7 +123,11 @@ func request_CredentialLibraryService_CreateCredentialLibrary_0(ctx context.Cont var protoReq CreateCredentialLibraryRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_CredentialLibraryService_CreateCredentialLibrary_0(ctx contex var protoReq CreateCredentialLibraryRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_CredentialLibraryService_CreateCredentialLibrary_0(ctx contex } var ( - filter_CredentialLibraryService_UpdateCredentialLibrary_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_CredentialLibraryService_UpdateCredentialLibrary_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_CredentialLibraryService_UpdateCredentialLibrary_0(ctx context.Context, marshaler runtime.Marshaler, client CredentialLibraryServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/credential_service.pb.gw.go b/internal/gen/controller/api/services/credential_service.pb.gw.go index 3003a3e90fa..05b870a4fea 100644 --- a/internal/gen/controller/api/services/credential_service.pb.gw.go +++ b/internal/gen/controller/api/services/credential_service.pb.gw.go @@ -123,7 +123,11 @@ func request_CredentialService_CreateCredential_0(ctx context.Context, marshaler var protoReq CreateCredentialRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_CredentialService_CreateCredential_0(ctx context.Context, mar var protoReq CreateCredentialRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_CredentialService_CreateCredential_0(ctx context.Context, mar } var ( - filter_CredentialService_UpdateCredential_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_CredentialService_UpdateCredential_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_CredentialService_UpdateCredential_0(ctx context.Context, marshaler runtime.Marshaler, client CredentialServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/credential_store_service.pb.gw.go b/internal/gen/controller/api/services/credential_store_service.pb.gw.go index cac3938bf38..0373ce60397 100644 --- a/internal/gen/controller/api/services/credential_store_service.pb.gw.go +++ b/internal/gen/controller/api/services/credential_store_service.pb.gw.go @@ -123,7 +123,11 @@ func request_CredentialStoreService_CreateCredentialStore_0(ctx context.Context, var protoReq CreateCredentialStoreRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_CredentialStoreService_CreateCredentialStore_0(ctx context.Co var protoReq CreateCredentialStoreRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_CredentialStoreService_CreateCredentialStore_0(ctx context.Co } var ( - filter_CredentialStoreService_UpdateCredentialStore_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_CredentialStoreService_UpdateCredentialStore_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_CredentialStoreService_UpdateCredentialStore_0(ctx context.Context, marshaler runtime.Marshaler, client CredentialStoreServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/group_service.pb.gw.go b/internal/gen/controller/api/services/group_service.pb.gw.go index ef93f1a50a9..51d7dce7eab 100644 --- a/internal/gen/controller/api/services/group_service.pb.gw.go +++ b/internal/gen/controller/api/services/group_service.pb.gw.go @@ -123,7 +123,11 @@ func request_GroupService_CreateGroup_0(ctx context.Context, marshaler runtime.M var protoReq CreateGroupRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_GroupService_CreateGroup_0(ctx context.Context, marshaler run var protoReq CreateGroupRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_GroupService_CreateGroup_0(ctx context.Context, marshaler run } var ( - filter_GroupService_UpdateGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_GroupService_UpdateGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_GroupService_UpdateGroup_0(ctx context.Context, marshaler runtime.Marshaler, client GroupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -301,7 +309,11 @@ func request_GroupService_AddGroupMembers_0(ctx context.Context, marshaler runti var protoReq AddGroupMembersRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -331,7 +343,11 @@ func local_request_GroupService_AddGroupMembers_0(ctx context.Context, marshaler var protoReq AddGroupMembersRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -361,7 +377,11 @@ func request_GroupService_SetGroupMembers_0(ctx context.Context, marshaler runti var protoReq SetGroupMembersRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -391,7 +411,11 @@ func local_request_GroupService_SetGroupMembers_0(ctx context.Context, marshaler var protoReq SetGroupMembersRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -421,7 +445,11 @@ func request_GroupService_RemoveGroupMembers_0(ctx context.Context, marshaler ru var protoReq RemoveGroupMembersRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -451,7 +479,11 @@ func local_request_GroupService_RemoveGroupMembers_0(ctx context.Context, marsha var protoReq RemoveGroupMembersRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/host_catalog_service.pb.gw.go b/internal/gen/controller/api/services/host_catalog_service.pb.gw.go index 522c1e72982..177ab992c0c 100644 --- a/internal/gen/controller/api/services/host_catalog_service.pb.gw.go +++ b/internal/gen/controller/api/services/host_catalog_service.pb.gw.go @@ -120,14 +120,18 @@ func local_request_HostCatalogService_ListHostCatalogs_0(ctx context.Context, ma } var ( - filter_HostCatalogService_CreateHostCatalog_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_HostCatalogService_CreateHostCatalog_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_HostCatalogService_CreateHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client HostCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreateHostCatalogRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -147,7 +151,11 @@ func local_request_HostCatalogService_CreateHostCatalog_0(ctx context.Context, m var protoReq CreateHostCatalogRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -164,7 +172,7 @@ func local_request_HostCatalogService_CreateHostCatalog_0(ctx context.Context, m } var ( - filter_HostCatalogService_UpdateHostCatalog_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_HostCatalogService_UpdateHostCatalog_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_HostCatalogService_UpdateHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client HostCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/host_service.pb.gw.go b/internal/gen/controller/api/services/host_service.pb.gw.go index 0df09101155..61523bf3eb5 100644 --- a/internal/gen/controller/api/services/host_service.pb.gw.go +++ b/internal/gen/controller/api/services/host_service.pb.gw.go @@ -123,7 +123,11 @@ func request_HostService_CreateHost_0(ctx context.Context, marshaler runtime.Mar var protoReq CreateHostRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_HostService_CreateHost_0(ctx context.Context, marshaler runti var protoReq CreateHostRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_HostService_CreateHost_0(ctx context.Context, marshaler runti } var ( - filter_HostService_UpdateHost_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_HostService_UpdateHost_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_HostService_UpdateHost_0(ctx context.Context, marshaler runtime.Marshaler, client HostServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/host_set_service.pb.gw.go b/internal/gen/controller/api/services/host_set_service.pb.gw.go index 2773b6acecb..4aa5ccb1d9d 100644 --- a/internal/gen/controller/api/services/host_set_service.pb.gw.go +++ b/internal/gen/controller/api/services/host_set_service.pb.gw.go @@ -123,7 +123,11 @@ func request_HostSetService_CreateHostSet_0(ctx context.Context, marshaler runti var protoReq CreateHostSetRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_HostSetService_CreateHostSet_0(ctx context.Context, marshaler var protoReq CreateHostSetRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_HostSetService_CreateHostSet_0(ctx context.Context, marshaler } var ( - filter_HostSetService_UpdateHostSet_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_HostSetService_UpdateHostSet_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_HostSetService_UpdateHostSet_0(ctx context.Context, marshaler runtime.Marshaler, client HostSetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -301,7 +309,11 @@ func request_HostSetService_AddHostSetHosts_0(ctx context.Context, marshaler run var protoReq AddHostSetHostsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -331,7 +343,11 @@ func local_request_HostSetService_AddHostSetHosts_0(ctx context.Context, marshal var protoReq AddHostSetHostsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -361,7 +377,11 @@ func request_HostSetService_SetHostSetHosts_0(ctx context.Context, marshaler run var protoReq SetHostSetHostsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -391,7 +411,11 @@ func local_request_HostSetService_SetHostSetHosts_0(ctx context.Context, marshal var protoReq SetHostSetHostsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -421,7 +445,11 @@ func request_HostSetService_RemoveHostSetHosts_0(ctx context.Context, marshaler var protoReq RemoveHostSetHostsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -451,7 +479,11 @@ func local_request_HostSetService_RemoveHostSetHosts_0(ctx context.Context, mars var protoReq RemoveHostSetHostsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/managed_group_service.pb.gw.go b/internal/gen/controller/api/services/managed_group_service.pb.gw.go index 80c66cc9ce4..051ea9d043b 100644 --- a/internal/gen/controller/api/services/managed_group_service.pb.gw.go +++ b/internal/gen/controller/api/services/managed_group_service.pb.gw.go @@ -123,7 +123,11 @@ func request_ManagedGroupService_CreateManagedGroup_0(ctx context.Context, marsh var protoReq CreateManagedGroupRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_ManagedGroupService_CreateManagedGroup_0(ctx context.Context, var protoReq CreateManagedGroupRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_ManagedGroupService_CreateManagedGroup_0(ctx context.Context, } var ( - filter_ManagedGroupService_UpdateManagedGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_ManagedGroupService_UpdateManagedGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_ManagedGroupService_UpdateManagedGroup_0(ctx context.Context, marshaler runtime.Marshaler, client ManagedGroupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/policy_service.pb.gw.go b/internal/gen/controller/api/services/policy_service.pb.gw.go index 4beb8ff149b..46939704215 100644 --- a/internal/gen/controller/api/services/policy_service.pb.gw.go +++ b/internal/gen/controller/api/services/policy_service.pb.gw.go @@ -123,7 +123,11 @@ func request_PolicyService_CreatePolicy_0(ctx context.Context, marshaler runtime var protoReq CreatePolicyRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_PolicyService_CreatePolicy_0(ctx context.Context, marshaler r var protoReq CreatePolicyRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_PolicyService_CreatePolicy_0(ctx context.Context, marshaler r } var ( - filter_PolicyService_UpdatePolicy_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_PolicyService_UpdatePolicy_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_PolicyService_UpdatePolicy_0(ctx context.Context, marshaler runtime.Marshaler, client PolicyServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/role_service.pb.gw.go b/internal/gen/controller/api/services/role_service.pb.gw.go index 303ed910f03..8430796dd0f 100644 --- a/internal/gen/controller/api/services/role_service.pb.gw.go +++ b/internal/gen/controller/api/services/role_service.pb.gw.go @@ -123,7 +123,11 @@ func request_RoleService_CreateRole_0(ctx context.Context, marshaler runtime.Mar var protoReq CreateRoleRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_RoleService_CreateRole_0(ctx context.Context, marshaler runti var protoReq CreateRoleRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_RoleService_CreateRole_0(ctx context.Context, marshaler runti } var ( - filter_RoleService_UpdateRole_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_RoleService_UpdateRole_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_RoleService_UpdateRole_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -301,7 +309,11 @@ func request_RoleService_AddRolePrincipals_0(ctx context.Context, marshaler runt var protoReq AddRolePrincipalsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -331,7 +343,11 @@ func local_request_RoleService_AddRolePrincipals_0(ctx context.Context, marshale var protoReq AddRolePrincipalsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -361,7 +377,11 @@ func request_RoleService_SetRolePrincipals_0(ctx context.Context, marshaler runt var protoReq SetRolePrincipalsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -391,7 +411,11 @@ func local_request_RoleService_SetRolePrincipals_0(ctx context.Context, marshale var protoReq SetRolePrincipalsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -421,7 +445,11 @@ func request_RoleService_RemoveRolePrincipals_0(ctx context.Context, marshaler r var protoReq RemoveRolePrincipalsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -451,7 +479,11 @@ func local_request_RoleService_RemoveRolePrincipals_0(ctx context.Context, marsh var protoReq RemoveRolePrincipalsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -481,7 +513,11 @@ func request_RoleService_AddRoleGrants_0(ctx context.Context, marshaler runtime. var protoReq AddRoleGrantsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -511,7 +547,11 @@ func local_request_RoleService_AddRoleGrants_0(ctx context.Context, marshaler ru var protoReq AddRoleGrantsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -541,7 +581,11 @@ func request_RoleService_SetRoleGrants_0(ctx context.Context, marshaler runtime. var protoReq SetRoleGrantsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -571,7 +615,11 @@ func local_request_RoleService_SetRoleGrants_0(ctx context.Context, marshaler ru var protoReq SetRoleGrantsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -601,7 +649,11 @@ func request_RoleService_RemoveRoleGrants_0(ctx context.Context, marshaler runti var protoReq RemoveRoleGrantsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -631,7 +683,11 @@ func local_request_RoleService_RemoveRoleGrants_0(ctx context.Context, marshaler var protoReq RemoveRoleGrantsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -661,7 +717,11 @@ func request_RoleService_AddRoleGrantScopes_0(ctx context.Context, marshaler run var protoReq AddRoleGrantScopesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -691,7 +751,11 @@ func local_request_RoleService_AddRoleGrantScopes_0(ctx context.Context, marshal var protoReq AddRoleGrantScopesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -721,7 +785,11 @@ func request_RoleService_SetRoleGrantScopes_0(ctx context.Context, marshaler run var protoReq SetRoleGrantScopesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -751,7 +819,11 @@ func local_request_RoleService_SetRoleGrantScopes_0(ctx context.Context, marshal var protoReq SetRoleGrantScopesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -781,7 +853,11 @@ func request_RoleService_RemoveRoleGrantScopes_0(ctx context.Context, marshaler var protoReq RemoveRoleGrantScopesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -811,7 +887,11 @@ func local_request_RoleService_RemoveRoleGrantScopes_0(ctx context.Context, mars var protoReq RemoveRoleGrantScopesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/scope_service.pb.gw.go b/internal/gen/controller/api/services/scope_service.pb.gw.go index 0bd2637bb1c..3e15bf372a0 100644 --- a/internal/gen/controller/api/services/scope_service.pb.gw.go +++ b/internal/gen/controller/api/services/scope_service.pb.gw.go @@ -120,14 +120,18 @@ func local_request_ScopeService_ListScopes_0(ctx context.Context, marshaler runt } var ( - filter_ScopeService_CreateScope_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_ScopeService_CreateScope_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_ScopeService_CreateScope_0(ctx context.Context, marshaler runtime.Marshaler, client ScopeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreateScopeRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -147,7 +151,11 @@ func local_request_ScopeService_CreateScope_0(ctx context.Context, marshaler run var protoReq CreateScopeRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -164,7 +172,7 @@ func local_request_ScopeService_CreateScope_0(ctx context.Context, marshaler run } var ( - filter_ScopeService_UpdateScope_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_ScopeService_UpdateScope_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_ScopeService_UpdateScope_0(ctx context.Context, marshaler runtime.Marshaler, client ScopeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -371,7 +379,11 @@ func request_ScopeService_RotateKeys_0(ctx context.Context, marshaler runtime.Ma var protoReq RotateKeysRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -384,7 +396,11 @@ func local_request_ScopeService_RotateKeys_0(ctx context.Context, marshaler runt var protoReq RotateKeysRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -449,7 +465,11 @@ func request_ScopeService_DestroyKeyVersion_0(ctx context.Context, marshaler run var protoReq DestroyKeyVersionRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -462,7 +482,11 @@ func local_request_ScopeService_DestroyKeyVersion_0(ctx context.Context, marshal var protoReq DestroyKeyVersionRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -475,7 +499,11 @@ func request_ScopeService_AttachStoragePolicy_0(ctx context.Context, marshaler r var protoReq AttachStoragePolicyRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -505,7 +533,11 @@ func local_request_ScopeService_AttachStoragePolicy_0(ctx context.Context, marsh var protoReq AttachStoragePolicyRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -535,7 +567,11 @@ func request_ScopeService_DetachStoragePolicy_0(ctx context.Context, marshaler r var protoReq DetachStoragePolicyRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -565,7 +601,11 @@ func local_request_ScopeService_DetachStoragePolicy_0(ctx context.Context, marsh var protoReq DetachStoragePolicyRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/session_recording_service.pb.gw.go b/internal/gen/controller/api/services/session_recording_service.pb.gw.go index e4aa88f53da..1777aa4b16e 100644 --- a/internal/gen/controller/api/services/session_recording_service.pb.gw.go +++ b/internal/gen/controller/api/services/session_recording_service.pb.gw.go @@ -120,7 +120,7 @@ func local_request_SessionRecordingService_ListSessionRecordings_0(ctx context.C } var ( - filter_SessionRecordingService_Download_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_SessionRecordingService_Download_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_SessionRecordingService_Download_0(ctx context.Context, marshaler runtime.Marshaler, client SessionRecordingServiceClient, req *http.Request, pathParams map[string]string) (SessionRecordingService_DownloadClient, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/session_service.pb.gw.go b/internal/gen/controller/api/services/session_service.pb.gw.go index 8ba4e0985ea..71d66e16091 100644 --- a/internal/gen/controller/api/services/session_service.pb.gw.go +++ b/internal/gen/controller/api/services/session_service.pb.gw.go @@ -123,7 +123,11 @@ func request_SessionService_CancelSession_0(ctx context.Context, marshaler runti var protoReq CancelSessionRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -153,7 +157,11 @@ func local_request_SessionService_CancelSession_0(ctx context.Context, marshaler var protoReq CancelSessionRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/storage_bucket_service.pb.gw.go b/internal/gen/controller/api/services/storage_bucket_service.pb.gw.go index fa030934920..959881dc63d 100644 --- a/internal/gen/controller/api/services/storage_bucket_service.pb.gw.go +++ b/internal/gen/controller/api/services/storage_bucket_service.pb.gw.go @@ -120,14 +120,18 @@ func local_request_StorageBucketService_ListStorageBuckets_0(ctx context.Context } var ( - filter_StorageBucketService_CreateStorageBucket_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_StorageBucketService_CreateStorageBucket_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_StorageBucketService_CreateStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, client StorageBucketServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreateStorageBucketRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -147,7 +151,11 @@ func local_request_StorageBucketService_CreateStorageBucket_0(ctx context.Contex var protoReq CreateStorageBucketRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -164,7 +172,7 @@ func local_request_StorageBucketService_CreateStorageBucket_0(ctx context.Contex } var ( - filter_StorageBucketService_UpdateStorageBucket_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_StorageBucketService_UpdateStorageBucket_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_StorageBucketService_UpdateStorageBucket_0(ctx context.Context, marshaler runtime.Marshaler, client StorageBucketServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/target_service.pb.gw.go b/internal/gen/controller/api/services/target_service.pb.gw.go index d9a5d50a9c7..e5f271769a2 100644 --- a/internal/gen/controller/api/services/target_service.pb.gw.go +++ b/internal/gen/controller/api/services/target_service.pb.gw.go @@ -123,7 +123,11 @@ func request_TargetService_CreateTarget_0(ctx context.Context, marshaler runtime var protoReq CreateTargetRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_TargetService_CreateTarget_0(ctx context.Context, marshaler r var protoReq CreateTargetRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_TargetService_CreateTarget_0(ctx context.Context, marshaler r } var ( - filter_TargetService_UpdateTarget_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_TargetService_UpdateTarget_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_TargetService_UpdateTarget_0(ctx context.Context, marshaler runtime.Marshaler, client TargetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -301,7 +309,11 @@ func request_TargetService_AuthorizeSession_0(ctx context.Context, marshaler run var protoReq AuthorizeSessionRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -331,7 +343,11 @@ func local_request_TargetService_AuthorizeSession_0(ctx context.Context, marshal var protoReq AuthorizeSessionRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -361,7 +377,11 @@ func request_TargetService_AddTargetHostSources_0(ctx context.Context, marshaler var protoReq AddTargetHostSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -391,7 +411,11 @@ func local_request_TargetService_AddTargetHostSources_0(ctx context.Context, mar var protoReq AddTargetHostSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -421,7 +445,11 @@ func request_TargetService_SetTargetHostSources_0(ctx context.Context, marshaler var protoReq SetTargetHostSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -451,7 +479,11 @@ func local_request_TargetService_SetTargetHostSources_0(ctx context.Context, mar var protoReq SetTargetHostSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -481,7 +513,11 @@ func request_TargetService_RemoveTargetHostSources_0(ctx context.Context, marsha var protoReq RemoveTargetHostSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -511,7 +547,11 @@ func local_request_TargetService_RemoveTargetHostSources_0(ctx context.Context, var protoReq RemoveTargetHostSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -541,7 +581,11 @@ func request_TargetService_AddTargetCredentialSources_0(ctx context.Context, mar var protoReq AddTargetCredentialSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -571,7 +615,11 @@ func local_request_TargetService_AddTargetCredentialSources_0(ctx context.Contex var protoReq AddTargetCredentialSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -601,7 +649,11 @@ func request_TargetService_SetTargetCredentialSources_0(ctx context.Context, mar var protoReq SetTargetCredentialSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -631,7 +683,11 @@ func local_request_TargetService_SetTargetCredentialSources_0(ctx context.Contex var protoReq SetTargetCredentialSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -661,7 +717,11 @@ func request_TargetService_RemoveTargetCredentialSources_0(ctx context.Context, var protoReq RemoveTargetCredentialSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -691,7 +751,11 @@ func local_request_TargetService_RemoveTargetCredentialSources_0(ctx context.Con var protoReq RemoveTargetCredentialSourcesRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/controller/api/services/user_service.pb.gw.go b/internal/gen/controller/api/services/user_service.pb.gw.go index 68033362f30..04e0b4a08c3 100644 --- a/internal/gen/controller/api/services/user_service.pb.gw.go +++ b/internal/gen/controller/api/services/user_service.pb.gw.go @@ -123,7 +123,11 @@ func request_UserService_CreateUser_0(ctx context.Context, marshaler runtime.Mar var protoReq CreateUserRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_UserService_CreateUser_0(ctx context.Context, marshaler runti var protoReq CreateUserRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -146,7 +154,7 @@ func local_request_UserService_CreateUser_0(ctx context.Context, marshaler runti } var ( - filter_UserService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_UserService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -301,7 +309,11 @@ func request_UserService_AddUserAccounts_0(ctx context.Context, marshaler runtim var protoReq AddUserAccountsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -331,7 +343,11 @@ func local_request_UserService_AddUserAccounts_0(ctx context.Context, marshaler var protoReq AddUserAccountsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -361,7 +377,11 @@ func request_UserService_SetUserAccounts_0(ctx context.Context, marshaler runtim var protoReq SetUserAccountsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -391,7 +411,11 @@ func local_request_UserService_SetUserAccounts_0(ctx context.Context, marshaler var protoReq SetUserAccountsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -421,7 +445,11 @@ func request_UserService_RemoveUserAccounts_0(ctx context.Context, marshaler run var protoReq RemoveUserAccountsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -451,7 +479,11 @@ func local_request_UserService_RemoveUserAccounts_0(ctx context.Context, marshal var protoReq RemoveUserAccountsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -478,7 +510,7 @@ func local_request_UserService_RemoveUserAccounts_0(ctx context.Context, marshal } var ( - filter_UserService_ListResolvableAliases_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_UserService_ListResolvableAliases_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_UserService_ListResolvableAliases_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/controller/api/services/worker_service.pb.gw.go b/internal/gen/controller/api/services/worker_service.pb.gw.go index c046a9283d8..ddc883da6fa 100644 --- a/internal/gen/controller/api/services/worker_service.pb.gw.go +++ b/internal/gen/controller/api/services/worker_service.pb.gw.go @@ -123,7 +123,11 @@ func request_WorkerService_CreateWorkerLed_0(ctx context.Context, marshaler runt var protoReq CreateWorkerLedRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -136,7 +140,11 @@ func local_request_WorkerService_CreateWorkerLed_0(ctx context.Context, marshale var protoReq CreateWorkerLedRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -149,7 +157,11 @@ func request_WorkerService_CreateControllerLed_0(ctx context.Context, marshaler var protoReq CreateControllerLedRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -162,7 +174,11 @@ func local_request_WorkerService_CreateControllerLed_0(ctx context.Context, mars var protoReq CreateControllerLedRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -172,7 +188,7 @@ func local_request_WorkerService_CreateControllerLed_0(ctx context.Context, mars } var ( - filter_WorkerService_UpdateWorker_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_WorkerService_UpdateWorker_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_WorkerService_UpdateWorker_0(ctx context.Context, marshaler runtime.Marshaler, client WorkerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -327,7 +343,11 @@ func request_WorkerService_AddWorkerTags_0(ctx context.Context, marshaler runtim var protoReq AddWorkerTagsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -357,7 +377,11 @@ func local_request_WorkerService_AddWorkerTags_0(ctx context.Context, marshaler var protoReq AddWorkerTagsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -387,7 +411,11 @@ func request_WorkerService_SetWorkerTags_0(ctx context.Context, marshaler runtim var protoReq SetWorkerTagsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -417,7 +445,11 @@ func local_request_WorkerService_SetWorkerTags_0(ctx context.Context, marshaler var protoReq SetWorkerTagsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -447,7 +479,11 @@ func request_WorkerService_RemoveWorkerTags_0(ctx context.Context, marshaler run var protoReq RemoveWorkerTagsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -477,7 +513,11 @@ func local_request_WorkerService_RemoveWorkerTags_0(ctx context.Context, marshal var protoReq RemoveWorkerTagsRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/testing/attribute/attribute.pb.gw.go b/internal/gen/testing/attribute/attribute.pb.gw.go index 1fb5c61ada5..9868d44cbb2 100644 --- a/internal/gen/testing/attribute/attribute.pb.gw.go +++ b/internal/gen/testing/attribute/attribute.pb.gw.go @@ -53,7 +53,11 @@ func request_TestResourceService_TestCreateResource_0(ctx context.Context, marsh var protoReq TestCreateResourceRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -66,7 +70,11 @@ func local_request_TestResourceService_TestCreateResource_0(ctx context.Context, var protoReq TestCreateResourceRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Item); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -76,7 +84,7 @@ func local_request_TestResourceService_TestCreateResource_0(ctx context.Context, } var ( - filter_TestResourceService_TestUpdateResource_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_TestResourceService_TestUpdateResource_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) func request_TestResourceService_TestUpdateResource_0(ctx context.Context, marshaler runtime.Marshaler, client TestResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { diff --git a/internal/gen/testing/event/event.pb.gw.go b/internal/gen/testing/event/event.pb.gw.go index 0f8c1b21330..e76e0dfb651 100644 --- a/internal/gen/testing/event/event.pb.gw.go +++ b/internal/gen/testing/event/event.pb.gw.go @@ -35,7 +35,11 @@ func request_TestAuthMethodService_TestAuthenticate_0(ctx context.Context, marsh var protoReq TestAuthenticateRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -65,7 +69,11 @@ func local_request_TestAuthMethodService_TestAuthenticate_0(ctx context.Context, var protoReq TestAuthenticateRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/internal/gen/testing/event/testing.swagger.json b/internal/gen/testing/event/testing.swagger.json index 199853a3a3b..041fef5ec75 100644 --- a/internal/gen/testing/event/testing.swagger.json +++ b/internal/gen/testing/event/testing.swagger.json @@ -41,7 +41,25 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/testing.event.v1.TestAuthMethodService.TestAuthenticateBody" + "type": "object", + "properties": { + "token_type": { + "type": "string", + "title": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser. Deprecated, use \"type\" instead.\n@inject_tag: `class:\"public\"`" + }, + "type": { + "type": "string", + "title": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser.\n@inject_tag: `class:\"public\"`" + }, + "attributes": { + "type": "object", + "description": "Attributes are passed to the Auth Method; the valid keys and values depend on the type of Auth Method as well as the command." + }, + "command": { + "type": "string", + "title": "The command to perform.\n@inject_tag: `class:\"public\"`" + } + } } } ], @@ -60,27 +78,6 @@ "default": "NULL_VALUE", "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." }, - "testing.event.v1.TestAuthMethodService.TestAuthenticateBody": { - "type": "object", - "properties": { - "token_type": { - "type": "string", - "title": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser. Deprecated, use \"type\" instead.\n@inject_tag: `class:\"public\"`" - }, - "type": { - "type": "string", - "title": "This can be \"cookie\" or \"token\". If not provided, \"token\" will be used. \"cookie\" activates a split-cookie method where the token is split partially between http-only and regular cookies in order\nto keep it safe from rogue JS in the browser.\n@inject_tag: `class:\"public\"`" - }, - "attributes": { - "type": "object", - "description": "Attributes are passed to the Auth Method; the valid keys and values depend on the type of Auth Method as well as the command." - }, - "command": { - "type": "string", - "title": "The command to perform.\n@inject_tag: `class:\"public\"`" - } - } - }, "testing.event.v1.TestAuthenticateResponse": { "type": "object", "properties": { diff --git a/internal/host/plugin/job_set_sync.go b/internal/host/plugin/job_set_sync.go index a2428b1976c..8548e176fd0 100644 --- a/internal/host/plugin/job_set_sync.go +++ b/internal/host/plugin/job_set_sync.go @@ -437,7 +437,7 @@ func (r *SetSyncJob) upsertAndCleanHosts( { if len(hi.ipsToRemove) > 0 { oplogMsgs := make([]*oplog.Message, 0, len(hi.ipsToRemove)) - count, err := w.DeleteItems(ctx, hi.ipsToRemove.toArray(), db.NewOplogMsgs(&oplogMsgs)) + count, err := w.DeleteItems(ctx, hi.ipsToRemove.toSlice(), db.NewOplogMsgs(&oplogMsgs)) if err != nil { return err } @@ -452,8 +452,8 @@ func (r *SetSyncJob) upsertAndCleanHosts( Target: db.Constraint("host_ip_address_pkey"), Action: db.DoNothing(true), } - if err := w.CreateItems(ctx, hi.ipsToAdd.toArray(), db.NewOplogMsgs(&oplogMsgs), db.WithOnConflict(onConflict)); err != nil { - return errors.Wrap(ctx, err, op, errors.WithMsg(fmt.Sprintf("adding ips %v for host %q", hi.ipsToAdd.toArray(), ret.GetPublicId()))) + if err := w.CreateItems(ctx, hi.ipsToAdd.toSlice(), db.NewOplogMsgs(&oplogMsgs), db.WithOnConflict(onConflict)); err != nil { + return errors.Wrap(ctx, err, op, errors.WithMsg(fmt.Sprintf("adding ips %v for host %q", hi.ipsToAdd.toSlice(), ret.GetPublicId()))) } msgs = append(msgs, oplogMsgs...) } @@ -463,7 +463,7 @@ func (r *SetSyncJob) upsertAndCleanHosts( { if len(hi.dnsNamesToRemove) > 0 { oplogMsgs := make([]*oplog.Message, 0, len(hi.dnsNamesToRemove)) - count, err := w.DeleteItems(ctx, hi.dnsNamesToRemove.toArray(), db.NewOplogMsgs(&oplogMsgs)) + count, err := w.DeleteItems(ctx, hi.dnsNamesToRemove.toSlice(), db.NewOplogMsgs(&oplogMsgs)) if err != nil { return err } @@ -478,7 +478,7 @@ func (r *SetSyncJob) upsertAndCleanHosts( Target: db.Constraint("host_dns_name_pkey"), Action: db.DoNothing(true), } - if err := w.CreateItems(ctx, hi.dnsNamesToAdd.toArray(), db.NewOplogMsgs(&oplogMsgs), db.WithOnConflict(onConflict)); err != nil { + if err := w.CreateItems(ctx, hi.dnsNamesToAdd.toSlice(), db.NewOplogMsgs(&oplogMsgs), db.WithOnConflict(onConflict)); err != nil { return err } msgs = append(msgs, oplogMsgs...) diff --git a/internal/host/plugin/repository_host_set.go b/internal/host/plugin/repository_host_set.go index c30c9f11045..8a21e0b7f5c 100644 --- a/internal/host/plugin/repository_host_set.go +++ b/internal/host/plugin/repository_host_set.go @@ -138,9 +138,9 @@ func (r *Repository) CreateSet(ctx context.Context, projectId string, s *HostSet } } - var preferredEndpoints []any + var preferredEndpoints []*host.PreferredEndpoint if s.PreferredEndpoints != nil { - preferredEndpoints = make([]any, 0, len(s.PreferredEndpoints)) + preferredEndpoints = make([]*host.PreferredEndpoint, 0, len(s.PreferredEndpoints)) for i, e := range s.PreferredEndpoints { obj, err := host.NewPreferredEndpoint(ctx, s.PublicId, uint32(i+1), e) if err != nil { @@ -392,9 +392,9 @@ func (r *Repository) UpdateSet(ctx context.Context, projectId string, s *HostSet } // Get the preferred endpoints to write out. - var preferredEndpoints []any + var preferredEndpoints []*host.PreferredEndpoint if endpointOp == endpointOpUpdate { - preferredEndpoints = make([]any, 0, len(newSet.PreferredEndpoints)) + preferredEndpoints = make([]*host.PreferredEndpoint, 0, len(newSet.PreferredEndpoints)) for i, e := range newSet.PreferredEndpoints { obj, err := host.NewPreferredEndpoint(ctx, newSet.PublicId, uint32(i+1), e) if err != nil { @@ -454,7 +454,7 @@ func (r *Repository) UpdateSet(ctx context.Context, projectId string, s *HostSet case endpointOpDelete, endpointOpUpdate: if len(currentSet.PreferredEndpoints) > 0 { // Delete all old endpoint entries. - var peps []any + var peps []*host.PreferredEndpoint for i := 1; i <= len(currentSet.PreferredEndpoints); i++ { p := host.AllocPreferredEndpoint() p.HostSetId, p.Priority = currentSet.GetPublicId(), uint32(i) diff --git a/internal/host/plugin/repository_host_util.go b/internal/host/plugin/repository_host_util.go index 4f9f34b35a0..1dd87de784d 100644 --- a/internal/host/plugin/repository_host_util.go +++ b/internal/host/plugin/repository_host_util.go @@ -5,6 +5,7 @@ package plugin import ( "context" + "reflect" "sort" "github.com/hashicorp/boundary/internal/errors" @@ -13,22 +14,30 @@ import ( "github.com/hashicorp/go-secure-stdlib/strutil" ) -// valueToInterfaceMap is a map that has a function to convert values into an -// array +// valueToInterfaceMap is a map that has a function to convert values into a +// slice type valueToInterfaceMap map[string]any -func (m valueToInterfaceMap) toArray() []any { +func (m valueToInterfaceMap) toSlice() any { switch { case m == nil: return nil case len(m) == 0: return make([]any, 0) default: - ret := make([]any, 0, len(m)) - for _, v := range m { - ret = append(ret, v) + var valueType reflect.Type + existingValues := make([]any, 0, len(m)) + for _, value := range m { + valueType = reflect.TypeOf(value) // Assume all values are the same type + existingValues = append(existingValues, value) } - return ret + // Create a slice of the concrete type + sliceType := reflect.SliceOf(valueType) + sliceValue := reflect.MakeSlice(sliceType, len(m), len(m)) + for i := 0; i < len(m); i++ { + sliceValue.Index(i).Set(reflect.ValueOf(existingValues[i])) + } + return sliceValue.Interface() } } diff --git a/internal/host/plugin/testing.go b/internal/host/plugin/testing.go index dfc05931fcf..3b1559415a1 100644 --- a/internal/host/plugin/testing.go +++ b/internal/host/plugin/testing.go @@ -125,10 +125,10 @@ func TestHost(t testing.TB, conn *db.DB, catId, externId string, opt ...Option) require.NoError(t, err) require.NoError(t, w.Create(ctx, host1)) - var ipAddresses []any + var ipAddresses []*host.IpAddress if len(host1.GetIpAddresses()) > 0 { sort.Strings(host1.IpAddresses) - ipAddresses = make([]any, 0, len(host1.GetIpAddresses())) + ipAddresses = make([]*host.IpAddress, 0, len(host1.GetIpAddresses())) for _, a := range host1.GetIpAddresses() { obj, err := host.NewIpAddress(ctx, host1.PublicId, a) require.NoError(t, err) @@ -137,10 +137,10 @@ func TestHost(t testing.TB, conn *db.DB, catId, externId string, opt ...Option) require.NoError(t, w.CreateItems(ctx, ipAddresses)) } - var dnsNames []any + var dnsNames []*host.DnsName if len(host1.GetDnsNames()) > 0 { sort.Strings(host1.DnsNames) - dnsNames = make([]any, 0, len(host1.GetDnsNames())) + dnsNames = make([]*host.DnsName, 0, len(host1.GetDnsNames())) for _, n := range host1.GetDnsNames() { obj, err := host.NewDnsName(ctx, host1.PublicId, n) require.NoError(t, err) diff --git a/internal/host/service_list_catalogs_ext_test.go b/internal/host/service_list_catalogs_ext_test.go index 1cfc4cada06..13a31ba0418 100644 --- a/internal/host/service_list_catalogs_ext_test.go +++ b/internal/host/service_list_catalogs_ext_test.go @@ -32,6 +32,7 @@ import ( type fakeReader struct { db.Reader } + type fakeWriter struct { db.Writer } diff --git a/internal/host/static/repository_host_set_member.go b/internal/host/static/repository_host_set_member.go index 693f2e1f118..404a3d7a141 100644 --- a/internal/host/static/repository_host_set_member.go +++ b/internal/host/static/repository_host_set_member.go @@ -74,8 +74,8 @@ func (r *Repository) AddSetMembers(ctx context.Context, projectId string, setId return hosts, nil } -func (r *Repository) newMembers(ctx context.Context, setId string, hostIds []string) ([]any, error) { - var members []any +func (r *Repository) newMembers(ctx context.Context, setId string, hostIds []string) ([]*HostSetMember, error) { + var members []*HostSetMember for _, id := range hostIds { var m *HostSetMember m, err := NewHostSetMember(ctx, setId, id) @@ -87,7 +87,7 @@ func (r *Repository) newMembers(ctx context.Context, setId string, hostIds []str return members, nil } -func createMembers(ctx context.Context, w db.Writer, members []any) ([]*oplog.Message, error) { +func createMembers(ctx context.Context, w db.Writer, members []*HostSetMember) ([]*oplog.Message, error) { var msgs []*oplog.Message if err := w.CreateItems(ctx, members, db.NewOplogMsgs(&msgs)); err != nil { return nil, errors.Wrap(ctx, err, "static.createMembers") @@ -214,7 +214,7 @@ func (r *Repository) DeleteSetMembers(ctx context.Context, projectId string, set return len(hostIds), nil } -func deleteMembers(ctx context.Context, w db.Writer, members []any) ([]*oplog.Message, error) { +func deleteMembers(ctx context.Context, w db.Writer, members []*HostSetMember) ([]*oplog.Message, error) { const op = "static.deleteMembers" var msgs []*oplog.Message rowsDeleted, err := w.DeleteItems(ctx, members, db.NewOplogMsgs(&msgs)) @@ -261,7 +261,7 @@ func (r *Repository) SetSetMembers(ctx context.Context, projectId string, setId if err != nil { return nil, db.NoRowsAffected, errors.Wrap(ctx, err, op) } - var deletions, additions []any + var deletions, additions []*HostSetMember for _, c := range changes { m, err := NewHostSetMember(ctx, setId, c.HostId) if err != nil { diff --git a/internal/iam/repository_grant_scope.go b/internal/iam/repository_grant_scope.go index 102e4847d71..db2c3f6f656 100644 --- a/internal/iam/repository_grant_scope.go +++ b/internal/iam/repository_grant_scope.go @@ -56,7 +56,7 @@ func (r *Repository) AddRoleGrantScopes(ctx context.Context, roleId string, role } } - newRoleGrantScopes := make([]any, 0, len(addRoleGrantScopes)) + newRoleGrantScopes := make([]*RoleGrantScope, 0, len(addRoleGrantScopes)) for _, grantScope := range grantScopes { roleGrantScope, err := NewRoleGrantScope(ctx, role.GetPublicId(), grantScope) if err != nil { @@ -116,11 +116,7 @@ func (r *Repository) AddRoleGrantScopes(ctx context.Context, roleId string, role if err != nil { return nil, errors.Wrap(ctx, err, op) } - roleGrantScopes = make([]*RoleGrantScope, 0, len(newRoleGrantScopes)) - for _, grantScope := range newRoleGrantScopes { - roleGrantScopes = append(roleGrantScopes, grantScope.(*RoleGrantScope)) - } - return roleGrantScopes, nil + return newRoleGrantScopes, nil } // DeleteRoleGrantScopes will delete role grant scopes associated with the role ID in @@ -178,7 +174,7 @@ func (r *Repository) DeleteRoleGrantScopes(ctx context.Context, roleId string, r } msgs = append(msgs, &roleOplogMsg) - deleteRoleGrantScopes := make([]any, 0, len(grantScopes)) + deleteRoleGrantScopes := make([]*RoleGrantScope, 0, len(grantScopes)) for _, grantScope := range grantScopes { roleGrantScope, err := NewRoleGrantScope(ctx, roleId, grantScope) if err != nil { @@ -264,8 +260,8 @@ func (r *Repository) SetRoleGrantScopes(ctx context.Context, roleId string, role // Check incoming grant scopes to see if they exist and if so act appropriately currentRoleGrantScopes := make([]*RoleGrantScope, 0, len(grantScopes)+len(found)) - addRoleGrantScopes := make([]any, 0, len(grantScopes)) - deleteRoleGrantScopes := make([]any, 0, len(grantScopes)) + addRoleGrantScopes := make([]*RoleGrantScope, 0, len(grantScopes)) + deleteRoleGrantScopes := make([]*RoleGrantScope, 0, len(grantScopes)) for _, grantScope := range grantScopes { rgs, ok := found[grantScope] if ok { diff --git a/internal/iam/repository_group.go b/internal/iam/repository_group.go index 9579fbd0a29..92611f6191e 100644 --- a/internal/iam/repository_group.go +++ b/internal/iam/repository_group.go @@ -211,7 +211,7 @@ func (r *Repository) AddGroupMembers(ctx context.Context, groupId string, groupV return nil, errors.Wrap(ctx, err, op, errors.WithMsg(fmt.Sprintf("unable to get group members %s scope", groupId))) } - newGroupMembers := make([]any, 0, len(userIds)) + newGroupMembers := make([]*GroupMemberUser, 0, len(userIds)) for _, id := range userIds { gm, err := NewGroupMemberUser(ctx, groupId, id) if err != nil { @@ -304,7 +304,7 @@ func (r *Repository) DeleteGroupMembers(ctx context.Context, groupId string, gro return db.NoRowsAffected, errors.Wrap(ctx, err, op, errors.WithMsg(fmt.Sprintf("unable to get group members %s scope", groupId))) } - deleteMembers := make([]any, 0, len(userIds)) + deleteMembers := make([]*GroupMemberUser, 0, len(userIds)) for _, id := range userIds { member, err := NewGroupMemberUser(ctx, groupId, id) if err != nil { @@ -486,7 +486,7 @@ func (r *Repository) SetGroupMembers(ctx context.Context, groupId string, groupV } // groupMemberChanges returns two slices: members to add and delete -func groupMemberChanges(ctx context.Context, reader db.Reader, groupId string, userIds []string) ([]any, []any, error) { +func groupMemberChanges(ctx context.Context, reader db.Reader, groupId string, userIds []string) ([]*GroupMemberUser, []*GroupMemberUser, error) { const op = "iam.groupMemberChanges" var inClauseSpots []string // starts at 2 because there is already a ? in the query @@ -526,8 +526,8 @@ func groupMemberChanges(ctx context.Context, reader db.Reader, groupId string, u if err := rows.Err(); err != nil { return nil, nil, errors.Wrap(ctx, err, op) } - addMembers := []any{} - deleteMembers := []any{} + addMembers := []*GroupMemberUser{} + deleteMembers := []*GroupMemberUser{} for _, c := range changes { if c.MemberId == "" { return nil, nil, errors.New(ctx, errors.InvalidParameter, op, "missing user id in change result") diff --git a/internal/iam/repository_principal_role.go b/internal/iam/repository_principal_role.go index af4259656c4..c261c608460 100644 --- a/internal/iam/repository_principal_role.go +++ b/internal/iam/repository_principal_role.go @@ -36,7 +36,7 @@ func (r *Repository) AddPrincipalRoles(ctx context.Context, roleId string, roleV return nil, errors.New(ctx, errors.InvalidParameter, op, "missing any of users, groups, or managed groups to add") } - newUserRoles := make([]any, 0, len(userIds)) + newUserRoles := make([]*UserRole, 0, len(userIds)) for _, id := range userIds { usrRole, err := NewUserRole(ctx, roleId, id) if err != nil { @@ -44,7 +44,7 @@ func (r *Repository) AddPrincipalRoles(ctx context.Context, roleId string, roleV } newUserRoles = append(newUserRoles, usrRole) } - newGrpRoles := make([]any, 0, len(groupIds)) + newGrpRoles := make([]*GroupRole, 0, len(groupIds)) for _, id := range groupIds { grpRole, err := NewGroupRole(ctx, roleId, id) if err != nil { @@ -52,7 +52,7 @@ func (r *Repository) AddPrincipalRoles(ctx context.Context, roleId string, roleV } newGrpRoles = append(newGrpRoles, grpRole) } - newManagedGrpRoles := make([]any, 0, len(managedGroupIds)) + newManagedGrpRoles := make([]*ManagedGroupRole, 0, len(managedGroupIds)) for _, id := range managedGroupIds { managedGrpRole, err := NewManagedGroupRole(ctx, roleId, id) if err != nil { @@ -338,7 +338,7 @@ func (r *Repository) DeletePrincipalRoles(ctx context.Context, roleId string, ro role := allocRole() role.PublicId = roleId - deleteUserRoles := make([]any, 0, len(userIds)) + deleteUserRoles := make([]*UserRole, 0, len(userIds)) for _, id := range userIds { usrRole, err := NewUserRole(ctx, roleId, id) if err != nil { @@ -346,7 +346,7 @@ func (r *Repository) DeletePrincipalRoles(ctx context.Context, roleId string, ro } deleteUserRoles = append(deleteUserRoles, usrRole) } - deleteGrpRoles := make([]any, 0, len(groupIds)) + deleteGrpRoles := make([]*GroupRole, 0, len(groupIds)) for _, id := range groupIds { grpRole, err := NewGroupRole(ctx, roleId, id) if err != nil { @@ -354,7 +354,7 @@ func (r *Repository) DeletePrincipalRoles(ctx context.Context, roleId string, ro } deleteGrpRoles = append(deleteGrpRoles, grpRole) } - deleteManagedGrpRoles := make([]any, 0, len(managedGroupIds)) + deleteManagedGrpRoles := make([]*ManagedGroupRole, 0, len(managedGroupIds)) for _, id := range managedGroupIds { managedGrpRole, err := NewManagedGroupRole(ctx, roleId, id) if err != nil { @@ -465,12 +465,12 @@ func (r *Repository) ListPrincipalRoles(ctx context.Context, roleId string, opt } type PrincipalSet struct { - AddUserRoles []any - AddGroupRoles []any - AddManagedGroupRoles []any - DeleteUserRoles []any - DeleteGroupRoles []any - DeleteManagedGroupRoles []any + AddUserRoles []*UserRole + AddGroupRoles []*GroupRole + AddManagedGroupRoles []*ManagedGroupRole + DeleteUserRoles []*UserRole + DeleteGroupRoles []*GroupRole + DeleteManagedGroupRoles []*ManagedGroupRole // unchangedPrincipalRoles is set iff there are no changes, that is, the // length of all other members is zero UnchangedPrincipalRoles []*PrincipalRole @@ -503,7 +503,7 @@ func (r *Repository) PrincipalsToSet(ctx context.Context, role *Role, userIds, g return nil, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("%s is unknown principal type %s", p.PrincipalId, p.GetType())) } } - var newUserRoles []any + var newUserRoles []*UserRole userIdsMap := map[string]struct{}{} for _, id := range userIds { userIdsMap[id] = struct{}{} @@ -515,7 +515,7 @@ func (r *Repository) PrincipalsToSet(ctx context.Context, role *Role, userIds, g newUserRoles = append(newUserRoles, usrRole) } } - var newGrpRoles []any + var newGrpRoles []*GroupRole groupIdsMap := map[string]struct{}{} for _, id := range groupIds { groupIdsMap[id] = struct{}{} @@ -527,7 +527,7 @@ func (r *Repository) PrincipalsToSet(ctx context.Context, role *Role, userIds, g newGrpRoles = append(newGrpRoles, grpRole) } } - var newManagedGrpRoles []any + var newManagedGrpRoles []*ManagedGroupRole managedGroupIdsMap := map[string]struct{}{} for _, id := range managedGroupIds { managedGroupIdsMap[id] = struct{}{} @@ -539,7 +539,7 @@ func (r *Repository) PrincipalsToSet(ctx context.Context, role *Role, userIds, g newManagedGrpRoles = append(newManagedGrpRoles, managedGrpRole) } } - var deleteUserRoles []any + var deleteUserRoles []*UserRole for _, p := range existingUsers { if _, ok := userIdsMap[p.PrincipalId]; !ok { usrRole, err := NewUserRole(ctx, p.GetRoleId(), p.GetPrincipalId()) @@ -549,7 +549,7 @@ func (r *Repository) PrincipalsToSet(ctx context.Context, role *Role, userIds, g deleteUserRoles = append(deleteUserRoles, usrRole) } } - var deleteGrpRoles []any + var deleteGrpRoles []*GroupRole for _, p := range existingGroups { if _, ok := groupIdsMap[p.PrincipalId]; !ok { grpRole, err := NewGroupRole(ctx, p.GetRoleId(), p.GetPrincipalId()) @@ -559,7 +559,7 @@ func (r *Repository) PrincipalsToSet(ctx context.Context, role *Role, userIds, g deleteGrpRoles = append(deleteGrpRoles, grpRole) } } - var deleteManagedGrpRoles []any + var deleteManagedGrpRoles []*ManagedGroupRole for _, p := range existingManagedGroups { if _, ok := managedGroupIdsMap[p.PrincipalId]; !ok { managedGrpRole, err := NewManagedGroupRole(ctx, p.GetRoleId(), p.GetPrincipalId()) diff --git a/internal/iam/repository_principal_role_ext_test.go b/internal/iam/repository_principal_role_ext_test.go index 59801b14a92..07cea74b017 100644 --- a/internal/iam/repository_principal_role_ext_test.go +++ b/internal/iam/repository_principal_role_ext_test.go @@ -206,7 +206,7 @@ func assertSetResults(t *testing.T, got *iam.PrincipalSet, wantAddUsers, wantAdd assert := assert.New(t) var gotAddUsers []string for _, r := range got.AddUserRoles { - gotAddUsers = append(gotAddUsers, r.(*iam.UserRole).PrincipalId) + gotAddUsers = append(gotAddUsers, r.PrincipalId) } // sort.Strings(wantAddUsers) // sort.Strings(gotAddUsers) @@ -214,7 +214,7 @@ func assertSetResults(t *testing.T, got *iam.PrincipalSet, wantAddUsers, wantAdd var gotAddGrps []string for _, r := range got.AddGroupRoles { - gotAddGrps = append(gotAddGrps, r.(*iam.GroupRole).PrincipalId) + gotAddGrps = append(gotAddGrps, r.PrincipalId) } // sort.Strings(wantAddGroups) // sort.Strings(gotAddGrps) @@ -222,7 +222,7 @@ func assertSetResults(t *testing.T, got *iam.PrincipalSet, wantAddUsers, wantAdd var gotAddManagedGrps []string for _, r := range got.AddManagedGroupRoles { - gotAddManagedGrps = append(gotAddManagedGrps, r.(*iam.ManagedGroupRole).PrincipalId) + gotAddManagedGrps = append(gotAddManagedGrps, r.PrincipalId) } // sort.Strings(wantAddGroups) // sort.Strings(gotAddGrps) @@ -230,7 +230,7 @@ func assertSetResults(t *testing.T, got *iam.PrincipalSet, wantAddUsers, wantAdd var gotDeleteUsers []string for _, r := range got.DeleteUserRoles { - gotDeleteUsers = append(gotDeleteUsers, r.(*iam.UserRole).PrincipalId) + gotDeleteUsers = append(gotDeleteUsers, r.PrincipalId) } sort.Strings(wantDeleteUsers) sort.Strings(gotDeleteUsers) @@ -238,7 +238,7 @@ func assertSetResults(t *testing.T, got *iam.PrincipalSet, wantAddUsers, wantAdd var gotDeleteGroups []string for _, r := range got.DeleteGroupRoles { - gotDeleteGroups = append(gotDeleteGroups, r.(*iam.GroupRole).PrincipalId) + gotDeleteGroups = append(gotDeleteGroups, r.PrincipalId) } sort.Strings(wantDeleteGroups) sort.Strings(gotDeleteGroups) @@ -246,7 +246,7 @@ func assertSetResults(t *testing.T, got *iam.PrincipalSet, wantAddUsers, wantAdd var gotDeleteManagedGroups []string for _, r := range got.DeleteManagedGroupRoles { - gotDeleteManagedGroups = append(gotDeleteManagedGroups, r.(*iam.ManagedGroupRole).PrincipalId) + gotDeleteManagedGroups = append(gotDeleteManagedGroups, r.PrincipalId) } sort.Strings(wantDeleteManagedGroups) sort.Strings(gotDeleteManagedGroups) diff --git a/internal/iam/repository_role_grant.go b/internal/iam/repository_role_grant.go index 8e37e63f9f6..116800053e4 100644 --- a/internal/iam/repository_role_grant.go +++ b/internal/iam/repository_role_grant.go @@ -32,7 +32,7 @@ func (r *Repository) AddRoleGrants(ctx context.Context, roleId string, roleVersi role := allocRole() role.PublicId = roleId - newRoleGrants := make([]any, 0, len(grants)) + newRoleGrants := make([]*RoleGrant, 0, len(grants)) for _, grant := range grants { roleGrant, err := NewRoleGrant(ctx, roleId, grant) if err != nil { @@ -96,11 +96,7 @@ func (r *Repository) AddRoleGrants(ctx context.Context, roleId string, roleVersi if err != nil { return nil, errors.Wrap(ctx, err, op) } - roleGrants := make([]*RoleGrant, 0, len(newRoleGrants)) - for _, grant := range newRoleGrants { - roleGrants = append(roleGrants, grant.(*RoleGrant)) - } - return roleGrants, nil + return newRoleGrants, nil } // DeleteRoleGrants deletes grants (as strings) from a role (roleId). The role's @@ -166,7 +162,7 @@ func (r *Repository) DeleteRoleGrants(ctx context.Context, roleId string, roleVe // Check incoming grants to see if they exist and if so add to // delete slice - deleteRoleGrants := make([]any, 0, len(grants)) + deleteRoleGrants := make([]*RoleGrant, 0, len(grants)) for _, grant := range grants { // Use a fake scope, just want to get out a canonical string perm, err := perms.Parse(ctx, "o_abcd1234", grant, perms.WithSkipFinalValidation(true)) @@ -257,8 +253,8 @@ func (r *Repository) SetRoleGrants(ctx context.Context, roleId string, roleVersi // Check incoming grants to see if they exist and if so act appropriately currentRoleGrants := make([]*RoleGrant, 0, len(grants)+len(found)) - addRoleGrants := make([]any, 0, len(grants)) - deleteRoleGrants := make([]any, 0, len(grants)) + addRoleGrants := make([]*RoleGrant, 0, len(grants)) + deleteRoleGrants := make([]*RoleGrant, 0, len(grants)) for _, grant := range grants { // Use a fake scope, just want to get out a canonical string perm, err := perms.Parse(ctx, "o_abcd1234", grant, perms.WithSkipFinalValidation(true)) diff --git a/internal/iam/repository_role_grant_test.go b/internal/iam/repository_role_grant_test.go index 85f7cb5b9cd..b90216a5479 100644 --- a/internal/iam/repository_role_grant_test.go +++ b/internal/iam/repository_role_grant_test.go @@ -763,7 +763,6 @@ func TestGrantsForUser(t *testing.T) { // * directGrantProj on respective projects (4 grants total) expGrantTuples := []perms.GrantTuple{ // No grants from noOrg/noProj - // Grants from direct org1 to org1/proj1a/proj1b: { RoleId: directGrantOrg1Role.PublicId, diff --git a/internal/iam/repository_scope.go b/internal/iam/repository_scope.go index dc29fb6ba21..5c115e66d30 100644 --- a/internal/iam/repository_scope.go +++ b/internal/iam/repository_scope.go @@ -232,7 +232,7 @@ func (r *Repository) CreateScope(ctx context.Context, s *Scope, userId string, o return errors.Wrap(ctx, err, op, errors.WithMsg("unable to create in memory role grant")) } roleGrantOplogMsgs := make([]*oplog.Message, 0, 1) - if err := w.CreateItems(ctx, []any{roleGrant}, db.NewOplogMsgs(&roleGrantOplogMsgs)); err != nil { + if err := w.CreateItems(ctx, []*RoleGrant{roleGrant}, db.NewOplogMsgs(&roleGrantOplogMsgs)); err != nil { return errors.Wrap(ctx, err, op, errors.WithMsg("unable to add grants")) } msgs = append(msgs, roleGrantOplogMsgs...) @@ -242,7 +242,7 @@ func (r *Repository) CreateScope(ctx context.Context, s *Scope, userId string, o return errors.Wrap(ctx, err, op, errors.WithMsg("unable to create in memory role grant scope")) } roleGrantScopeOplogMsgs := make([]*oplog.Message, 0, 1) - if err := w.CreateItems(ctx, []any{roleGrantScope}, db.NewOplogMsgs(&roleGrantScopeOplogMsgs)); err != nil { + if err := w.CreateItems(ctx, []*RoleGrantScope{roleGrantScope}, db.NewOplogMsgs(&roleGrantScopeOplogMsgs)); err != nil { return errors.Wrap(ctx, err, op, errors.WithMsg("unable to add grant scope")) } msgs = append(msgs, roleGrantScopeOplogMsgs...) @@ -252,7 +252,7 @@ func (r *Repository) CreateScope(ctx context.Context, s *Scope, userId string, o return errors.Wrap(ctx, err, op, errors.WithMsg("unable to create in memory role user")) } roleUserOplogMsgs := make([]*oplog.Message, 0, 1) - if err := w.CreateItems(ctx, []any{rolePrincipal}, db.NewOplogMsgs(&roleUserOplogMsgs)); err != nil { + if err := w.CreateItems(ctx, []*UserRole{rolePrincipal}, db.NewOplogMsgs(&roleUserOplogMsgs)); err != nil { return errors.Wrap(ctx, err, op, errors.WithMsg("unable to add grants")) } msgs = append(msgs, roleUserOplogMsgs...) @@ -301,7 +301,7 @@ func (r *Repository) CreateScope(ctx context.Context, s *Scope, userId string, o // Grants { - grants := []any{} + grants := []*RoleGrant{} switch s.Type { case scope.Project.String(): @@ -352,7 +352,7 @@ func (r *Repository) CreateScope(ctx context.Context, s *Scope, userId string, o // Principals { - principals := []any{} + principals := []*UserRole{} userId := globals.AnonymousUserId if s.Type == scope.Project.String() { userId = globals.AnyAuthenticatedUserId @@ -375,7 +375,7 @@ func (r *Repository) CreateScope(ctx context.Context, s *Scope, userId string, o return errors.Wrap(ctx, err, op, errors.WithMsg("unable to create in memory role grant scope")) } roleGrantScopeOplogMsgs := make([]*oplog.Message, 0, 1) - if err := w.CreateItems(ctx, []any{roleGrantScope}, db.NewOplogMsgs(&roleGrantScopeOplogMsgs)); err != nil { + if err := w.CreateItems(ctx, []*RoleGrantScope{roleGrantScope}, db.NewOplogMsgs(&roleGrantScopeOplogMsgs)); err != nil { return errors.Wrap(ctx, err, op, errors.WithMsg("unable to add grant scope")) } msgs = append(msgs, roleGrantScopeOplogMsgs...) diff --git a/internal/oplog/oplog.go b/internal/oplog/oplog.go index 80826696934..8cd0b1c3beb 100644 --- a/internal/oplog/oplog.go +++ b/internal/oplog/oplog.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "io" + reflect "reflect" "github.com/golang/protobuf/ptypes/wrappers" "github.com/hashicorp/boundary/internal/errors" @@ -17,6 +18,7 @@ import ( wrapping "github.com/hashicorp/go-kms-wrapping/v2" "github.com/hashicorp/go-kms-wrapping/v2/extras/structwrapping" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/known/structpb" ) @@ -463,7 +465,7 @@ func (e *Entry) Replay(ctx context.Context, tx *Writer, types *TypeCatalog, tabl // TODO: jimlambrt 12/2021 -> while this will work for // CreateItems(...) it's hardly efficient. We'll need to refactor // oplog quite a bit to support a multi-message operation. - if err := rw.CreateItems(ctx, []any{m.Message}, m.Opts...); err != nil { + if err := rw.CreateItems(ctx, convertToSlice(m.Message), m.Opts...); err != nil { return errors.Wrap(ctx, err, op) } case OpType_OP_TYPE_UPDATE: @@ -478,7 +480,7 @@ func (e *Entry) Replay(ctx context.Context, tx *Writer, types *TypeCatalog, tabl // TODO: jimlambrt 12/2021 -> while this will work for // DeleteItems(...) it's hardly efficient. We'll need to refactor // oplog quite a bit to support a multi-message operation. - if _, err := rw.DeleteItems(ctx, []any{m.Message}, m.Opts...); err != nil { + if _, err := rw.DeleteItems(ctx, convertToSlice(m.Message), m.Opts...); err != nil { return errors.Wrap(ctx, err, op) } default: @@ -487,3 +489,11 @@ func (e *Entry) Replay(ctx context.Context, tx *Writer, types *TypeCatalog, tabl } return nil } + +func convertToSlice(m protoreflect.ProtoMessage) any { + valueType := reflect.TypeOf(m) // Assume all values are the same type + sliceType := reflect.SliceOf(valueType) + sliceValue := reflect.MakeSlice(sliceType, 1, 1) + sliceValue.Index(0).Set(reflect.ValueOf(m)) + return sliceValue.Interface() +} diff --git a/internal/oplog/oplog_test.go b/internal/oplog/oplog_test.go index c683479b8d1..e47c05f9297 100644 --- a/internal/oplog/oplog_test.go +++ b/internal/oplog/oplog_test.go @@ -407,7 +407,7 @@ func Test_Replay(t *testing.T) { userCreateItems := &oplog_test.TestUser{ Name: "foo-" + testId(t), } - require.NoError(dbw.New(db).CreateItems(context.Background(), []any{userCreateItems})) + require.NoError(dbw.New(db).CreateItems(context.Background(), []*oplog_test.TestUser{userCreateItems})) err = newLogEntry.WriteEntryWith(context.Background(), &Writer{tx.DB()}, ticket, &Message{Message: userCreate, TypeName: "user", OpType: OpType_OP_TYPE_CREATE}, @@ -536,7 +536,7 @@ func Test_Replay(t *testing.T) { deleteUser2 := oplog_test.TestUser{ Id: userCreate2.Id, } - _, err = tx2.DeleteItems(testCtx, []any{&deleteUser2}) + _, err = tx2.DeleteItems(testCtx, []*oplog_test.TestUser{&deleteUser2}) require.NoError(err) newLogEntry2, err := NewEntry( diff --git a/internal/server/repository_worker.go b/internal/server/repository_worker.go index cee85974b79..576313fb6e5 100644 --- a/internal/server/repository_worker.go +++ b/internal/server/repository_worker.go @@ -455,7 +455,7 @@ func setWorkerTags(ctx context.Context, w db.Writer, id string, ts TagSource, ta // Otherwise, go through and stage each tuple for insertion // below. if len(tags) > 0 { - uTags := make([]any, 0, len(tags)) + uTags := make([]*store.WorkerTag, 0, len(tags)) for _, v := range tags { if v == nil { return errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("found nil tag value for worker %s", id)) @@ -822,7 +822,7 @@ func (r *Repository) DeleteWorkerTags(ctx context.Context, workerId string, work } rowsDeleted := 0 - deleteTags := make([]any, 0, len(tags)) + deleteTags := make([]*store.WorkerTag, 0, len(tags)) for _, t := range tags { if t == nil { return db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, "found nil tag value in input") diff --git a/internal/server/testing.go b/internal/server/testing.go index b234db68cca..8070d9bff3a 100644 --- a/internal/server/testing.go +++ b/internal/server/testing.go @@ -131,7 +131,7 @@ func TestKmsWorker(t *testing.T, conn *db.DB, wrapper wrapping.Wrapper, opt ...O require.Equal(t, "kms", wrk.Type) if len(opts.withWorkerTags) > 0 { - var tags []any + var tags []*store.WorkerTag for _, t := range opts.withWorkerTags { tags = append(tags, &store.WorkerTag{ WorkerId: wrk.GetPublicId(), @@ -170,7 +170,7 @@ func TestPkiWorker(t *testing.T, conn *db.DB, wrapper wrapping.Wrapper, opt ...O require.NotNil(t, wrk) if len(opts.withWorkerTags) > 0 { - var tags []any + var tags []*store.WorkerTag for _, t := range opts.withWorkerTags { tags = append(tags, &store.WorkerTag{ WorkerId: wrk.GetPublicId(), diff --git a/internal/session/repository_credential.go b/internal/session/repository_credential.go index 55e9776b1a7..be148292958 100644 --- a/internal/session/repository_credential.go +++ b/internal/session/repository_credential.go @@ -32,7 +32,7 @@ func (r *Repository) AddSessionCredentials(ctx context.Context, sessProjectId, s return errors.Wrap(ctx, err, op, errors.WithMsg("unable to get database wrapper")) } - addCreds := make([]any, 0, len(credData)) + addCreds := make([]credential, 0, len(credData)) for _, cred := range credData { if len(cred) == 0 { return errors.New(ctx, errors.InvalidParameter, op, "missing credential") diff --git a/internal/session/repository_session.go b/internal/session/repository_session.go index 60eb835ae67..5cff87003b3 100644 --- a/internal/session/repository_session.go +++ b/internal/session/repository_session.go @@ -127,7 +127,7 @@ func (r *Repository) CreateSession(ctx context.Context, sessionWrapper wrapping. cred.SessionId = newSession.PublicId } - var staticCreds []any + var staticCreds []*StaticCredential for _, cred := range newSession.StaticCredentials { cred.SessionId = newSession.PublicId staticCreds = append(staticCreds, cred) diff --git a/internal/target/repository_credential_source.go b/internal/target/repository_credential_source.go index 9ccc917c32a..ad6f59058f2 100644 --- a/internal/target/repository_credential_source.go +++ b/internal/target/repository_credential_source.go @@ -88,7 +88,7 @@ func (r *Repository) AddTargetCredentialSources(ctx context.Context, targetId st msgs = append(msgs, &targetOplogMsg) if len(addCredLibs) > 0 { - i := make([]any, 0, len(addCredLibs)) + i := make([]*CredentialLibrary, 0, len(addCredLibs)) for _, cl := range addCredLibs { i = append(i, cl) } @@ -100,7 +100,7 @@ func (r *Repository) AddTargetCredentialSources(ctx context.Context, targetId st } if len(addStaticCreds) > 0 { - i := make([]any, 0, len(addStaticCreds)) + i := make([]*StaticCredential, 0, len(addStaticCreds)) for _, c := range addStaticCreds { i = append(i, c) } @@ -208,7 +208,7 @@ func (r *Repository) DeleteTargetCredentialSources(ctx context.Context, targetId msgs = append(msgs, &targetOplogMsg) if len(deleteCredLibs) > 0 { - i := make([]any, 0, len(deleteCredLibs)) + i := make([]*CredentialLibrary, 0, len(deleteCredLibs)) for _, cl := range deleteCredLibs { i = append(i, cl) } @@ -226,7 +226,7 @@ func (r *Repository) DeleteTargetCredentialSources(ctx context.Context, targetId } if len(deleteStaticCred) > 0 { - i := make([]any, 0, len(deleteStaticCred)) + i := make([]*StaticCredential, 0, len(deleteStaticCred)) for _, cl := range deleteStaticCred { i = append(i, cl) } @@ -362,7 +362,7 @@ func (r *Repository) SetTargetCredentialSources(ctx context.Context, targetId st // add new credential libraries if len(addCredLibs) > 0 { - i := make([]any, 0, len(addCredLibs)) + i := make([]*CredentialLibrary, 0, len(addCredLibs)) for _, cl := range addCredLibs { i = append(i, cl) } @@ -377,7 +377,7 @@ func (r *Repository) SetTargetCredentialSources(ctx context.Context, targetId st // delete existing credential libraries not part of set if len(delCredLibs) > 0 { - i := make([]any, 0, len(delCredLibs)) + i := make([]*CredentialLibrary, 0, len(delCredLibs)) for _, cl := range delCredLibs { i = append(i, cl) } @@ -396,7 +396,7 @@ func (r *Repository) SetTargetCredentialSources(ctx context.Context, targetId st // add new static credential if len(addStaticCred) > 0 { - i := make([]any, 0, len(addStaticCred)) + i := make([]*StaticCredential, 0, len(addStaticCred)) for _, cl := range addStaticCred { i = append(i, cl) } @@ -411,7 +411,7 @@ func (r *Repository) SetTargetCredentialSources(ctx context.Context, targetId st // delete existing static credentials not part of set if len(delStaticCred) > 0 { - i := make([]any, 0, len(delStaticCred)) + i := make([]*StaticCredential, 0, len(delStaticCred)) for _, cl := range delStaticCred { i = append(i, cl) } diff --git a/internal/target/repository_host_source.go b/internal/target/repository_host_source.go index 58212d99e2b..a1a8e8a83d7 100644 --- a/internal/target/repository_host_source.go +++ b/internal/target/repository_host_source.go @@ -29,7 +29,7 @@ func (r *Repository) AddTargetHostSources(ctx context.Context, targetId string, if len(hostSourceIds) == 0 { return nil, errors.New(ctx, errors.InvalidParameter, op, "missing host source ids") } - newHostSources := make([]any, 0, len(hostSourceIds)) + newHostSources := make([]*TargetHostSet, 0, len(hostSourceIds)) for _, id := range hostSourceIds { ths, err := NewTargetHostSet(ctx, targetId, id) if err != nil { @@ -139,7 +139,7 @@ func (r *Repository) DeleteTargetHostSources(ctx context.Context, targetId strin if len(hostSourceIds) == 0 { return db.NoRowsAffected, errors.New(ctx, errors.InvalidParameter, op, "missing host source ids") } - deleteTargetHostSources := make([]any, 0, len(hostSourceIds)) + deleteTargetHostSources := make([]*TargetHostSet, 0, len(hostSourceIds)) for _, id := range hostSourceIds { ths, err := NewTargetHostSet(ctx, targetId, id) if err != nil { @@ -251,7 +251,7 @@ func (r *Repository) SetTargetHostSources(ctx context.Context, targetId string, for _, s := range foundThs { found[s.Id()] = s } - addHostSources := make([]any, 0, len(hostSourceIds)) + addHostSources := make([]*TargetHostSet, 0, len(hostSourceIds)) for _, id := range hostSourceIds { if _, ok := found[id]; ok { // found a match, so do nothing (we want to keep it), but remove it @@ -265,7 +265,7 @@ func (r *Repository) SetTargetHostSources(ctx context.Context, targetId string, } addHostSources = append(addHostSources, hs) } - deleteHostSources := make([]any, 0, len(hostSourceIds)) + deleteHostSources := make([]*TargetHostSet, 0, len(hostSourceIds)) if len(found) > 0 { for _, s := range found { hs, err := NewTargetHostSet(ctx, targetId, s.Id()) diff --git a/internal/target/targettest/target.go b/internal/target/targettest/target.go index e1b74f92314..036fb16544a 100644 --- a/internal/target/targettest/target.go +++ b/internal/target/targettest/target.go @@ -360,7 +360,7 @@ func TestNewTestTarget(ctx context.Context, t *testing.T, conn *db.DB, projectId require.NoError(err) if len(opts.WithHostSources) > 0 { - newHostSets := make([]any, 0, len(opts.WithHostSources)) + newHostSets := make([]*target.TargetHostSet, 0, len(opts.WithHostSources)) for _, s := range opts.WithHostSources { hostSet, err := target.NewTargetHostSet(ctx, tar.GetPublicId(), s) require.NoError(err) @@ -370,7 +370,7 @@ func TestNewTestTarget(ctx context.Context, t *testing.T, conn *db.DB, projectId require.NoError(err) } if len(opts.WithCredentialLibraries) > 0 { - newCredLibs := make([]any, 0, len(opts.WithCredentialLibraries)) + newCredLibs := make([]*target.CredentialLibrary, 0, len(opts.WithCredentialLibraries)) for _, cl := range opts.WithCredentialLibraries { cl.TargetId = tar.GetPublicId() newCredLibs = append(newCredLibs, cl) diff --git a/internal/target/tcp/testing.go b/internal/target/tcp/testing.go index 7a9bf5a6579..4251b86c333 100644 --- a/internal/target/tcp/testing.go +++ b/internal/target/tcp/testing.go @@ -36,7 +36,7 @@ func TestTarget(ctx context.Context, t testing.TB, conn *db.DB, projectId, name require.NoError(err) } if len(opts.WithHostSources) > 0 { - newHostSets := make([]any, 0, len(opts.WithHostSources)) + newHostSets := make([]*target.TargetHostSet, 0, len(opts.WithHostSources)) for _, s := range opts.WithHostSources { hostSet, err := target.NewTargetHostSet(ctx, tar.GetPublicId(), s) require.NoError(err) @@ -46,7 +46,7 @@ func TestTarget(ctx context.Context, t testing.TB, conn *db.DB, projectId, name require.NoError(err) } if len(opts.WithCredentialLibraries) > 0 { - newCredLibs := make([]any, 0, len(opts.WithCredentialLibraries)) + newCredLibs := make([]*target.CredentialLibrary, 0, len(opts.WithCredentialLibraries)) for _, cl := range opts.WithCredentialLibraries { cl.TargetId = tar.GetPublicId() newCredLibs = append(newCredLibs, cl) @@ -55,7 +55,7 @@ func TestTarget(ctx context.Context, t testing.TB, conn *db.DB, projectId, name require.NoError(err) } if len(opts.WithStaticCredentials) > 0 { - newCreds := make([]any, 0, len(opts.WithStaticCredentials)) + newCreds := make([]*target.StaticCredential, 0, len(opts.WithStaticCredentials)) for _, c := range opts.WithStaticCredentials { c.TargetId = tar.GetPublicId() newCreds = append(newCreds, c)