diff --git a/go.mod b/go.mod index 0c9e2cde..d38b4690 100644 --- a/go.mod +++ b/go.mod @@ -3,22 +3,41 @@ module github.com/hashicorp/terraform-provider-boundary 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/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/aws/aws-sdk-go v1.34.16 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.526 // indirect + github.com/aws/aws-sdk-go v1.34.31 // 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/hashicorp/boundary v0.0.0-20200921190930-21f5cc274fc1 - github.com/hashicorp/go-kms-wrapping v0.5.14 + github.com/golang/snappy v0.0.2 // indirect + github.com/hashicorp/boundary v0.0.0-20200924213458-fd0da998e851 + 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 github.com/hashicorp/hcl/v2 v2.6.0 // indirect github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.3 github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect + 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/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 + github.com/prometheus/procfs v0.2.0 // indirect + 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/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect - golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a // indirect - google.golang.org/api v0.31.0 // indirect + golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d // 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 7765644a..9fa68c23 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,8 @@ cloud.google.com/go v0.64.0 h1:xVP3LPvMjGT4J0a55y02Gw5y/dkY/rxGz58sfK1jqIo= cloud.google.com/go v0.64.0/go.mod h1:xfORb36jGvE+6EexW71nMEtL025s3x6xvuYUKM4JLv4= cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.66.0 h1:DZeAkuQGQqnm9Xv36SbMJEU8aFBz4wL04UpMWPWwjzg= +cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= @@ -61,44 +63,75 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/AlecAivazis/survey/v2 v2.0.5/go.mod h1:WYBhg6f0y/fNYUuesWQc0PKbJcEliGcYHB9sNT3Bg74= github.com/Azure/azure-sdk-for-go v36.2.0+incompatible h1:09cv2WoH0g6jl6m2iT+R9qcIPZKhXEL0sbmLhxP895s= 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/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= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= github.com/Azure/go-autorest/autorest v0.10.1 h1:uaB8A32IZU9YKs9v50+/LWIWTDHJk2vlGzbfd7FfESI= github.com/Azure/go-autorest/autorest v0.10.1/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest v0.11.6 h1:LIzfhNo9I3+il0KO2JY1/lgJmjig7lY0wFulQNZkbtg= +github.com/Azure/go-autorest/autorest v0.11.6/go.mod h1:V6p3pKZx1KKkJubbxnDWrzNhEIfOy/pTGasLqzHIPHs= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/adal v0.9.4 h1:1/DtH4Szusk4psLBrJn/gocMRIf1ji30WAz3GfyULRQ= +github.com/Azure/go-autorest/autorest/adal v0.9.4/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= +github.com/Azure/go-autorest/autorest/azure/auth v0.5.2 h1:R1pgoZkhXuv4+0ky9r3e5pcnRXWcXGIuPXpC/xkc7uI= +github.com/Azure/go-autorest/autorest/azure/auth v0.5.2/go.mod h1:q98IH4qgc3eWM4/WOeR5+YPmBuy8Lq0jNRDwSM0CuFk= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.1 h1:jwcD1wURu0+hKceV04MubZmKLzwEYOCz6q4aOtVZ+Ng= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.1/go.mod h1:JfDgiIO1/RPu6z42AdQTyjOoCM2MFhLqSBDvMEkDgcg= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= +github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= +github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= +github.com/Azure/go-autorest/autorest/validation v0.3.0 h1:3I9AAI63HfcLtphd9g39ruUwRI+Ca+z/f36KHPFRUss= +github.com/Azure/go-autorest/autorest/validation v0.3.0/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ClickHouse/clickhouse-go v1.3.12/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/datadog-go v4.0.0+incompatible h1:Dq8Dr+4sV1gBO1sHDWdW+4G+PdsA+YSJOK925MxrrCY= +github.com/DataDog/datadog-go v4.0.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -134,6 +167,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190620160927-9418d7b0cd0f h1:oRD16bhpKNAanfcDDVU+J0NXqsgHIvGbbe/sy+r6Rs0= 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/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= @@ -180,6 +215,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.16 h1:22jPsMe98UX/van5Ca/5jXnyNsNpJxCJ1rw/wFAlZ+4= github.com/aws/aws-sdk-go v1.34.16/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-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= @@ -226,6 +263,8 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyY github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/circonus-labs/circonusllhist v0.1.4 h1:G5qJPuD16akpIXMUR7KcfBvrQOVm95+qyqUm+SEAZks= +github.com/circonus-labs/circonusllhist v0.1.4/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= @@ -519,6 +558,8 @@ github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8l github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= +github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= @@ -554,10 +595,13 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -586,6 +630,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.0-beta.4.0.20200813083929-9bdca3d github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/boundary v0.0.0-20200921190930-21f5cc274fc1 h1:EZ8iW8D34b6d/eRwg69tZ7jJtPIi0eYH5/7DAUTyWvI= github.com/hashicorp/boundary v0.0.0-20200921190930-21f5cc274fc1/go.mod h1:o72yXNHyqJ6f1UEfJmWII4hIThwwU9L4L45jdmJgw8Y= +github.com/hashicorp/boundary v0.0.0-20200924213458-fd0da998e851 h1:lYXYEEbHGwFsnPGXdY9azLZQ1Ekf60U1gKjs5edhw0A= +github.com/hashicorp/boundary v0.0.0-20200924213458-fd0da998e851/go.mod h1:o72yXNHyqJ6f1UEfJmWII4hIThwwU9L4L45jdmJgw8Y= 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= @@ -619,10 +665,14 @@ github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.1.0 h1:vN9wG1D6KG6YHRTWr8512cxGOVgTMEfgEdSj/hr8MPc= github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.0 h1:8exGP7ego3OmkfksihtSouGMZ+hQrhxx+FVELeXpVPE= +github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-kms-wrapping v0.5.12 h1:4zZCaLqOob5moaAmpS6ZtGZYm4yOcqvmt2lO+zNXHls= github.com/hashicorp/go-kms-wrapping v0.5.12/go.mod h1:yVIWtGOTh/cdGc++/NOlXLus0hJ19Lz4iFrpF6WsZh4= github.com/hashicorp/go-kms-wrapping v0.5.14 h1:XtNZYE9n4ypz9CnhQc/5Vd6ovGqbHO1lQ3IVPc2TV+w= github.com/hashicorp/go-kms-wrapping v0.5.14/go.mod h1:hKJ7tS+eMXOLxwFs7mYJtPRQtT/rGtwqE6awY3JATCw= +github.com/hashicorp/go-kms-wrapping v0.5.16 h1:7qvB7JYLFART/bt1wafobMU5dDeyseE3ZBKB6UiyxWs= +github.com/hashicorp/go-kms-wrapping v0.5.16/go.mod h1:lxD7e9q7ZyCtDEP+tnMevsEvw3M0gmZnneAgv8BaO1Q= github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= @@ -667,6 +717,8 @@ github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= @@ -701,6 +753,8 @@ github.com/hashicorp/vault/sdk v0.1.14-0.20200519221530-14615acda45f/go.mod h1:W github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10= github.com/hashicorp/vault/sdk v0.1.14-0.20200805123347-1ef507638af6 h1:8bzfSEdW5ztWR73O5ByXbOAx8V6lHL1qTH7PYDLRITI= github.com/hashicorp/vault/sdk v0.1.14-0.20200805123347-1ef507638af6/go.mod h1:+S2qzS1Tex9JgbHxb/Jv7CdZyKydxqg09G/qVvyVmUc= +github.com/hashicorp/vault/sdk v0.1.14-0.20200916184745-5576096032f8 h1:oin8pbTJ+5OTk9JLzcCF1To0A/5Xsq5xJXQYhBTaOS8= +github.com/hashicorp/vault/sdk v0.1.14-0.20200916184745-5576096032f8/go.mod h1:7GBJyKruotYxJlye8yHyGICV7kN7dQCNsCMTrb+v5J0= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -708,6 +762,8 @@ github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce h1:7UnVY3T/ZnHUrfv github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huaweicloud/golangsdk v0.0.0-20200304081349-45ec0797f2a4/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw= 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= @@ -715,6 +771,8 @@ github.com/iancoleman/strcase v0.1.1/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5N 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= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= @@ -806,6 +864,9 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5i github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -926,6 +987,8 @@ github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.1 h1:J64v/xD7Clql+JVKSvkYojLOXu1ibnY9ZjGLwSt/89w= github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -1015,6 +1078,8 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/oracle/oci-go-sdk v12.5.0+incompatible h1:pr08ECoaDKHWO9tnzJB1YqClEs7ZK1CFOez2DQocH14= github.com/oracle/oci-go-sdk v12.5.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= +github.com/oracle/oci-go-sdk v24.3.0+incompatible h1:x4mcfb4agelf1O4/1/auGlZ1lr97jXRSSN5MxTgG/zU= +github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/ory/dockertest/v3 v3.6.0 h1:I6KNJ6izxGduLACQii2SP/g7GN0JM9Xfaik6aAVaw6Y= github.com/ory/dockertest/v3 v3.6.0/go.mod h1:4ZOpj8qBUmh8fcBSVzkH2bws2s91JdGvHUqan4GHEuQ= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -1029,6 +1094,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= @@ -1078,6 +1144,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.11.1 h1:0ZISXCMRuCZcxF77aT1BXY5m74mX2vrGYl1dSwBI0Jo= github.com/prometheus/common v0.11.1/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.14.0 h1:RHRyE8UocrbjU+6UvRzwi6HjiDfxrrBU91TtbKzkGp4= +github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1088,6 +1156,8 @@ github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLk github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -1181,6 +1251,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= @@ -1382,6 +1454,8 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= 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/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= @@ -1471,6 +1545,9 @@ golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a h1:i47hUS795cOydZI4AwJQCKXOr4BvxzvikwDoDtHhP2Y= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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/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= @@ -1553,8 +1630,10 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200827163409-021d7c6f1ec3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200828161849-5deb26317202 h1:DrWbY9UUFi/sl/3HkNVoBjDbGfIPZZfgoGsGxOL1EU8= golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200911183043-b43031a33b24 h1:jQYh5/HGlsTxm0nsahbFbD1h0uPk4ckH+3Iu8OGigtA= golang.org/x/tools v0.0.0-20200911183043-b43031a33b24/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/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= @@ -1589,6 +1668,8 @@ google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/api v0.31.0 h1:1w5Sz/puhxFo9lTtip2n47k7toB/U2nCqOKNHd3Yrbo= google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= +google.golang.org/api v0.32.0 h1:Le77IccnTqEa8ryp9wIpX5W3zYm7Gf9LhOp9PHcwFts= +google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1647,8 +1728,12 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200827165113-ac2560b5e952/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200831141814-d751682dd103 h1:z46CEPU+LlO0kGGwrH8h5epkkJhRZbAHYWOWD9JhLPI= google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= 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-20200924141100-a14c0a98937d h1:gQhS6YjPEa6qyVIEcEC2oYp5T6vRgv7kJhSqU9Cqhiw= +google.golang.org/genproto v0.0.0-20200924141100-a14c0a98937d/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= @@ -1713,6 +1798,8 @@ gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= +gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= diff --git a/internal/provider/provider.go b/internal/provider/provider.go index db492e07..a94afc65 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -128,10 +128,7 @@ func providerAuthenticate(ctx context.Context, d *schema.ResourceData, md *metaD am := authmethods.NewClient(md.client) - at, apiErr, err := am.Authenticate(ctx, authMethodId.(string), credentials) - if apiErr != nil { - return errors.New(apiErr.Message) - } + at, err := am.Authenticate(ctx, authMethodId.(string), credentials) if err != nil { return err } diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 00ec7c1f..02fec983 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -1,15 +1,12 @@ package provider import ( - "context" "crypto/rand" "encoding/base64" "fmt" "strings" "testing" - "github.com/hashicorp/boundary/api" - "github.com/hashicorp/boundary/api/roles" "github.com/hashicorp/boundary/testing/controller" wrapping "github.com/hashicorp/go-kms-wrapping" "github.com/hashicorp/go-kms-wrapping/wrappers/aead" @@ -120,18 +117,6 @@ provider "boundary" { return strings.Join(c, "\n") } -func setGrantScopeIdOnProject(scopeId, grantScopeId, principalId string, client *api.Client) error { - roleClient := roles.NewClient(client) - _, err, _ := roleClient.Create( - context.Background(), - scopeId, - roles.WithName(fmt.Sprintf("TestRole_%s", grantScopeId)), - roles.WithDescription(fmt.Sprintf("Terraform test management role for %s", grantScopeId)), - roles.WithGrantScopeId(grantScopeId)) - - return fmt.Errorf("%s", err.Message) -} - func TestProvider(t *testing.T) { if err := New().InternalValidate(); err != nil { t.Fatalf("err: %s", err) diff --git a/internal/provider/resource_account.go b/internal/provider/resource_account.go index 3a324c6c..cad92db2 100644 --- a/internal/provider/resource_account.go +++ b/internal/provider/resource_account.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/accounts" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -126,15 +127,9 @@ func resourceAccountCreate(ctx context.Context, d *schema.ResourceData, meta int aClient := accounts.NewClient(md.client) - acr, apiErr, err := aClient.Create( - ctx, - authMethodId, - opts...) + acr, err := aClient.Create(ctx, authMethodId, opts...) if err != nil { - return diag.Errorf("error calling create account: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating account: %s", apiErr.Message) + return diag.Errorf("error creating account: %v", err) } if acr == nil { return diag.Errorf("nil account after create") @@ -149,16 +144,13 @@ func resourceAccountRead(ctx context.Context, d *schema.ResourceData, meta inter md := meta.(*metaData) aClient := accounts.NewClient(md.client) - arr, apiErr, err := aClient.Read(ctx, d.Id()) + arr, err := aClient.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read account: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading account: %s", apiErr.Message) + return diag.Errorf("error reading account: %v", err) } if arr == nil { return diag.Errorf("account nil after read") @@ -231,16 +223,9 @@ func resourceAccountUpdate(ctx context.Context, d *schema.ResourceData, meta int if len(opts) > 0 { opts = append(opts, accounts.WithAutomaticVersioning(true)) - _, apiErr, err := aClient.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := aClient.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update account: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating account: %s", apiErr.Message) + return diag.Errorf("error updating account: %v", err) } } @@ -264,12 +249,9 @@ func resourceAccountDelete(ctx context.Context, d *schema.ResourceData, meta int md := meta.(*metaData) aClient := accounts.NewClient(md.client) - _, apiErr, err := aClient.Delete(ctx, d.Id()) + _, err := aClient.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete account: %v", err) - } - if apiErr != nil { - return diag.Errorf("error deleting account: %s", apiErr.Message) + return diag.Errorf("error deleting account: %v", err) } return nil diff --git a/internal/provider/resource_account_test.go b/internal/provider/resource_account_test.go index 25d71b0e..50bc8f7b 100644 --- a/internal/provider/resource_account_test.go +++ b/internal/provider/resource_account_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/accounts" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -108,7 +109,7 @@ func testAccCheckAccountResourceExists(name string) resource.TestCheckFunc { amClient := accounts.NewClient(md.client) - if _, _, err := amClient.Read(context.Background(), id); err != nil { + if _, err := amClient.Read(context.Background(), id); err != nil { return fmt.Errorf("Got an error when reading account %q: %v", id, err) } @@ -130,12 +131,9 @@ func testAccCheckAccountResourceDestroy(t *testing.T) resource.TestCheckFunc { amClient := accounts.NewClient(md.client) - _, apiErr, err := amClient.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed account %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { - return fmt.Errorf("Didn't get a 404 when reading destroyed account %q: %v", id, apiErr) + _, err := amClient.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { + return fmt.Errorf("Didn't get a 404 when reading destroyed account %q: %v", id, err) } default: diff --git a/internal/provider/resource_auth_method.go b/internal/provider/resource_auth_method.go index 16f2e11a..918332dc 100644 --- a/internal/provider/resource_auth_method.go +++ b/internal/provider/resource_auth_method.go @@ -5,6 +5,7 @@ import ( "encoding/json" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/authmethods" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -135,16 +136,9 @@ func resourceAuthMethodCreate(ctx context.Context, d *schema.ResourceData, meta amClient := authmethods.NewClient(md.client) - amcr, apiErr, err := amClient.Create( - ctx, - typeStr, - scopeId, - opts...) + amcr, err := amClient.Create(ctx, typeStr, scopeId, opts...) if err != nil { - return diag.Errorf("error calling create auth method: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating auth method: %s", apiErr.Message) + return diag.Errorf("error creating auth method: %v", err) } if amcr == nil { return diag.Errorf("nil auth method after create") @@ -159,16 +153,13 @@ func resourceAuthMethodRead(ctx context.Context, d *schema.ResourceData, meta in md := meta.(*metaData) amClient := authmethods.NewClient(md.client) - amrr, apiErr, err := amClient.Read(ctx, d.Id()) + amrr, err := amClient.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read auth method: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading auth method: %s", apiErr.Message) + return diag.Errorf("error reading auth method: %v", err) } if amrr == nil { return diag.Errorf("auth method nil after read") @@ -241,16 +232,9 @@ func resourceAuthMethodUpdate(ctx context.Context, d *schema.ResourceData, meta if len(opts) > 0 { opts = append(opts, authmethods.WithAutomaticVersioning(true)) - _, apiErr, err := amClient.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := amClient.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update auth method: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating auth method: %s", apiErr.Message) + return diag.Errorf("error updating auth method: %v", err) } } @@ -274,12 +258,9 @@ func resourceAuthMethodDelete(ctx context.Context, d *schema.ResourceData, meta md := meta.(*metaData) amClient := authmethods.NewClient(md.client) - _, apiErr, err := amClient.Delete(ctx, d.Id()) + _, err := amClient.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete auth method: %v", err) - } - if apiErr != nil { - return diag.Errorf("error deleting auth method: %s", apiErr.Message) + return diag.Errorf("error deleting auth method: %v", err) } return nil diff --git a/internal/provider/resource_auth_method_test.go b/internal/provider/resource_auth_method_test.go index 3f1eeb48..b2d9138b 100644 --- a/internal/provider/resource_auth_method_test.go +++ b/internal/provider/resource_auth_method_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/authmethods" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -86,8 +87,8 @@ func testAccCheckAuthMethodResourceExists(name string) resource.TestCheckFunc { amClient := authmethods.NewClient(md.client) - if _, _, err := amClient.Read(context.Background(), id); err != nil { - return fmt.Errorf("Got an error when reading auth method %q: %v", id, err) + if _, err := amClient.Read(context.Background(), id); err != nil { + return fmt.Errorf("Got an error when reading auth method %q: %w", id, err) } return nil @@ -110,12 +111,9 @@ func testAccCheckAuthMethodResourceDestroy(t *testing.T) resource.TestCheckFunc amClient := authmethods.NewClient(md.client) - _, apiErr, err := amClient.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed auth method %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { - return fmt.Errorf("Didn't get a 404 when reading destroyed auth method %q: %v", id, apiErr) + _, err := amClient.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { + return fmt.Errorf("Didn't get a 404 when reading destroyed auth method %q: %v", id, err) } default: diff --git a/internal/provider/resource_group.go b/internal/provider/resource_group.go index 9573a893..1148070d 100644 --- a/internal/provider/resource_group.go +++ b/internal/provider/resource_group.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/groups" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -76,15 +77,9 @@ func resourceGroupCreate(ctx context.Context, d *schema.ResourceData, meta inter grps := groups.NewClient(md.client) - gcr, apiErr, err := grps.Create( - ctx, - scopeId, - opts...) + gcr, err := grps.Create(ctx, scopeId, opts...) if err != nil { - return diag.Errorf("error calling create group: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating group: %s", apiErr.Message) + return diag.Errorf("error creating group: %v", err) } if gcr == nil { return diag.Errorf("group nil after create") @@ -97,14 +92,7 @@ func resourceGroupCreate(ctx context.Context, d *schema.ResourceData, meta inter for _, i := range list { memberIds = append(memberIds, i.(string)) } - gcsmr, apiErr, err := grps.SetMembers( - ctx, - gcr.Item.Id, - gcr.Item.Version, - memberIds) - if apiErr != nil { - return diag.Errorf("error setting principals on role: %s", apiErr.Message) - } + gcsmr, err := grps.SetMembers(ctx, gcr.Item.Id, gcr.Item.Version, memberIds) if err != nil { return diag.Errorf("error setting principals on role: %v", err) } @@ -123,16 +111,13 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta interfa md := meta.(*metaData) grps := groups.NewClient(md.client) - g, apiErr, err := grps.Read(ctx, d.Id()) + g, err := grps.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read group: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading group: %s", apiErr.Message) + return diag.Errorf("error reading group: %v", err) } if g == nil { return diag.Errorf("group nil after read") @@ -173,16 +158,9 @@ func resourceGroupUpdate(ctx context.Context, d *schema.ResourceData, meta inter if len(opts) > 0 { opts = append(opts, groups.WithAutomaticVersioning(true)) - _, apiErr, err := grps.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := grps.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update group: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating group: %s", apiErr.Message) + return diag.Errorf("error updating group: %v", err) } } @@ -204,18 +182,10 @@ func resourceGroupUpdate(ctx context.Context, d *schema.ResourceData, meta inter } } - _, apiErr, err := grps.SetMembers( - ctx, - d.Id(), - 0, - memberIds, - groups.WithAutomaticVersioning(true)) + _, err := grps.SetMembers(ctx, d.Id(), 0, memberIds, groups.WithAutomaticVersioning(true)) if err != nil { return diag.Errorf("error updating members in group: %v", err) } - if apiErr != nil { - return diag.Errorf("error updating members in group: %s", apiErr.Message) - } d.Set(groupMemberIdsKey, memberIds) } @@ -226,13 +196,10 @@ func resourceGroupDelete(ctx context.Context, d *schema.ResourceData, meta inter md := meta.(*metaData) grps := groups.NewClient(md.client) - _, apiErr, err := grps.Delete(ctx, d.Id()) + _, err := grps.Delete(ctx, d.Id()) if err != nil { return diag.Errorf("error calling delete group: %s", err.Error()) } - if apiErr != nil { - return diag.Errorf("error deleting group: %s", apiErr.Message) - } return nil } diff --git a/internal/provider/resource_group_test.go b/internal/provider/resource_group_test.go index 0ca50fe9..e205a064 100644 --- a/internal/provider/resource_group_test.go +++ b/internal/provider/resource_group_test.go @@ -7,6 +7,7 @@ import ( "strings" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/groups" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -255,13 +256,10 @@ func testAccCheckGroupResourceMembersSet(name string, members []string) resource md := testProvider.Meta().(*metaData) grpsClient := groups.NewClient(md.client) - g, apiErr, err := grpsClient.Read(context.Background(), id) + g, err := grpsClient.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading group %q: %v", id, err) } - if apiErr != nil { - return fmt.Errorf("Got an API error when reading group %q: %v", id, apiErr.Message) - } // for every member set as a member on the group in the state, ensure // each group in boundary has the same setings @@ -300,13 +298,10 @@ func testAccCheckGroupScope(name, prefix string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) grps := groups.NewClient(md.client) - g, apiErr, err := grps.Read(context.Background(), id) + g, err := grps.Read(context.Background(), id) if err != nil { return fmt.Errorf("could not read resource state %q: %v", id, err) } - if apiErr != nil { - return fmt.Errorf("Got an API error when reading group %q: %v", id, apiErr.Message) - } if !strings.HasPrefix(g.Item.ScopeId, prefix) { return fmt.Errorf("Scope ID in state does not have prefix: %s != %s", g.Item.ScopeId, prefix) @@ -331,13 +326,10 @@ func testAccCheckGroupResourceExists(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) grps := groups.NewClient(md.client) - _, apiErr, err := grps.Read(context.Background(), id) + _, err := grps.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading group %q: %v", id, err) } - if apiErr != nil { - return fmt.Errorf("Got an API error when reading group %q: %v", id, apiErr.Message) - } return nil } @@ -362,11 +354,8 @@ func testAccCheckGroupResourceDestroy(t *testing.T) resource.TestCheckFunc { id := rs.Primary.ID - _, apiErr, err := grps.Read(context.Background(), id) - if err != nil { - return err - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { + _, err := grps.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { return fmt.Errorf("Didn't get a 404 when reading destroyed resource %q: %v", id, apiErr) } diff --git a/internal/provider/resource_host.go b/internal/provider/resource_host.go index 4042783a..6a501b7f 100644 --- a/internal/provider/resource_host.go +++ b/internal/provider/resource_host.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/hosts" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -115,15 +116,9 @@ func resourceHostCreate(ctx context.Context, d *schema.ResourceData, meta interf hClient := hosts.NewClient(md.client) - hcr, apiErr, err := hClient.Create( - ctx, - hostCatalogId, - opts...) + hcr, err := hClient.Create(ctx, hostCatalogId, opts...) if err != nil { - return diag.Errorf("error calling create host: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating host: %s", apiErr.Message) + return diag.Errorf("error creating host: %v", err) } if hcr == nil { return diag.Errorf("host nil after create") @@ -138,16 +133,13 @@ func resourceHostRead(ctx context.Context, d *schema.ResourceData, meta interfac md := meta.(*metaData) hClient := hosts.NewClient(md.client) - hrr, apiErr, err := hClient.Read(ctx, d.Id()) + hrr, err := hClient.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read host: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading host: %s", apiErr.Message) + return diag.Errorf("error reading host: %v", err) } if hrr == nil { return diag.Errorf("host nil after read") @@ -204,16 +196,9 @@ func resourceHostUpdate(ctx context.Context, d *schema.ResourceData, meta interf if len(opts) > 0 { opts = append(opts, hosts.WithAutomaticVersioning(true)) - _, apiErr, err := hClient.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := hClient.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update host: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating host: %s", apiErr.Message) + return diag.Errorf("error updating host: %v", err) } } @@ -234,12 +219,9 @@ func resourceHostDelete(ctx context.Context, d *schema.ResourceData, meta interf md := meta.(*metaData) hClient := hosts.NewClient(md.client) - _, apiErr, err := hClient.Delete(ctx, d.Id()) + _, err := hClient.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete host: %v", err) - } - if apiErr != nil { - return diag.Errorf("error deleting host: %s", apiErr.Message) + return diag.Errorf("error deleting host: %v", err) } return nil diff --git a/internal/provider/resource_host_catalog.go b/internal/provider/resource_host_catalog.go index b9c02169..a13896f5 100644 --- a/internal/provider/resource_host_catalog.go +++ b/internal/provider/resource_host_catalog.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/hostcatalogs" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -88,16 +89,9 @@ func resourceHostCatalogCreate(ctx context.Context, d *schema.ResourceData, meta hcClient := hostcatalogs.NewClient(md.client) - hccr, apiErr, err := hcClient.Create( - ctx, - typeStr, - scopeId, - opts...) + hccr, err := hcClient.Create(ctx, typeStr, scopeId, opts...) if err != nil { - return diag.Errorf("error calling create host catalog: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating host catalog: %s", apiErr.Message) + return diag.Errorf("error creating host catalog: %v", err) } if hccr == nil { return diag.Errorf("nil host catalog after create") @@ -112,16 +106,13 @@ func resourceHostCatalogRead(ctx context.Context, d *schema.ResourceData, meta i md := meta.(*metaData) hcClient := hostcatalogs.NewClient(md.client) - hcrr, apiErr, err := hcClient.Read(ctx, d.Id()) + hcrr, err := hcClient.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read host catalog: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading host catalog: %s", apiErr.Message) + return diag.Errorf("error reading host catalog: %v", err) } if hcrr == nil { return diag.Errorf("host catalog nil after read") @@ -162,16 +153,9 @@ func resourceHostCatalogUpdate(ctx context.Context, d *schema.ResourceData, meta if len(opts) > 0 { opts = append(opts, hostcatalogs.WithAutomaticVersioning(true)) - _, apiErr, err := hcClient.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := hcClient.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update host catalog: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating host catalog: %s", apiErr.Message) + return diag.Errorf("error updating host catalog: %v", err) } } @@ -189,12 +173,9 @@ func resourceHostCatalogDelete(ctx context.Context, d *schema.ResourceData, meta md := meta.(*metaData) hcClient := hostcatalogs.NewClient(md.client) - _, apiErr, err := hcClient.Delete(ctx, d.Id()) + _, err := hcClient.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete host catalog: %v", err) - } - if apiErr != nil { - return diag.Errorf("error deleting host catalog: %s", apiErr.Message) + return diag.Errorf("error deleting host catalog: %v", err) } return nil diff --git a/internal/provider/resource_host_catalog_test.go b/internal/provider/resource_host_catalog_test.go index 6f227096..ee571973 100644 --- a/internal/provider/resource_host_catalog_test.go +++ b/internal/provider/resource_host_catalog_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/hostcatalogs" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -83,7 +84,7 @@ func testAccCheckHostCatalogResourceExists(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) hcClient := hostcatalogs.NewClient(md.client) - if _, _, err := hcClient.Read(context.Background(), id); err != nil { + if _, err := hcClient.Read(context.Background(), id); err != nil { return fmt.Errorf("Got an error when reading host catalog %q: %v", id, err) } @@ -104,12 +105,9 @@ func testAccCheckHostCatalogResourceDestroy(t *testing.T) resource.TestCheckFunc id := rs.Primary.ID hcClient := hostcatalogs.NewClient(md.client) - _, apiErr, err := hcClient.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed host catalog %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { - return fmt.Errorf("Didn't get a 404 when reading destroyed host catalog %q: %v", id, apiErr) + _, err := hcClient.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { + return fmt.Errorf("Didn't get a 404 when reading destroyed host catalog %q: %v", id, err) } default: diff --git a/internal/provider/resource_host_set.go b/internal/provider/resource_host_set.go index 77710ac9..2d875f98 100644 --- a/internal/provider/resource_host_set.go +++ b/internal/provider/resource_host_set.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/hostsets" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -105,15 +106,9 @@ func resourceHostsetCreate(ctx context.Context, d *schema.ResourceData, meta int hsClient := hostsets.NewClient(md.client) - hscr, apiErr, err := hsClient.Create( - ctx, - hostsetHostCatalogId, - opts...) + hscr, err := hsClient.Create(ctx, hostsetHostCatalogId, opts...) if err != nil { - return diag.Errorf("error calling create host set: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating host set: %s", apiErr.Message) + return diag.Errorf("error creating host set: %v", err) } if hscr == nil { return diag.Errorf("nil host set after create") @@ -121,14 +116,7 @@ func resourceHostsetCreate(ctx context.Context, d *schema.ResourceData, meta int raw := hscr.GetResponseMap() if hostIds != nil { - hsshr, apiErr, err := hsClient.SetHosts( - ctx, - hscr.Item.Id, - hscr.Item.Version, - hostIds) - if apiErr != nil { - return diag.Errorf("error setting hosts on host set: %s", apiErr.Message) - } + hsshr, err := hsClient.SetHosts(ctx, hscr.Item.Id, hscr.Item.Version, hostIds) if err != nil { return diag.Errorf("error setting hosts on host set: %v", err) } @@ -147,16 +135,13 @@ func resourceHostsetRead(ctx context.Context, d *schema.ResourceData, meta inter md := meta.(*metaData) hsClient := hostsets.NewClient(md.client) - hsrr, apiErr, err := hsClient.Read(ctx, d.Id()) + hsrr, err := hsClient.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read host set: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading host set: %s", apiErr.Message) + return diag.Errorf("error reading host set: %v", err) } if hsrr == nil { return diag.Errorf("host set nil after read") @@ -197,16 +182,9 @@ func resourceHostsetUpdate(ctx context.Context, d *schema.ResourceData, meta int if len(opts) > 0 { opts = append(opts, hostsets.WithAutomaticVersioning(true)) - _, apiErr, err := hsClient.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := hsClient.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update host set: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating host set: %s", apiErr.Message) + return diag.Errorf("error updating host set: %v", err) } } @@ -227,18 +205,10 @@ func resourceHostsetUpdate(ctx context.Context, d *schema.ResourceData, meta int hostIds = append(hostIds, host.(string)) } } - _, apiErr, err := hsClient.SetHosts( - ctx, - d.Id(), - 0, - hostIds, - hostsets.WithAutomaticVersioning(true)) + _, err := hsClient.SetHosts(ctx, d.Id(), 0, hostIds, hostsets.WithAutomaticVersioning(true)) if err != nil { return diag.Errorf("error updating hosts in host set: %v", err) } - if apiErr != nil { - return diag.Errorf("error updating hosts in host set: %s", apiErr.Message) - } d.Set(hostsetHostIdsKey, hostIds) } @@ -249,12 +219,9 @@ func resourceHostsetDelete(ctx context.Context, d *schema.ResourceData, meta int md := meta.(*metaData) hsClient := hostsets.NewClient(md.client) - _, apiErr, err := hsClient.Delete(ctx, d.Id()) + _, err := hsClient.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete host set: %s", err.Error()) - } - if apiErr != nil { - return diag.Errorf("error deleting host set: %s", apiErr.Message) + return diag.Errorf("error deleting host set: %s", err.Error()) } return nil diff --git a/internal/provider/resource_host_set_test.go b/internal/provider/resource_host_set_test.go index cffba5dd..d97573d2 100644 --- a/internal/provider/resource_host_set_test.go +++ b/internal/provider/resource_host_set_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/hostsets" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -114,7 +115,7 @@ func testAccCheckHostsetResourceExists(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) hostsetsClient := hostsets.NewClient(md.client) - if _, _, err := hostsetsClient.Read(context.Background(), id); err != nil { + if _, err := hostsetsClient.Read(context.Background(), id); err != nil { return fmt.Errorf("Got an error when reading hostset %q: %v", id, err) } @@ -155,7 +156,7 @@ func testAccCheckHostsetHostIDsSet(name string, wantHostIDs []string) resource.T hstClient := hostsets.NewClient(client) - hs, _, err := hstClient.Read(context.Background(), id) + hs, err := hstClient.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading hostset %q: %v", id, err) } @@ -197,11 +198,8 @@ func testAccCheckHostsetResourceDestroy(t *testing.T) resource.TestCheckFunc { hostsetsClient := hostsets.NewClient(md.client) - _, apiErr, err := hostsetsClient.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed host set %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { + _, err := hostsetsClient.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { return fmt.Errorf("Didn't get a 404 when reading destroyed host set %q: %v", id, apiErr) } diff --git a/internal/provider/resource_host_test.go b/internal/provider/resource_host_test.go index 5f3c093b..8d3d68c7 100644 --- a/internal/provider/resource_host_test.go +++ b/internal/provider/resource_host_test.go @@ -7,6 +7,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/hosts" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -106,7 +107,7 @@ func testAccCheckHostResourceExists(name string) resource.TestCheckFunc { hostsClient := hosts.NewClient(md.client) - if _, _, err := hostsClient.Read(context.Background(), id); err != nil { + if _, err := hostsClient.Read(context.Background(), id); err != nil { return fmt.Errorf("Got an error when reading host %q: %v", id, err) } @@ -129,7 +130,7 @@ func testAccCheckHostAttributeSet(name, attrKey, wantAttrVal string) resource.Te md := testProvider.Meta().(*metaData) hostsClient := hosts.NewClient(md.client) - h, _, err := hostsClient.Read(context.Background(), id) + h, err := hostsClient.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading host %q: %v", id, err) } @@ -167,11 +168,8 @@ func testAccCheckHostResourceDestroy(t *testing.T) resource.TestCheckFunc { hostsClient := hosts.NewClient(md.client) - _, apiErr, err := hostsClient.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed host %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { + _, err := hostsClient.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { return fmt.Errorf("Didn't get a 404 when reading destroyed host %q: %v", id, apiErr) } diff --git a/internal/provider/resource_role.go b/internal/provider/resource_role.go index 6c946f79..14b7f92b 100644 --- a/internal/provider/resource_role.go +++ b/internal/provider/resource_role.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/roles" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -125,31 +126,17 @@ func resourceRoleCreate(ctx context.Context, d *schema.ResourceData, meta interf rc := roles.NewClient(md.client) - tcr, apiErr, err := rc.Create( - ctx, - scopeId, - opts...) + tcr, err := rc.Create(ctx, scopeId, opts...) if err != nil { return diag.Errorf("error calling create role: %v", err) } - if apiErr != nil { - return diag.Errorf("error creating role: %s", apiErr.Message) - } if tcr == nil { return diag.Errorf("nil role after create") } raw := tcr.GetResponseMap() if principalIds != nil { - tspr, apiErr, err := rc.SetPrincipals( - ctx, - tcr.Item.Id, - 0, - principalIds, - roles.WithAutomaticVersioning(true)) - if apiErr != nil { - return diag.Errorf("error setting principal IDs on role: %s", apiErr.Message) - } + tspr, err := rc.SetPrincipals(ctx, tcr.Item.Id, 0, principalIds, roles.WithAutomaticVersioning(true)) if err != nil { return diag.Errorf("error setting principal IDs on role: %v", err) } @@ -160,15 +147,7 @@ func resourceRoleCreate(ctx context.Context, d *schema.ResourceData, meta interf } if grantStrings != nil { - tsgr, apiErr, err := rc.SetGrants( - ctx, - tcr.Item.Id, - 0, - grantStrings, - roles.WithAutomaticVersioning(true)) - if apiErr != nil { - return diag.Errorf("error setting grant strings on role: %s", apiErr.Message) - } + tsgr, err := rc.SetGrants(ctx, tcr.Item.Id, 0, grantStrings, roles.WithAutomaticVersioning(true)) if err != nil { return diag.Errorf("error setting grant strings on role: %v", err) } @@ -187,16 +166,13 @@ func resourceRoleRead(ctx context.Context, d *schema.ResourceData, meta interfac md := meta.(*metaData) rc := roles.NewClient(md.client) - trr, apiErr, err := rc.Read(ctx, d.Id()) + trr, err := rc.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read role: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading role: %s", apiErr.Message) + return diag.Errorf("error calling read role: %v", err) } if trr == nil { return diag.Errorf("role nil after read") @@ -248,16 +224,9 @@ func resourceRoleUpdate(ctx context.Context, d *schema.ResourceData, meta interf if len(opts) > 0 { opts = append(opts, roles.WithAutomaticVersioning(true)) - _, apiErr, err := rc.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := rc.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update target: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating target: %s", apiErr.Message) + return diag.Errorf("error updating target: %v", err) } } @@ -279,18 +248,10 @@ func resourceRoleUpdate(ctx context.Context, d *schema.ResourceData, meta interf grantStrings = append(grantStrings, grant.(string)) } } - _, apiErr, err := rc.SetGrants( - ctx, - d.Id(), - 0, - grantStrings, - roles.WithAutomaticVersioning(true)) + _, err := rc.SetGrants(ctx, d.Id(), 0, grantStrings, roles.WithAutomaticVersioning(true)) if err != nil { return diag.Errorf("error updating grant strings on role: %v", err) } - if apiErr != nil { - return diag.Errorf("error updating grant strings on role: %s", apiErr.Message) - } d.Set(roleGrantStringsKey, grantStrings) } @@ -302,18 +263,10 @@ func resourceRoleUpdate(ctx context.Context, d *schema.ResourceData, meta interf principalIds = append(principalIds, principal.(string)) } } - _, apiErr, err := rc.SetPrincipals( - ctx, - d.Id(), - 0, - principalIds, - roles.WithAutomaticVersioning(true)) + _, err := rc.SetPrincipals(ctx, d.Id(), 0, principalIds, roles.WithAutomaticVersioning(true)) if err != nil { return diag.Errorf("error updating grant strings on role: %v", err) } - if apiErr != nil { - return diag.Errorf("error updating grant strings on role: %s", apiErr.Message) - } d.Set(rolePrincipalIdsKey, principalIds) } @@ -328,12 +281,9 @@ func resourceRoleDelete(ctx context.Context, d *schema.ResourceData, meta interf md := meta.(*metaData) rc := roles.NewClient(md.client) - _, apiErr, err := rc.Delete(ctx, d.Id()) + _, err := rc.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete role: %s", err.Error()) - } - if apiErr != nil { - return diag.Errorf("error deleting role: %s", apiErr.Message) + return diag.Errorf("error deleting role: %s", err.Error()) } return nil diff --git a/internal/provider/resource_role_test.go b/internal/provider/resource_role_test.go index 6e739abe..940be247 100644 --- a/internal/provider/resource_role_test.go +++ b/internal/provider/resource_role_test.go @@ -8,6 +8,7 @@ import ( "strings" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/roles" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -329,7 +330,8 @@ func testAccCheckRoleDestroyed(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) rolesClient := roles.NewClient(md.client) - if _, apiErr, _ := rolesClient.Read(context.Background(), id); apiErr == nil || apiErr.Status != http.StatusNotFound { + _, err := rolesClient.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { errs = append(errs, fmt.Sprintf("Role not destroyed %q: %v", id, apiErr)) } @@ -352,7 +354,7 @@ func testAccCheckRoleResourceExists(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) rolesClient := roles.NewClient(md.client) - if _, _, err := rolesClient.Read(context.Background(), id); err != nil { + if _, err := rolesClient.Read(context.Background(), id); err != nil { return fmt.Errorf("Got an error when reading role %q: %v", id, err) } @@ -390,7 +392,7 @@ func testAccCheckRoleResourcePrincipalsSet(name string, principals []string) res md := testProvider.Meta().(*metaData) rolesClient := roles.NewClient(md.client) - rr, _, err := rolesClient.Read(context.Background(), id) + rr, err := rolesClient.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading role %q: %v", id, err) } @@ -447,7 +449,7 @@ func testAccCheckRoleResourceGroupsSet(name string, groups []string) resource.Te md := testProvider.Meta().(*metaData) rolesClient := roles.NewClient(md.client) - rr, _, err := rolesClient.Read(context.Background(), id) + rr, err := rolesClient.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading role %q: %v", id, err) } @@ -489,7 +491,7 @@ func testAccCheckRoleResourceGrantsSet(name string, expectedGrants []string) res md := testProvider.Meta().(*metaData) rolesClient := roles.NewClient(md.client) - rr, _, err := rolesClient.Read(context.Background(), id) + rr, err := rolesClient.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading role %q: %v", id, err) } @@ -535,12 +537,9 @@ func testAccCheckRoleResourceDestroy(t *testing.T) resource.TestCheckFunc { id := rs.Primary.ID rolesClient := roles.NewClient(md.client) - _, apiErr, err := rolesClient.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed role %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { - return fmt.Errorf("Didn't get a 404 when reading destroyed role %q: %v", id, apiErr) + _, err := rolesClient.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { + return fmt.Errorf("Didn't get a 404 when reading destroyed role %q: %v", id, err) } default: diff --git a/internal/provider/resource_scope.go b/internal/provider/resource_scope.go index 3f6f9e09..9aee4116 100644 --- a/internal/provider/resource_scope.go +++ b/internal/provider/resource_scope.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/scopes" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -105,15 +106,9 @@ func resourceScopeCreate(ctx context.Context, d *schema.ResourceData, meta inter scp := scopes.NewClient(md.client) - scr, apiErr, err := scp.Create( - ctx, - scopeId, - opts...) + scr, err := scp.Create(ctx, scopeId, opts...) if err != nil { - return diag.Errorf("error calling create scope: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating scope: %s", apiErr.Message) + return diag.Errorf("error creating scope: %v", err) } if scr == nil { return diag.Errorf("scope nil after create") @@ -128,16 +123,13 @@ func resourceScopeRead(ctx context.Context, d *schema.ResourceData, meta interfa md := meta.(*metaData) scp := scopes.NewClient(md.client) - srr, apiErr, err := scp.Read(ctx, d.Id()) + srr, err := scp.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read scope: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading scope: %s", apiErr.Message) + return diag.Errorf("error calling read scope: %v", err) } if srr == nil { return diag.Errorf("scope nil after read") @@ -178,16 +170,9 @@ func resourceScopeUpdate(ctx context.Context, d *schema.ResourceData, meta inter if len(opts) > 0 { opts = append(opts, scopes.WithAutomaticVersioning(true)) - _, apiErr, err := scp.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := scp.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update scope: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating scope: %s", apiErr.Message) + return diag.Errorf("error updating scope: %v", err) } } @@ -209,12 +194,9 @@ func resourceScopeDelete(ctx context.Context, d *schema.ResourceData, meta inter md := meta.(*metaData) scp := scopes.NewClient(md.client) - _, apiErr, err := scp.Delete(ctx, d.Id()) + _, err := scp.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete scope: %v", err) - } - if apiErr != nil { - return diag.Errorf("error deleting scope: %s", apiErr.Message) + return diag.Errorf("error deleting scope: %v", err) } return nil diff --git a/internal/provider/resource_scope_test.go b/internal/provider/resource_scope_test.go index 252889ea..e2c9f3a3 100644 --- a/internal/provider/resource_scope_test.go +++ b/internal/provider/resource_scope_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/scopes" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -148,13 +149,10 @@ func testAccCheckScopeResourceExists(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) scp := scopes.NewClient(md.client) - _, apiErr, err := scp.Read(context.Background(), id) + _, err := scp.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading scope %q: %v", id, err) } - if apiErr != nil { - return fmt.Errorf("Got an API error when reading scope %q: %v", id, apiErr.Message) - } return nil } @@ -170,12 +168,9 @@ func testAccCheckScopeResourceDestroy(t *testing.T) resource.TestCheckFunc { id := rs.Primary.ID switch rs.Type { case "boundary_scope": - _, apiErr, err := scp.Read(context.Background(), id) - if err != nil { - return err - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { - return fmt.Errorf("Didn't get a 404 when reading destroyed resource %q: %v", id, apiErr) + _, err := scp.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { + return fmt.Errorf("Didn't get a 404 when reading destroyed resource %q: %w", id, err) } default: t.Logf("Got unknown resource type %q", rs.Type) diff --git a/internal/provider/resource_target.go b/internal/provider/resource_target.go index 7feeba58..03ba2daf 100644 --- a/internal/provider/resource_target.go +++ b/internal/provider/resource_target.go @@ -5,6 +5,7 @@ import ( "encoding/json" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/targets" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -164,16 +165,9 @@ func resourceTargetCreate(ctx context.Context, d *schema.ResourceData, meta inte tc := targets.NewClient(md.client) - tcr, apiErr, err := tc.Create( - ctx, - typeStr, - scopeId, - opts...) + tcr, err := tc.Create(ctx, typeStr, scopeId, opts...) if err != nil { - return diag.Errorf("error calling create target: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating target: %s", apiErr.Message) + return diag.Errorf("error creating target: %v", err) } if tcr == nil { return diag.Errorf("target nil after create") @@ -181,14 +175,7 @@ func resourceTargetCreate(ctx context.Context, d *schema.ResourceData, meta inte raw := tcr.GetResponseMap() if hostSetIds != nil { - tur, apiErr, err := tc.SetHostSets( - ctx, - tcr.Item.Id, - tcr.Item.Version, - hostSetIds) - if apiErr != nil { - return diag.Errorf("error setting host sets on target: %s", apiErr.Message) - } + tur, err := tc.SetHostSets(ctx, tcr.Item.Id, tcr.Item.Version, hostSetIds) if err != nil { return diag.Errorf("error setting host sets on target: %v", err) } @@ -204,16 +191,13 @@ func resourceTargetRead(ctx context.Context, d *schema.ResourceData, meta interf md := meta.(*metaData) tc := targets.NewClient(md.client) - trr, apiErr, err := tc.Read(ctx, d.Id()) + trr, err := tc.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read target: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading target: %s", apiErr.Message) + return diag.Errorf("error reading target: %v", err) } if trr == nil { return diag.Errorf("target nil after read") @@ -296,16 +280,9 @@ func resourceTargetUpdate(ctx context.Context, d *schema.ResourceData, meta inte if len(opts) > 0 { opts = append(opts, targets.WithAutomaticVersioning(true)) - _, apiErr, err := tc.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := tc.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update target: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating target: %s", apiErr.Message) + return diag.Errorf("error updating target: %v", err) } } @@ -335,18 +312,10 @@ func resourceTargetUpdate(ctx context.Context, d *schema.ResourceData, meta inte hostSetIds = append(hostSetIds, hostSet.(string)) } } - _, apiErr, err := tc.SetHostSets( - ctx, - d.Id(), - 0, - hostSetIds, - targets.WithAutomaticVersioning(true)) + _, err := tc.SetHostSets(ctx, d.Id(), 0, hostSetIds, targets.WithAutomaticVersioning(true)) if err != nil { return diag.Errorf("error updating host sets in target: %v", err) } - if apiErr != nil { - return diag.Errorf("error updating host sets in target: %s", apiErr.Message) - } d.Set(targetHostSetIdsKey, hostSetIds) } @@ -357,12 +326,9 @@ func resourceTargetDelete(ctx context.Context, d *schema.ResourceData, meta inte md := meta.(*metaData) tc := targets.NewClient(md.client) - _, apiErr, err := tc.Delete(ctx, d.Id()) + _, err := tc.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete target: %s", err.Error()) - } - if apiErr != nil { - return diag.Errorf("error deleting target: %s", apiErr.Message) + return diag.Errorf("error deleting target: %s", err.Error()) } return nil diff --git a/internal/provider/resource_target_test.go b/internal/provider/resource_target_test.go index 98869334..9d26e1ed 100644 --- a/internal/provider/resource_target_test.go +++ b/internal/provider/resource_target_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/targets" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -151,7 +152,7 @@ func testAccCheckTargetResourceMembersSet(name string, hostSets []string) resour md := testProvider.Meta().(*metaData) tgtsClient := targets.NewClient(md.client) - t, _, err := tgtsClient.Read(context.Background(), id) + t, err := tgtsClient.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading target %q: %v", id, err) } @@ -191,7 +192,7 @@ func testAccCheckTargetResourceExists(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) tgts := targets.NewClient(md.client) - if _, _, err := tgts.Read(context.Background(), id); err != nil { + if _, err := tgts.Read(context.Background(), id); err != nil { return fmt.Errorf("Got an error when reading target %q: %v", id, err) } @@ -214,11 +215,8 @@ func testAccCheckTargetResourceDestroy(t *testing.T) resource.TestCheckFunc { id := rs.Primary.ID - _, apiErr, err := tgts.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed target %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { + _, err := tgts.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { return fmt.Errorf("Didn't get a 404 when reading destroyed target %q: %v", id, apiErr) } diff --git a/internal/provider/resource_user.go b/internal/provider/resource_user.go index 9df89782..e841aff1 100644 --- a/internal/provider/resource_user.go +++ b/internal/provider/resource_user.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/users" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -66,15 +67,9 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, meta interf usrs := users.NewClient(md.client) - ucr, apiErr, err := usrs.Create( - ctx, - scopeId, - opts...) + ucr, err := usrs.Create(ctx, scopeId, opts...) if err != nil { - return diag.Errorf("error calling create user: %v", err) - } - if apiErr != nil { - return diag.Errorf("error creating user: %s", apiErr.Message) + return diag.Errorf("error creating user: %v", err) } if ucr == nil { return diag.Errorf("user nil after create") @@ -89,16 +84,13 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, meta interfac md := meta.(*metaData) usrs := users.NewClient(md.client) - urr, apiErr, err := usrs.Read(ctx, d.Id()) + urr, err := usrs.Read(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling read user: %v", err) - } - if apiErr != nil { - if apiErr.Status == int32(http.StatusNotFound) { + if apiErr := api.AsServerError(err); apiErr != nil && apiErr.Status == int32(http.StatusNotFound) { d.SetId("") return nil } - return diag.Errorf("error reading user: %s", apiErr.Message) + return diag.Errorf("error calling read user: %v", err) } if urr == nil { return diag.Errorf("user nil after read") @@ -139,16 +131,9 @@ func resourceUserUpdate(ctx context.Context, d *schema.ResourceData, meta interf if len(opts) > 0 { opts = append(opts, users.WithAutomaticVersioning(true)) - _, apiErr, err := usrs.Update( - ctx, - d.Id(), - 0, - opts...) + _, err := usrs.Update(ctx, d.Id(), 0, opts...) if err != nil { - return diag.Errorf("error calling update user: %v", err) - } - if apiErr != nil { - return diag.Errorf("error updating user: %s", apiErr.Message) + return diag.Errorf("error updating user: %v", err) } } @@ -166,12 +151,9 @@ func resourceUserDelete(ctx context.Context, d *schema.ResourceData, meta interf md := meta.(*metaData) usrs := users.NewClient(md.client) - _, apiErr, err := usrs.Delete(ctx, d.Id()) + _, err := usrs.Delete(ctx, d.Id()) if err != nil { - return diag.Errorf("error calling delete user: %v", err) - } - if apiErr != nil { - return diag.Errorf("error deleting user: %s", apiErr.Message) + return diag.Errorf("error deleting user: %v", err) } return nil diff --git a/internal/provider/resource_user_test.go b/internal/provider/resource_user_test.go index c11c9dfd..1a6feeb7 100644 --- a/internal/provider/resource_user_test.go +++ b/internal/provider/resource_user_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/boundary/api" "github.com/hashicorp/boundary/api/users" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -85,13 +86,10 @@ func testAccCheckUserResourceExists(name string) resource.TestCheckFunc { md := testProvider.Meta().(*metaData) usrs := users.NewClient(md.client) - _, apiErr, err := usrs.Read(context.Background(), id) + _, err := usrs.Read(context.Background(), id) if err != nil { return fmt.Errorf("Got an error when reading user %q: %v", id, err) } - if apiErr != nil { - return fmt.Errorf("Got an api error when reading user %q: %v", id, apiErr.Message) - } return nil } @@ -111,12 +109,9 @@ func testAccCheckUserResourceDestroy(t *testing.T) resource.TestCheckFunc { id := rs.Primary.ID usrs := users.NewClient(md.client) - _, apiErr, err := usrs.Read(context.Background(), id) - if err != nil { - return fmt.Errorf("Error when reading destroyed user %q: %v", id, err) - } - if apiErr == nil || apiErr.Status != http.StatusNotFound { - return fmt.Errorf("Didn't get a 404 when reading destroyed user %q: %v", id, apiErr) + _, err := usrs.Read(context.Background(), id) + if apiErr := api.AsServerError(err); apiErr == nil || apiErr.Status != http.StatusNotFound { + return fmt.Errorf("Didn't get a 404 when reading destroyed user %q: %v", id, err) } default: