diff --git a/go.mod b/go.mod index 784f6a28..69dd18cd 100644 --- a/go.mod +++ b/go.mod @@ -5,19 +5,21 @@ go 1.13 require ( cloud.google.com/go v0.66.0 // indirect cloud.google.com/go/storage v1.11.0 // indirect - github.com/Azure/azure-sdk-for-go v46.3.0+incompatible // indirect + github.com/Azure/azure-sdk-for-go v46.4.0+incompatible // indirect github.com/Azure/go-autorest/autorest/azure/auth v0.5.2 // indirect github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect github.com/Azure/go-autorest/autorest/validation v0.3.0 // indirect github.com/DataDog/datadog-go v4.0.0+incompatible // indirect github.com/agext/levenshtein v1.2.3 // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.61.526 // indirect - github.com/aws/aws-sdk-go v1.34.31 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.530 // indirect + github.com/aws/aws-sdk-go v1.34.32 // indirect + github.com/btcsuite/btcutil v1.0.2 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/circonus-labs/circonusllhist v0.1.4 // indirect github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe // indirect + github.com/envoyproxy/protoc-gen-validate v0.4.1 // indirect github.com/golang/snappy v0.0.2 // indirect - github.com/hashicorp/boundary v0.0.0-20200925141712-61a0ae02c118 + github.com/hashicorp/boundary v0.1.0-beta.1.0.20200926180149-cf3fa4522d41 github.com/hashicorp/go-immutable-radix v1.3.0 // indirect github.com/hashicorp/go-kms-wrapping v0.5.16 github.com/hashicorp/golang-lru v0.5.4 // indirect @@ -27,6 +29,7 @@ require ( github.com/mitchellh/cli v1.1.2 // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/oklog/run v1.1.0 // indirect github.com/oracle/oci-go-sdk v24.3.0+incompatible // indirect github.com/prometheus/common v0.14.0 // indirect @@ -34,9 +37,8 @@ require ( github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/zclconf/go-cty v1.6.1 // indirect - golang.org/x/net v0.0.0-20200923182212-328152dc79b1 // indirect - golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d // indirect + golang.org/x/net v0.0.0-20200925080053-05aa5d4ee321 // indirect + golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c // indirect google.golang.org/api v0.32.0 // indirect - google.golang.org/genproto v0.0.0-20200924141100-a14c0a98937d // indirect gopkg.in/ini.v1 v1.61.0 // indirect ) diff --git a/go.sum b/go.sum index a5ad512e..3dd4c83c 100644 --- a/go.sum +++ b/go.sum @@ -65,6 +65,8 @@ github.com/Azure/azure-sdk-for-go v36.2.0+incompatible h1:09cv2WoH0g6jl6m2iT+R9q github.com/Azure/azure-sdk-for-go v36.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v46.3.0+incompatible h1:m4oQOm3HXtQh2Ipata+pLSS1kGUD/7ikkvNq81XM/7s= github.com/Azure/azure-sdk-for-go v46.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v46.4.0+incompatible h1:fCN6Pi+tEiEwFa8RSmtVlFHRXEZ+DJm9gfx/MKqYWw4= +github.com/Azure/azure-sdk-for-go v46.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -170,6 +172,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190620160927-9418d7b0cd0f h1:oRD github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190620160927-9418d7b0cd0f/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= github.com/aliyun/alibaba-cloud-sdk-go v1.61.526 h1:G+5yA9u8Tw59h/UhfnT6ErO+RJq6qfZstnpTb5H5ECY= github.com/aliyun/alibaba-cloud-sdk-go v1.61.526/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.530 h1:nWiPIMi6MUSoxJph1U2UDa1BmVMJraP290N+pn7kftA= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.530/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= @@ -216,6 +220,8 @@ github.com/aws/aws-sdk-go v1.30.27 h1:9gPjZWVDSoQrBO2AvqrWObS6KAZByfEJxQoCYo4ZfK github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.31 h1:408wh5EHKzxyby8JpYfnn1w3fsF26AIU0o1kbJoRy7E= github.com/aws/aws-sdk-go v1.34.31/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/aws/aws-sdk-go v1.34.32 h1:EHjowHEGXyLHWhcO7M7AVA+oA2c8aLE9WfRvqHwxd3A= +github.com/aws/aws-sdk-go v1.34.32/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -241,6 +247,7 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/buf v0.23.0/go.mod h1:6mSNi849/T7TwPjEqwUVLRDRbQAj6PpZbvqFwVqs8s8= +github.com/bufbuild/buf v0.24.0/go.mod h1:klyqCtJViM5ky2cLvZGI6GjhNu1/YAtgJ8TuCKzEDEs= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -626,9 +633,15 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1 github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.0-beta.4.0.20200813083929-9bdca3d79b97 h1:BFGJgt5fEZhMtNE8VrTWmAMnLptKdn98qLgrSFNmDxY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.0-beta.4.0.20200813083929-9bdca3d79b97/go.mod h1:wK7PFLUnfulN3kJW75Btnhb3iasamaju+L19L0bFXZk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.0-beta.5 h1:fhL1nRLxe6ppWSDwbDMhUIQVVJ8rxskTxWMBRJ8RRiI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.0-beta.5/go.mod h1:fR9dOEfEyRM7ltVH0FTpK/QA6L/5BQq8izXNRu/gyVc= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/boundary v0.0.0-20200925141712-61a0ae02c118 h1:BKIpsdpY+QTVyF7+N1qh08DkbUnZuxdjulYx8Z+XswQ= github.com/hashicorp/boundary v0.0.0-20200925141712-61a0ae02c118/go.mod h1:E3mrD78VR28sTBt44iezxhovgaaH+Gi7b9/sR5JkDeg= +github.com/hashicorp/boundary v0.1.0-beta.1 h1:wcfZHEddYdME5X/vV2C6eu+fcBJi1E5HNVBkpscKYNo= +github.com/hashicorp/boundary v0.1.0-beta.1/go.mod h1:gQfKsvQUgykk3tO2j67ckZ2NBdoXjvwWYM6mT+Z0kMQ= +github.com/hashicorp/boundary v0.1.0-beta.1.0.20200926180149-cf3fa4522d41 h1:hBkjAkjS5KtUUwtJIaRkFCJiPEXQFafSIwVCi5orcAQ= +github.com/hashicorp/boundary v0.1.0-beta.1.0.20200926180149-cf3fa4522d41/go.mod h1:JuTpf1gpV/1BakI3Z3KqQwGDfqAZkUPShtF+w0IruLM= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -763,6 +776,7 @@ github.com/huaweicloud/golangsdk v0.0.0-20200304081349-45ec0797f2a4/go.mod h1:WQ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/iancoleman/strcase v0.1.1/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= +github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -999,6 +1013,8 @@ github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -1021,6 +1037,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= +github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA= @@ -1090,6 +1108,7 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.1 h1:w6GMGWSsCI04fTM8wQRdnW74MuJISakuUU0onU0TYB4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= @@ -1316,6 +1335,7 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= 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= @@ -1450,6 +1470,8 @@ golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOL golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200923182212-328152dc79b1 h1:Iu68XRPd67wN4aRGGWwwq6bZo/25jR6uu52l/j2KkUE= golang.org/x/net v0.0.0-20200923182212-328152dc79b1/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200925080053-05aa5d4ee321 h1:lleNcKRbcaC8MqgLwghIkzZ2JBQAb7QQ9MiwRt1BisA= +golang.org/x/net v0.0.0-20200925080053-05aa5d4ee321/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1540,6 +1562,8 @@ golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d h1:L/IKR6COd7ubZrs2oTnTi73IhgqJ71c9s80WsQnh0Es= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c h1:38q6VNPWR010vN82/SB121GujZNIfAUb4YttE2rhGuc= +golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1627,6 +1651,8 @@ golang.org/x/tools v0.0.0-20200911183043-b43031a33b24 h1:jQYh5/HGlsTxm0nsahbFbD1 golang.org/x/tools v0.0.0-20200911183043-b43031a33b24/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c h1:AQsh/7arPVFDBraQa8x7GoVnwnGg1kM7J2ySI0kF5WU= golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20200921190806-0f52b63a40e8/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20200924224222-8d73f17870ce/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= 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/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1725,8 +1751,12 @@ google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200911024640-645f7a48b24f h1:Yv4xsIx7HZOoyUGSJ2ksDyWE2qIBXROsZKt2ny3hCGM= google.golang.org/genproto v0.0.0-20200911024640-645f7a48b24f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200921165018-b9da36f5f452/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200923140941-5646d36feee1/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200924141100-a14c0a98937d h1:gQhS6YjPEa6qyVIEcEC2oYp5T6vRgv7kJhSqU9Cqhiw= google.golang.org/genproto v0.0.0-20200924141100-a14c0a98937d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200925023002-c2d885f95484 h1:Rr9EZdYRq2WLckzJQVtN3ISKoP7dvgwi7jbglILNZ34= +google.golang.org/genproto v0.0.0-20200925023002-c2d885f95484/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= diff --git a/internal/provider/resource_user.go b/internal/provider/resource_user.go index e841aff1..15dfd72a 100644 --- a/internal/provider/resource_user.go +++ b/internal/provider/resource_user.go @@ -10,6 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) +const userAccountIDsKey = "account_ids" + func resourceUser() *schema.Resource { return &schema.Resource{ CreateContext: resourceUserCreate, @@ -30,6 +32,11 @@ func resourceUser() *schema.Resource { Required: true, ForceNew: true, }, + userAccountIDsKey: { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, }, } } @@ -38,6 +45,7 @@ func setFromUserResponseMap(d *schema.ResourceData, raw map[string]interface{}) d.Set(NameKey, raw["name"]) d.Set(DescriptionKey, raw["description"]) d.Set(ScopeIdKey, raw["scope_id"]) + d.Set(userAccountIDsKey, raw["account_ids"]) d.SetId(raw["id"].(string)) } @@ -74,8 +82,25 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, meta interf if ucr == nil { return diag.Errorf("user nil after create") } + raw := ucr.GetResponseMap() - setFromUserResponseMap(d, ucr.GetResponseMap()) + if val, ok := d.GetOk(userAccountIDsKey); ok { + list := val.(*schema.Set).List() + acctIds := make([]string, 0, len(list)) + for _, i := range list { + acctIds = append(acctIds, i.(string)) + } + usrac, err := usrs.SetAccounts(ctx, ucr.Item.Id, ucr.Item.Version, acctIds) + if err != nil { + return diag.Errorf("error setting accounts on user: %v", err) + } + if usrac == nil { + return diag.Errorf("user nil after setting accounts") + } + raw = usrac.GetResponseMap() + } + + setFromUserResponseMap(d, raw) return nil } @@ -144,6 +169,22 @@ func resourceUserUpdate(ctx context.Context, d *schema.ResourceData, meta interf d.Set(DescriptionKey, desc) } + if d.HasChange(userAccountIDsKey) { + var accountIds []string + if accountsVal, ok := d.GetOk(userAccountIDsKey); ok { + accounts := accountsVal.(*schema.Set).List() + for _, account := range accounts { + accountIds = append(accountIds, account.(string)) + } + + } + _, err := usrs.SetAccounts(ctx, d.Id(), 0, accountIds, users.WithAutomaticVersioning(true)) + if err != nil { + return diag.Errorf("error updating accounts on user: %v", err) + } + d.Set(userAccountIDsKey, accountIds) + } + return nil } diff --git a/internal/provider/resource_user_test.go b/internal/provider/resource_user_test.go index 1a6feeb7..5ce4bcc0 100644 --- a/internal/provider/resource_user_test.go +++ b/internal/provider/resource_user_test.go @@ -35,6 +35,25 @@ resource "boundary_user" "org1" { scope_id = boundary_scope.org1.id depends_on = [boundary_role.org1_admin] }`, fooDescriptionUpdate) + + orgUserWithAccts = ` +resource "boundary_user" "org1" { + name = "test" + description = "with accts" + scope_id = boundary_scope.org1.id + account_ids = [ + boundary_account.foo.id + ] + depends_on = [boundary_role.org1_admin] +}` + + orgUserWithAcctsUpdate = ` +resource "boundary_user" "org1" { + name = "test" + description = "with accts" + scope_id = boundary_scope.org1.id + depends_on = [boundary_role.org1_admin] +}` ) // NOTE: this test also tests out the direct token auth mechanism. @@ -71,6 +90,100 @@ func TestAccUser(t *testing.T) { }) } +func TestAccUserWithAccounts(t *testing.T) { + tc := controller.NewTestController(t, tcConfig...) + defer tc.Shutdown() + url := tc.ApiAddrs()[0] + token := tc.Token().Token + + resource.Test(t, resource.TestCase{ + Providers: testProviders, + CheckDestroy: testAccCheckUserResourceDestroy(t), + Steps: []resource.TestStep{ + { + // test create + Config: testConfigWithToken(url, token, fooOrg, fooAccount, orgUserWithAccts), + Check: resource.ComposeTestCheckFunc( + testAccCheckUserResourceExists("boundary_user.org1"), + testAccCheckAccountResourceExists("boundary_account.foo"), + resource.TestCheckResourceAttr("boundary_user.org1", DescriptionKey, "with accts"), + resource.TestCheckResourceAttr("boundary_user.org1", NameKey, "test"), + testAccCheckUserResourceAccountsSet("boundary_user.org1", []string{"boundary_account.foo"}), + ), + }, + { + // test update description + Config: testConfigWithToken(url, token, fooOrg, fooAccount, orgUserWithAcctsUpdate), + Check: resource.ComposeTestCheckFunc( + testAccCheckUserResourceExists("boundary_user.org1"), + testAccCheckAccountResourceExists("boundary_account.foo"), + resource.TestCheckResourceAttr("boundary_user.org1", DescriptionKey, "with accts"), + resource.TestCheckResourceAttr("boundary_user.org1", NameKey, "test"), + ), + }, + }, + }) +} + +func testAccCheckUserResourceAccountsSet(name string, accounts []string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("user resource not found: %s", name) + } + + id := rs.Primary.ID + if id == "" { + return fmt.Errorf("user resource ID is not set") + } + + // ensure accts are declared in state + acctIDs := []string{} + for _, acctResourceName := range acctIDs { + ur, ok := s.RootModule().Resources[acctResourceName] + if !ok { + return fmt.Errorf("account resource not found: %s", acctResourceName) + } + + acctID := ur.Primary.ID + if id == "" { + return fmt.Errorf("account resource ID not set") + } + + acctIDs = append(acctIDs, acctID) + } + + // check boundary to ensure it matches + md := testProvider.Meta().(*metaData) + usrClient := users.NewClient(md.client) + + u, err := usrClient.Read(context.Background(), id) + if err != nil { + return fmt.Errorf("Got an error when reading user %q: %v", id, err) + } + + // for every account set on the user in the state, ensure + // each group in boundary has the same setings + if len(u.Item.AccountIds) == 0 { + return fmt.Errorf("no account found on user") + } + + for _, stateAccount := range acctIDs { + ok := false + for _, gotAccount := range u.Item.AccountIds { + if gotAccount == stateAccount { + ok = true + } + } + if !ok { + return fmt.Errorf("account in state not set in boundary:\n in state: %+v\n in boundary: %+v", acctIDs, u.Item.AccountIds) + } + } + + return nil + } +} + func testAccCheckUserResourceExists(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] diff --git a/website/docs/r/resource_user.html.markdown b/website/docs/r/resource_user.html.markdown index 1c61702f..620526d7 100644 --- a/website/docs/r/resource_user.html.markdown +++ b/website/docs/r/resource_user.html.markdown @@ -19,9 +19,22 @@ resource "boundary_scope" "org" { auto_create_role = true } -resource "boundary_user" "example" { - name = "My user" - description = "My first user!" +resource "boundary_auth_method" "password" { + scope_id = boundary_scope.org.id + type = "password" +} + +resource "boundary_account" "jeff" { + auth_method_id = boundary_auth_method.password.id + type = "password" + login_name = "jeff" + password = "$uper$ecure" +} + +resource "boundary_user" "jeff" { + name = "jeff" + description = "Jeff's user resource" + account_ids = [boundary_account.jeff.id] scope_id = boundary_scope.org.id } ``` @@ -29,6 +42,7 @@ resource "boundary_user" "example" { ## Argument Reference The following arguments are optional: +* `account_ids` - Account ID's to associate with this user resource. * `name` - The username. Defaults to the resource name. * `description` - The user description. * `scope_id` - The scope ID in which the resource is created. Defaults to the provider's `default_scope` if unset.