feat: use scope_id instead of project_id (#19)

This commit is contained in:
Jeff Malnick authored and GitHub committed 2020-08-15 14:49:09 -07:00
1 parent 0bcb0ed506
commit c1069f7303
18 files changed
+499 -639

No files matched your search

+3 -8
View File
@@ -6,10 +6,8 @@ require (
cloud.google.com/go v0.63.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/aws/aws-sdk-go v1.34.3 // indirect
github.com/corbym/gocrest v1.0.3 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.14.6 // indirect
github.com/hashicorp/boundary v0.0.0-20200813180015-7ac4be51c026
github.com/aws/aws-sdk-go v1.34.4 // indirect
github.com/hashicorp/boundary v0.0.0-20200813213948-bb6b18951378
github.com/hashicorp/go-getter v1.4.1 // indirect
github.com/hashicorp/go-plugin v1.3.0 // indirect
github.com/hashicorp/go-retryablehttp v0.6.7 // indirect
@@ -27,11 +25,8 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/zclconf/go-cty v1.5.1 // indirect
github.com/zclconf/go-cty-yaml v1.0.2 // indirect
go.opencensus.io v0.22.4 // indirect
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc // indirect
golang.org/x/sys v0.0.0-20200812155832-6a926be9bd1d // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/tools v0.0.0-20200813181007-d926bd178cf0 // indirect
golang.org/x/tools v0.0.0-20200813203630-136574234359 // indirect
google.golang.org/genproto v0.0.0-20200813001606-1ccf2a5ae4fd // indirect
)
+14 -166
View File
@@ -93,11 +93,7 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym
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/zstd v1.4.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
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=
@@ -115,10 +111,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw=
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=
@@ -163,8 +156,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs=
github.com/armon/go-metrics v0.3.3 h1:a9F4rlj7EWWrbj7BYw8J8+x+ZZkJeqzNyRk8hdPF+ro=
github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
github.com/armon/go-metrics v0.3.4 h1:Xqf+7f2Vhl9tsqDYmXhnXInUdcrtgpRNpIA15/uldSc=
github.com/armon/go-metrics v0.3.4/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
github.com/armon/go-proxyproto v0.0.0-20190211145416-68259f75880e/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
@@ -182,10 +175,8 @@ github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.30.27 h1:9gPjZWVDSoQrBO2AvqrWObS6KAZByfEJxQoCYo4ZfK0=
github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.34.2 h1:9vCknCdTAmmV4ht7lPuda7aJXzllXwEQyCMZKJHjBrM=
github.com/aws/aws-sdk-go v1.34.2/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.34.3 h1:pkbLkV9Q/KY86rbV/WG+yzjNektJbjNRdsTNGtNDZcY=
github.com/aws/aws-sdk-go v1.34.3/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.34.4 h1:Yx49/+ZMCD9YqIVsO3CsiMs4hnUnokd9otKvWYFjnYw=
github.com/aws/aws-sdk-go v1.34.4/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
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=
@@ -228,7 +219,6 @@ github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMe
github.com/cockroachdb/cockroach-go v0.0.0-20190925194419-606b3d062051/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
@@ -255,10 +245,8 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
@@ -298,8 +286,6 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elazarl/go-bindata-assetfs v1.0.1-0.20200509193318-234c15e7648f/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -317,9 +303,7 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/favadi/protoc-go-inject-tag v1.1.0/go.mod h1:13goAxKedbu5IbfI0n2wIKh1CCgZOwPNZQd0igDWvko=
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg=
github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ=
github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE=
github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -343,9 +327,6 @@ github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9p
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
@@ -452,8 +433,6 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
github.com/golang-migrate/migrate/v4 v4.11.0 h1:uqtd0ysK5WyBQ/T1K2uDIooJV0o2Obt6uPwP062DupQ=
github.com/golang-migrate/migrate/v4 v4.11.0/go.mod h1:nqbpDbckcYjsCD5I8q5+NI9Tkk7SVcmaF40Ax1eAWhg=
github.com/golang-migrate/migrate/v4 v4.12.2 h1:QI43Tlouiwpp2dK5Y767OouX0snJNRP/NubsVaArzDU=
github.com/golang-migrate/migrate/v4 v4.12.2/go.mod h1:HQ1DaC8uLHkg4afY8ZQ8D/P5SG+YW9X5INZBVvm+d2k=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
@@ -557,30 +536,15 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.14.5 h1:aiLxiiVzAXb7wb3lAmubA69IokWOoUNe+E7TdGKh8yw=
github.com/grpc-ecosystem/grpc-gateway v1.14.5/go.mod h1:UJ0EZAp832vCd54Wev9N1BMKEyvcZ5+IM0AwDrnlkEc=
github.com/grpc-ecosystem/grpc-gateway v1.14.6 h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o=
github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.0-beta.3 h1:VwE1I7k5WTM4e1XxrbjEcraydH0r0YANCkIdBak58y4=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.0-beta.3/go.mod h1:Nhd2bO7zTYI3aNQDhaYPeydn78AIRtcAa2NabL5nRjU=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
github.com/hashicorp/boundary v0.0.0-20200811212500-4cfab0430733 h1:ggLC4NzAsPGlIj/MTUG4Uvi9VQWMOQIPxJ7JmgcWszs=
github.com/hashicorp/boundary v0.0.0-20200811212500-4cfab0430733/go.mod h1:8yA/eQFUtqTeK2g3XT0Tq49cixWE9/hQOej/lgDwmwY=
github.com/hashicorp/boundary v0.0.0-20200812152719-012967e91b99 h1:gv1LUuj0aUsZuWxWQhqEw0OWJttksrnckAN/4RncukQ=
github.com/hashicorp/boundary v0.0.0-20200812152719-012967e91b99/go.mod h1:8g7VFkhWUIiXYlL50RDdCLBzWfeIEwSDu7+k/k9g38Y=
github.com/hashicorp/boundary v0.0.0-20200813180015-7ac4be51c026 h1:XW4AWxDmcrNzjUst6+4HW4sJ73pDcBZOgGH1ytcTYCU=
github.com/hashicorp/boundary v0.0.0-20200813180015-7ac4be51c026/go.mod h1:NAJ0S5yTsnBjZmHwju9Bfi8AlhqFDLL1lEgw0AYwTy0=
github.com/hashicorp/consul-template v0.22.0/go.mod h1:lHrykBIcPobCuEcIMLJryKxDyk2lUMnQWmffOEONH0k=
github.com/hashicorp/consul-template v0.25.0/go.mod h1:/vUsrJvDuuQHcxEw0zik+YXTS7ZKWZjQeaQhshBmfH0=
github.com/hashicorp/boundary v0.0.0-20200813213948-bb6b18951378 h1:3AwnvO2xs7cIctt9HVBog5GM74lt49Qn7y0Q5tn2FYI=
github.com/hashicorp/boundary v0.0.0-20200813213948-bb6b18951378/go.mod h1:NAJ0S5yTsnBjZmHwju9Bfi8AlhqFDLL1lEgw0AYwTy0=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/api v1.2.1-0.20200128105449-6681be918a6e/go.mod h1:ztzLK20HA5O27oTf2j/wbNgq8qj/crN8xsSx7pzX0sc=
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/consul/sdk v0.2.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM=
github.com/hashicorp/dbassert v0.0.0-20200602132714-30dfb78f0133/go.mod h1:+B5eZq7vXqN4Gxkgjm4ub1bwG6OTcYzFL0r+bMvWorg=
github.com/hashicorp/dbassert v0.0.0-20200602142727-a6709b436ad6 h1:Nejn3Kli0VXWf26vr9XQEGDjw5CELP8rxOwbG4ruFa8=
github.com/hashicorp/dbassert v0.0.0-20200602142727-a6709b436ad6/go.mod h1:+B5eZq7vXqN4Gxkgjm4ub1bwG6OTcYzFL0r+bMvWorg=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
@@ -608,10 +572,6 @@ 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-kms-wrapping v0.5.9 h1:XVl5Ip7LDWBBY0szU9O9d8Ev1+UH/BCWI0swJ2JqU/w=
github.com/hashicorp/go-kms-wrapping v0.5.9/go.mod h1:yVIWtGOTh/cdGc++/NOlXLus0hJ19Lz4iFrpF6WsZh4=
github.com/hashicorp/go-kms-wrapping v0.5.10 h1:n6a1ggDgoP75SoJ3OzVnTBzB0H5fJ5XX1rvuZIBWVaM=
github.com/hashicorp/go-kms-wrapping v0.5.10/go.mod h1:yVIWtGOTh/cdGc++/NOlXLus0hJ19Lz4iFrpF6WsZh4=
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/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g=
@@ -671,7 +631,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k=
github.com/hashicorp/shared-secure-libs v0.0.2 h1:+izKlB8vxpBK+K6zNmB4DZtDEl1a7fB8JmqdBNhnhjs=
github.com/hashicorp/shared-secure-libs v0.0.2/go.mod h1:xhtA0FH6AYYFOy0sir7u0O0zzdLi7ofU6oWxy+gjnuc=
github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY=
github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A=
@@ -687,50 +647,6 @@ github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjy
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
github.com/hashicorp/vault v1.2.1-0.20200519221912-a8c2591d3641 h1:sFzGh4bThye9dcV3XhO6xOtWlhXY73cgfod/B3eqdf0=
github.com/hashicorp/vault v1.2.1-0.20200519221912-a8c2591d3641/go.mod h1:AxZRQLEuX4UQt4GIITGJE/s/dpQJjwQnPfufvchqxFM=
github.com/hashicorp/vault v1.2.1-0.20200521015612-812a92b26b19 h1:UnyS8rJUziC7TLs/0blpiCpbnq3l3fwzkpZG+VLLUWI=
github.com/hashicorp/vault v1.2.1-0.20200521015612-812a92b26b19/go.mod h1:m42VsHQcRRfOQWFUF7eDOjYE18W+ZH2KgQzJezt7YKo=
github.com/hashicorp/vault v1.2.1-0.20200717203022-646babcf458c h1:jROPEF3fbeoBr7l0d4f/6FsIegvMg1kF++T+LFxR6Qs=
github.com/hashicorp/vault v1.2.1-0.20200717203022-646babcf458c/go.mod h1:WoMsvlANd2ANpNMCepzzPlZXd0cpONrtBUE0a5rVqOY=
github.com/hashicorp/vault-plugin-auth-alicloud v0.5.5/go.mod h1:sQ+VNwPQlemgXHXikYH6onfH9gPwDZ1GUVRLz0ZvHx8=
github.com/hashicorp/vault-plugin-auth-azure v0.5.5/go.mod h1:RCVBsf8AJndh4c6iGZtvVZFui9SG0Bj9fnF0SodNIkw=
github.com/hashicorp/vault-plugin-auth-azure v0.5.6/go.mod h1:xUpcusehlkR1cNbA+wNta9W4slS64pYe7CXx5UYM2OQ=
github.com/hashicorp/vault-plugin-auth-centrify v0.5.5/go.mod h1:GfRoy7NHsuR/ogmZtbExdJXUwbfwcxPrS9xzkyy2J/c=
github.com/hashicorp/vault-plugin-auth-cf v0.5.4/go.mod h1:idkFYHc6ske2BE7fe00SpH+SBIlqDKz8vk/IPLJuX2o=
github.com/hashicorp/vault-plugin-auth-gcp v0.5.1/go.mod h1:eLj92eX8MPI4vY1jaazVLF2sVbSAJ3LRHLRhF/pUmlI=
github.com/hashicorp/vault-plugin-auth-gcp v0.6.1/go.mod h1:8eBRzg+JIhAaDBfDndDAQKIhDrQ3WW8OPklxAYftNFs=
github.com/hashicorp/vault-plugin-auth-gcp v0.7.0/go.mod h1:sHDguHmyGScoalGLEjuxvDCrMPVlw2c3f+ieeiHcv6w=
github.com/hashicorp/vault-plugin-auth-jwt v0.6.2/go.mod h1:SFadxIfoLGzugEjwUUmUaCGbsYEz2/jJymZDDQjEqYg=
github.com/hashicorp/vault-plugin-auth-jwt v0.7.0/go.mod h1:ZJJy4b0H3N7CSoJ6iPlWhV9EjHLSoB5NhP06CNm6ImU=
github.com/hashicorp/vault-plugin-auth-kerberos v0.1.5/go.mod h1:r4UqWITHYKmBeAMKPWqLo4V8bl/wNqoSIaQcMpeK9ss=
github.com/hashicorp/vault-plugin-auth-kerberos v0.1.6/go.mod h1:IM/n7LY1rIM4MVzOfSH6cRmY/C2rGkrjGrEr0B/yO9c=
github.com/hashicorp/vault-plugin-auth-kubernetes v0.6.1/go.mod h1:/Y9W5aZULfPeNVRQK0/nrFGpHWyNm0J3UWhOdsAu0vM=
github.com/hashicorp/vault-plugin-auth-kubernetes v0.7.0/go.mod h1:2c/k3nsoGPKV+zpAWCiajt4e66vncEq8Li/eKLqErAc=
github.com/hashicorp/vault-plugin-auth-oci v0.5.4/go.mod h1:j05O2b9fw2Q82NxDPhHMYVfHKvitUYGWfmqmpBdqmmc=
github.com/hashicorp/vault-plugin-auth-oci v0.5.5/go.mod h1:Cn5cjR279Y+snw8LTaiLTko3KGrbigRbsQPOd2D5xDw=
github.com/hashicorp/vault-plugin-database-elasticsearch v0.5.4/go.mod h1:QjGrrxcRXv/4XkEZAlM0VMZEa3uxKAICFqDj27FP/48=
github.com/hashicorp/vault-plugin-database-mongodbatlas v0.1.1/go.mod h1:MP3kfr0N+7miOTZFwKv952b9VkXM4S2Q6YtQCiNKWq8=
github.com/hashicorp/vault-plugin-database-mongodbatlas v0.1.2/go.mod h1:HTXNzFr/SAVtJOs7jz0XxZ69jlKtaceEwp37l86UAQ0=
github.com/hashicorp/vault-plugin-secrets-ad v0.6.4-beta1.0.20200518124111-3dceeb3ce90e/go.mod h1:SCsKcChP8yrtOHXOeTD7oRk0oflj3IxA9y9zTOGtQ8s=
github.com/hashicorp/vault-plugin-secrets-ad v0.6.5/go.mod h1:kk98nB+cwDbt3I7UGQq3ota7+eHZrGSTQZfSRGpluvA=
github.com/hashicorp/vault-plugin-secrets-ad v0.6.6/go.mod h1:L5L6NoJFxRvgxhuA2sWhloc3sbgmE7KxhNcoRxcaH9U=
github.com/hashicorp/vault-plugin-secrets-alicloud v0.5.5/go.mod h1:gAoReoUpBHaBwkxQqTK7FY8nQC0MuaZHLiW5WOSny5g=
github.com/hashicorp/vault-plugin-secrets-azure v0.5.6/go.mod h1:Q0cIL4kZWnMmQWkBfWtyOd7+JXTEpAyU4L932PMHq3E=
github.com/hashicorp/vault-plugin-secrets-azure v0.6.1/go.mod h1:w5eMWJUQPNgxij3WpeJKGs+Ng2Mm7mD/IeCI1ZAgbfk=
github.com/hashicorp/vault-plugin-secrets-gcp v0.6.1/go.mod h1:jVTE1fuhRcBOb/gnCT9W++AnlwiyQEX4S8iVCKhKQsE=
github.com/hashicorp/vault-plugin-secrets-gcp v0.6.3/go.mod h1:psRQ/dm5XatoUKLDUeWrpP9icMJNtu/jmscUr37YGK4=
github.com/hashicorp/vault-plugin-secrets-gcpkms v0.5.5/go.mod h1:b6RwFD1bny1zbfqhD35iGJdQYHRtJLx3HfBD109GO38=
github.com/hashicorp/vault-plugin-secrets-gcpkms v0.5.6/go.mod h1:hhwps56f2ATeC4Smgghrc5JH9dXR31b4ehSf1HblP5Q=
github.com/hashicorp/vault-plugin-secrets-kv v0.5.5/go.mod h1:oNyUoMMQq6uNTwyYPnkldiedaknYbPfQIdKoyKQdy2g=
github.com/hashicorp/vault-plugin-secrets-kv v0.5.6/go.mod h1:B/Cybh5aVF7LNAMHwVBxY8t7r2eL0C6HVGgTyP4nKK4=
github.com/hashicorp/vault-plugin-secrets-mongodbatlas v0.1.2/go.mod h1:YRW9zn9NZNitRlPYNAWRp/YEdKCF/X8aOg8IYSxFT5Y=
github.com/hashicorp/vault-plugin-secrets-openldap v0.1.0-beta1.0.20200515114020-e19ec0ccabc3/go.mod h1:mfMeH+oOuVMgJVQahScA7ic+q8HfzHTocE3xJhmk4Co=
github.com/hashicorp/vault-plugin-secrets-openldap v0.1.4/go.mod h1:SeP/cV0AF4gxkPOvbsLyOIjNjbI6hsIs6fQb8IZldM4=
github.com/hashicorp/vault/api v1.0.1/go.mod h1:AV/+M5VPDpB90arloVX0rVDUIHkONiwz5Uza9HRtpUE=
github.com/hashicorp/vault/api v1.0.5-0.20190730042357-746c0b111519/go.mod h1:i9PKqwFko/s/aihU1uuHGh/FaQS+Xcgvd9dvnfAvQb0=
github.com/hashicorp/vault/api v1.0.5-0.20200215224050-f6547fa8e820/go.mod h1:3f12BMfgDGjTsTtIUj+ZKZwSobQpZtYGFIEehOv5z1o=
github.com/hashicorp/vault/api v1.0.5-0.20200317185738-82f498082f02/go.mod h1:3f12BMfgDGjTsTtIUj+ZKZwSobQpZtYGFIEehOv5z1o=
github.com/hashicorp/vault/api v1.0.5-0.20200514164214-89b1987e38c2 h1:lfjJouPlC/inHjTOqe48N/BiLshU2YZqkxkUbNPj4fU=
github.com/hashicorp/vault/api v1.0.5-0.20200514164214-89b1987e38c2/go.mod h1:P8A7gn1a6j/7qQ4zOaWI6FC/Q9jQWEBRTOwZH33tC9o=
github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f h1:PYtnlUZzFSZxPcq7mYp5oC9N+BcJ8IKYf6/EG0GHM2Y=
@@ -743,36 +659,8 @@ github.com/hashicorp/vault/sdk v0.1.14-0.20200514164214-89b1987e38c2 h1:nFnSG20c
github.com/hashicorp/vault/sdk v0.1.14-0.20200514164214-89b1987e38c2/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10=
github.com/hashicorp/vault/sdk v0.1.14-0.20200519221530-14615acda45f/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10=
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.20200519221912-a8c2591d3641 h1:9xAZq2ZUPFaDfNwMq4TFJ5LP6+Mtx8Sp0ZPhGOdF5Lk=
github.com/hashicorp/vault/sdk v0.1.14-0.20200519221912-a8c2591d3641/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10=
github.com/hashicorp/vault/sdk v0.1.14-0.20200527182800-ad90e0b39d2f/go.mod h1:B2Cbv/tzj8btUA5FF4SvYclTujJhlWU6siK4vo8tgXM=
github.com/hashicorp/vault/sdk v0.1.14-0.20200717191844-f687267c8086 h1:ghsgn2TvpQNvpQngqXoqfKmahdi8e4AHmxvMjOPyih4=
github.com/hashicorp/vault/sdk v0.1.14-0.20200717191844-f687267c8086/go.mod h1:/dxrWZeq4ThnQCgTqVibr1LpONG7AXU7RFFPsd8lqNs=
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/watchtower v0.0.0-20200521055752-236ff297b244 h1:UPz7iN1vdZHW9tPlIK4KXiPojQSeWdhREJ8OjLS5lcs=
github.com/hashicorp/watchtower v0.0.0-20200521055752-236ff297b244/go.mod h1:C7SdCixAYS6HEDs1vdvy/DFjGTScNQQ/lUbgqt6rPCg=
github.com/hashicorp/watchtower v0.0.0-20200526204621-44152ae63ead h1:oiRLv6gJegNclrkDJ0fBV14igEx3DLmJHoxVCiCDyQw=
github.com/hashicorp/watchtower v0.0.0-20200526204621-44152ae63ead/go.mod h1:2MX4EmOXUbH1IUKOw/0Ov+p0dqSLJcDnFXaU7nLrwuY=
github.com/hashicorp/watchtower v0.0.0-20200605200258-d374ac6d4cdc h1:SxZA348gv1yCLSvLEBVCxSF0cw2F1nchNf81cGGg5T0=
github.com/hashicorp/watchtower v0.0.0-20200605200258-d374ac6d4cdc/go.mod h1:sMFje9U/WYZKIiEzmcuJfWb8i7Uqh+y0ET0Fck2HZk4=
github.com/hashicorp/watchtower v0.0.0-20200609011200-5333482ff89f h1:wP70LU8w0LjK3Z/WNjf5uMZduvCTwZn+RFSR784rCu4=
github.com/hashicorp/watchtower v0.0.0-20200609011200-5333482ff89f/go.mod h1:sMFje9U/WYZKIiEzmcuJfWb8i7Uqh+y0ET0Fck2HZk4=
github.com/hashicorp/watchtower v0.0.0-20200622202726-0c8385b42359 h1:rDuxADQN0Mqqwm1moGQTWdjB+z929vmXH6KMcm43Voo=
github.com/hashicorp/watchtower v0.0.0-20200622202726-0c8385b42359/go.mod h1:dkyM9Wf1hgp6XEQJhPO03SQ93XJ78KjUYzRJfp+Essc=
github.com/hashicorp/watchtower v0.0.0-20200708212020-732c07126d09 h1:lgozYOFpXTKqGSvNG8wW3cxHHFi/RyEuj6B7c6REmrs=
github.com/hashicorp/watchtower v0.0.0-20200708212020-732c07126d09/go.mod h1:y22wYAss3hsYe/BtE0p7xSH1NeZQp8UKhpbTA8tVOl0=
github.com/hashicorp/watchtower v0.0.0-20200708220901-3d2677293aa1 h1:Q7ss1fVPAowQ1ZdjPlsFeykUmK0BCQCcKUIIXldlBFo=
github.com/hashicorp/watchtower v0.0.0-20200708220901-3d2677293aa1/go.mod h1:y22wYAss3hsYe/BtE0p7xSH1NeZQp8UKhpbTA8tVOl0=
github.com/hashicorp/watchtower v0.0.0-20200711160049-acce195dcb9b h1:LOdNdNjahdp6shYc0V/OOWO8Z31vwkcQTSiWWZ0NpPc=
github.com/hashicorp/watchtower v0.0.0-20200711160049-acce195dcb9b/go.mod h1:y22wYAss3hsYe/BtE0p7xSH1NeZQp8UKhpbTA8tVOl0=
github.com/hashicorp/watchtower v0.0.0-20200712191642-8210960f2118 h1:L0Ahw70N3ixb38rFlMsL1LkIws0xDEhcmbOkJ4MP7lY=
github.com/hashicorp/watchtower v0.0.0-20200712191642-8210960f2118/go.mod h1:QqWMjDaiUBRW9AafTTqb1HFXZEK4wCqOkeYMvlx1CaM=
github.com/hashicorp/watchtower v0.0.0-20200712212453-26d36ec7460c h1:ZlGmrFEcPWruehrI5Hl1IyTCv3jnvkxgbGtKrF4IAk0=
github.com/hashicorp/watchtower v0.0.0-20200712212453-26d36ec7460c/go.mod h1:QqWMjDaiUBRW9AafTTqb1HFXZEK4wCqOkeYMvlx1CaM=
github.com/hashicorp/watchtower v0.0.0-20200713025149-b46cdad3c52e h1:3SXFlSQm7d2EuL0tBCbnRoelKZN7cT3+BZJdwIJzIC8=
github.com/hashicorp/watchtower v0.0.0-20200713025149-b46cdad3c52e/go.mod h1:i9wJ1Q4eQ0ES4NWpc57eDfZBpKLlji2m1x4pJJtNb44=
github.com/hashicorp/watchtower v0.0.0-20200724221034-4fa8c5415bb5 h1:CeE14NAlvBh8eZu1cwf98JrL9rFYwUfIyY8BxxPvgPw=
github.com/hashicorp/watchtower v0.0.0-20200724221034-4fa8c5415bb5/go.mod h1:pCvcDbaKuYRCOGrGF2eE92T3OaMnUkcModOecy7CMQI=
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=
@@ -785,7 +673,6 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK
github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/influxdb v0.0.0-20190411212539-d24b7ba8c4c4/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY=
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=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
@@ -876,15 +763,14 @@ github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeY
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=
github.com/joyent/triton-go v1.7.1-0.20200416154420-6801d15b779f/go.mod h1:KDSfL7qe5ZfQqvlDMkVjCztbmcpp/c8M77vhQP8ZPvk=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
@@ -936,16 +822,12 @@ github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.6.0 h1:I5DPxhYJChW9KYc66se+oKFFQX6VuQrKiprsX6ivRZc=
github.com/lib/pq v1.6.0/go.mod h1:4vXEAYvW1fRQ2/FhZ78H73A60MHw1geSm145z2mdY1g=
github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY=
github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.7.1/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg=
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/lyft/protoc-gen-star v0.4.10/go.mod h1:mE8fbna26u7aEA2QCVvvfBU/ZrPgocG1206xAFPcs94=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
@@ -1031,9 +913,7 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
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/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA=
github.com/natefinch/atomic v0.0.0-20150920032501-a62ce929ffcc/go.mod h1:1rLVY/DWf3U6vSZgH16S7pymfrhK2lcUlXjgGglw/lY=
github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg=
github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
@@ -1041,15 +921,10 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/neo4j-drivers/gobolt v1.7.4/go.mod h1:O9AUbip4Dgre+CD3p40dnMD4a4r52QBIfblg5k7CTbE=
github.com/neo4j/neo4j-go-driver v1.7.4/go.mod h1:aPO0vVr+WnhEJne+FgFjfsjzAnssPFLucHgGZ76Zb/U=
github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:ncO5VaFWh0Nrt+4KT4mOZboaczBZcLuHrG+/sUeP8gI=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso=
github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
@@ -1084,21 +959,17 @@ github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKw
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA=
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
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/ory/dockertest/v3 v3.6.0 h1:I6KNJ6izxGduLACQii2SP/g7GN0JM9Xfaik6aAVaw6Y=
github.com/ory/dockertest/v3 v3.6.0/go.mod h1:4ZOpj8qBUmh8fcBSVzkH2bws2s91JdGvHUqan4GHEuQ=
github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2/go.mod h1:L3UMQOThbttwfYRNFOWLLVXMhk5Lkio4GGOtw5UrxS0=
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
@@ -1106,12 +977,8 @@ 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/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
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.2.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw=
github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI=
github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pires/go-proxyproto v0.1.3 h1:2XEuhsQluSNA5QIQkiUv8PfgZ51sNYIQkq/yFquiSQM=
@@ -1123,7 +990,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -1142,6 +1008,7 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
github.com/prometheus/client_golang v1.4.0 h1:YVIb/fVcOTMSqtqZWSKnHpSLBxu8DKgxq8z6RuBZwqI=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
@@ -1159,6 +1026,7 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2
github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
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/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=
@@ -1168,6 +1036,7 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
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/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=
@@ -1186,9 +1055,7 @@ github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUW
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
@@ -1273,7 +1140,6 @@ github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oW
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
github.com/vmihailenco/msgpack v3.3.3+incompatible h1:wapg9xDUZDzGCNFlwc5SqI1rvcciqcxEHac4CYj89xI=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU=
@@ -1305,9 +1171,7 @@ github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxt
gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.etcd.io/etcd v0.5.0-alpha.5.0.20200425165423-262c93980547/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM=
go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.1.0/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
@@ -1337,7 +1201,6 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -1536,15 +1399,11 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y=
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 h1:5/PjkGUjvEU5Gl6BxmvKRPpqo2uNMv4rcHBMwzk/st8=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c=
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns=
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200812155832-6a926be9bd1d h1:QQrM/CCYEzTs91GZylDCQjGHudbPTxF/1fvXdVh5lMo=
golang.org/x/sys v0.0.0-20200812155832-6a926be9bd1d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1627,10 +1486,8 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200806022845-90696ccdc692/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200807210451-92211316783d h1:0SXIh1o35VoSHeXm4dE5uYlKU5JI3lUMW3b9j+QgTjE=
golang.org/x/tools v0.0.0-20200807210451-92211316783d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200811215021-48a8ffc5b207 h1:8Kg+JssU1jBZs8GIrL5pl4nVyaqyyhdmHAR4D1zGErg=
golang.org/x/tools v0.0.0-20200811215021-48a8ffc5b207/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200813181007-d926bd178cf0 h1:KFeeZ1lg7PGYIr3m8fLUdHoZ0Aqo9sI4gqdsqrmVYkE=
golang.org/x/tools v0.0.0-20200813181007-d926bd178cf0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200813203630-136574234359 h1:eZBCv5amWGFL95UzDqwTieckVDxgaiUg+KkNnNc62hQ=
golang.org/x/tools v0.0.0-20200813203630-136574234359/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
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=
@@ -1682,7 +1539,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190513181449-d00d292a067c/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
@@ -1719,15 +1575,12 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98 h1:LCO0fg4kb6WwkXQXRQQgUYsFeFb5taTX5WAx5O/Vt28=
google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200808173500-a06252235341 h1:Kceb+1TNS2X7Cj/A+IUTljNerF/4wOFjlFJ0RGHYKKE=
google.golang.org/genproto v0.0.0-20200808173500-a06252235341/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200813001606-1ccf2a5ae4fd h1:pCOIJgz7MD1XjLsF1K0X2xI97dR8sEXS34ZcYl7fcNE=
google.golang.org/genproto v0.0.0-20200813001606-1ccf2a5ae4fd/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=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -1781,9 +1634,6 @@ gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:a
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
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.54.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.55.0 h1:E8yzL5unfpW3M6fz/eB7Cb5MQAYSZ7GKo4Qth+N2sgQ=
gopkg.in/ini.v1 v1.55.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/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo=
@@ -1793,8 +1643,6 @@ gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuv
gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.4.1 h1:H0TmLt7/KmzlrDOpa1F+zr0Tk90PbJYBfsVUmRLrf9Y=
gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w=
gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+2 -2
View File
@@ -99,12 +99,12 @@ func providerConfigure(p *schema.Provider) schema.ConfigureFunc {
if err != nil {
return nil, err
}
if err := client.SetAddr(d.Get("base_url").(string)); err != nil {
return nil, err
}
client.SetScopeId(d.Get("default_organization").(string))
client.SetScopeId(d.Get("default_scope").(string))
// TODO: Pass these in through the config, add token, etc...
client.SetLimiter(5, 5)
at, err := providerAuthenticate(d, client)
+2 -2
View File
@@ -45,7 +45,7 @@ func testConfig(url string, res ...string) string {
provider := fmt.Sprintf(`
provider "boundary" {
base_url = "%s"
default_organization = "%s"
default_scope = "%s"
auth_method_id = "%s"
auth_method_username = "%s"
auth_method_password = "%s"
@@ -64,7 +64,7 @@ func setGrantScopeIDonProject(projID string, principalID string, client *api.Cli
roles.WithDescription(fmt.Sprintf("Terraform test management role for %s", projID)),
roles.WithGrantScopeId(projID))
return err
return fmt.Errorf("%s", err.Message)
}
func TestProvider(t *testing.T) {
+31 -42
View File
@@ -11,7 +11,7 @@ import (
const (
groupNameKey = "name"
groupDescriptionKey = "description"
groupProjectIDKey = "project_id"
groupScopeIDKey = "scope_id"
)
func resourceGroup() *schema.Resource {
@@ -29,13 +29,14 @@ func resourceGroup() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
groupProjectIDKey: {
groupScopeIDKey: {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
},
},
}
}
// convertGroupToResourceData creates a ResourceData type from a Group
@@ -53,7 +54,7 @@ func convertGroupToResourceData(g *groups.Group, d *schema.ResourceData) error {
}
if g.Scope.Id != "" {
if err := d.Set(groupProjectIDKey, g.Scope.Id); err != nil {
if err := d.Set(groupScopeIDKey, g.Scope.Id); err != nil {
return err
}
}
@@ -64,16 +65,19 @@ func convertGroupToResourceData(g *groups.Group, d *schema.ResourceData) error {
}
// convertResourceDataToGroup returns a localy built Group using the values provided in the ResourceData.
func convertResourceDataToGroup(d *schema.ResourceData) *groups.Group {
func convertResourceDataToGroup(d *schema.ResourceData, meta *metaData) *groups.Group {
g := &groups.Group{Scope: &scopes.ScopeInfo{}}
if descVal, ok := d.GetOk(groupDescriptionKey); ok {
g.Description = descVal.(string)
}
if nameVal, ok := d.GetOk(groupNameKey); ok {
g.Name = nameVal.(string)
}
if projIDVal, ok := d.GetOk(groupProjectIDKey); ok {
g.Scope.Id = projIDVal.(string)
if scopeIDVal, ok := d.GetOk(groupScopeIDKey); ok {
g.Scope.Id = scopeIDVal.(string)
}
if d.Id() != "" {
@@ -88,15 +92,14 @@ func resourceGroupCreate(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
g := convertResourceDataToGroup(d)
projClient := client.Clone()
if g.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", g.Name, g.Scope.Id)
projClient.SetScopeId(g.Scope.Id)
}
grps := groups.NewGroupsClient(projClient)
g := convertResourceDataToGroup(d, md)
grps := groups.NewGroupsClient(client)
g, apiErr, err := grps.Create(ctx, groups.WithName(g.Name), groups.WithDescription(g.Description))
g, apiErr, err := grps.Create(
ctx,
groups.WithScopeId(g.Scope.Id),
groups.WithName(g.Name),
groups.WithDescription(g.Description))
if err != nil {
return fmt.Errorf("error creating group: %s", err.Error())
}
@@ -104,9 +107,7 @@ func resourceGroupCreate(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("error creating group: %s", apiErr.Message)
}
d.SetId(g.Id)
return nil
return convertGroupToResourceData(g, d)
}
func resourceGroupRead(d *schema.ResourceData, meta interface{}) error {
@@ -114,15 +115,10 @@ func resourceGroupRead(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
g := convertResourceDataToGroup(d)
projClient := client.Clone()
if g.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", g.Name, g.Scope.Id)
projClient.SetScopeId(g.Scope.Id)
}
grps := groups.NewGroupsClient(projClient)
g := convertResourceDataToGroup(d, md)
grps := groups.NewGroupsClient(client)
g, apiErr, err := grps.Read(ctx, g.Id)
g, apiErr, err := grps.Read(ctx, g.Id, groups.WithScopeId(g.Scope.Id))
if err != nil {
return fmt.Errorf("error reading group: %s", err.Error())
}
@@ -138,13 +134,8 @@ func resourceGroupUpdate(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
g := convertResourceDataToGroup(d)
projClient := client.Clone()
if g.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", g.Name, g.Scope.Id)
projClient.SetScopeId(g.Scope.Id)
}
grps := groups.NewGroupsClient(projClient)
g := convertResourceDataToGroup(d, md)
grps := groups.NewGroupsClient(client)
if d.HasChange(groupNameKey) {
g.Name = d.Get(groupNameKey).(string)
@@ -154,10 +145,13 @@ func resourceGroupUpdate(d *schema.ResourceData, meta interface{}) error {
g.Description = d.Get(groupDescriptionKey).(string)
}
g.Scope.Id = d.Get(groupScopeIDKey).(string)
g, apiErr, err := grps.Update(
ctx,
g.Id,
0,
groups.WithScopeId(g.Scope.Id),
groups.WithAutomaticVersioning(),
groups.WithName(g.Name),
groups.WithDescription(g.Description))
@@ -165,7 +159,7 @@ func resourceGroupUpdate(d *schema.ResourceData, meta interface{}) error {
return err
}
if apiErr != nil {
return fmt.Errorf("error updating group: %s\n Invalid request fields: %v\n", apiErr.Message, apiErr.Details.RequestFields)
return fmt.Errorf("%+v\n", apiErr.Message)
}
return convertGroupToResourceData(g, d)
@@ -176,15 +170,10 @@ func resourceGroupDelete(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
g := convertResourceDataToGroup(d)
projClient := client.Clone()
if g.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", g.Name, g.Scope.Id)
projClient.SetScopeId(g.Scope.Id)
}
grps := groups.NewGroupsClient(projClient)
g := convertResourceDataToGroup(d, md)
grps := groups.NewGroupsClient(client)
_, apiErr, err := grps.Delete(ctx, g.Id)
_, apiErr, err := grps.Delete(ctx, g.Id, groups.WithScopeId(g.Scope.Id))
if err != nil {
return fmt.Errorf("error deleting group: %s", err.Error())
}
+75 -53
View File
@@ -1,10 +1,8 @@
package provider
import (
"errors"
"fmt"
"net/http"
"strings"
"testing"
"github.com/hashicorp/boundary/api/groups"
@@ -31,19 +29,36 @@ resource "boundary_group" "foo" {
description = "%s"
}`, fooGroupDescriptionUpdate)
orgToProjectGroupUpdate = fmt.Sprintf(`
resource "boundary_group" "foo" {
name = "test"
description = "%s"
scope_id = boundary_project.foo.id
}`, fooGroupDescriptionUpdate)
projGroup = fmt.Sprintf(`
resource "boundary_group" "foo" {
name = "test"
description = "%s"
project_id = boundary_project.foo.id
scope_id = boundary_project.foo.id
}`, fooGroupDescription)
projGroupUpdate = fmt.Sprintf(`
resource "boundary_group" "foo" {
name = "test"
description = "%s"
project_id = boundary_project.foo.id
scope_id = boundary_project.foo.id
}`, fooGroupDescriptionUpdate)
// TODO When removing the scope_id the provider does not revert back to the provider
// default scope. As a workaround, you can move the resource into the org scope by
// manually setting the org scope ID as the scope_id field.
projToOrgGroupUpdate = fmt.Sprintf(`
resource "boundary_group" "foo" {
name = "test"
description = "%s"
scope_id = "%s"
}`, fooGroupDescriptionUpdate, tcOrg)
)
func TestAccGroup(t *testing.T) {
@@ -56,23 +71,6 @@ func TestAccGroup(t *testing.T) {
Providers: testProviders,
CheckDestroy: testAccCheckGroupResourceDestroy(t),
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, fooProject, projGroup),
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescription),
resource.TestCheckResourceAttr("boundary_group.foo", groupNameKey, "test"),
),
},
{
// test update
Config: testConfig(url, fooProject, projGroupUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescriptionUpdate),
),
},
{
// test create
Config: testConfig(url, orgGroup),
@@ -80,6 +78,7 @@ func TestAccGroup(t *testing.T) {
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescription),
resource.TestCheckResourceAttr("boundary_group.foo", groupNameKey, "test"),
resource.TestCheckResourceAttr("boundary_group.foo", groupScopeIDKey, tcOrg),
),
},
{
@@ -88,59 +87,81 @@ func TestAccGroup(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescriptionUpdate),
resource.TestCheckResourceAttr("boundary_group.foo", groupScopeIDKey, tcOrg),
),
},
{
// test destroy
Config: testConfig(url),
// test update to project scope
Config: testConfig(url, fooProject, orgToProjectGroupUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupDestroyed("boundary_group.foo"),
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescriptionUpdate),
testAccCheckGroupProjectScope("boundary_group.foo"),
),
},
{
// test create
Config: testConfig(url, fooProject, projGroup),
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescription),
resource.TestCheckResourceAttr("boundary_group.foo", groupNameKey, "test"),
testAccCheckGroupProjectScope("boundary_group.foo"),
),
},
{
// test update
Config: testConfig(url, fooProject, projGroupUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescriptionUpdate),
testAccCheckGroupProjectScope("boundary_group.foo"),
),
},
{
// test update to org scope
Config: testConfig(url, fooProject, projToOrgGroupUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckGroupResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_group.foo", groupDescriptionKey, fooGroupDescriptionUpdate),
resource.TestCheckResourceAttr("boundary_group.foo", groupScopeIDKey, tcOrg),
),
},
},
})
}
// testAccCheckGroupDestroyed checks the terraform state for the host
// catalog and returns an error if found.
//
// TODO(malnick) This method falls short of checking the Boundary API for
// the resource if the resource is not found in state. This is due to us not
// having the host catalog ID, but it doesn't guarantee that the resource was
// successfully removed.
//
// It does check Boundary if the resource is found in state to point out any
// misalignment between what is in state and the actual configuration.
func testAccCheckGroupDestroyed(name string) resource.TestCheckFunc {
func testAccCheckGroupProjectScope(name string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[name]
if !ok {
// If it's not in state, it's destroyed in TF but not guaranteed to be destroyed
// in Boundary. Need to find a way to get the host catalog ID here so we can
// form a lookup to the WT API to check this.
return nil
return fmt.Errorf("Not found: %s", name)
}
errs := []string{}
errs = append(errs, fmt.Sprintf("Found group resource in state: %s", name))
expectedGroupID := rs.Primary.ID
if expectedGroupID == "" {
id := rs.Primary.ID
if id == "" {
return fmt.Errorf("No ID is set")
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projClient := md.client.Clone()
stateProjID, ok := rs.Primary.Attributes["scope_id"]
if ok {
projClient.SetScopeId(projID)
projClient.SetScopeId(stateProjID)
}
grps := groups.NewGroupsClient(projClient)
if _, apiErr, _ := grps.Read(md.ctx, expectedGroupID); apiErr == nil || apiErr.Status != http.StatusNotFound {
errs = append(errs, fmt.Sprintf("Group not destroyed %q: %v", expectedGroupID, apiErr))
g, _, err := grps.Read(md.ctx, id)
if err != nil {
return fmt.Errorf("could not read resource state %q: %v", id, err)
}
return errors.New(strings.Join(errs, ","))
if g.Scope.Id != stateProjID {
return fmt.Errorf("project ID in state does not match boundary state: %s != %s", g.Scope.Id, stateProjID)
}
return nil
}
}
@@ -158,8 +179,8 @@ func testAccCheckGroupResourceExists(name string) resource.TestCheckFunc {
md := testProvider.Meta().(*metaData)
projClient := md.client.Clone()
projID, ok := rs.Primary.Attributes["project_id"]
if ok {
projID, ok := rs.Primary.Attributes["scope_id"]
if ok && projID != "" {
projClient.SetScopeId(projID)
}
grps := groups.NewGroupsClient(projClient)
@@ -174,6 +195,7 @@ func testAccCheckGroupResourceExists(name string) resource.TestCheckFunc {
func testAccCheckGroupResourceDestroy(t *testing.T) resource.TestCheckFunc {
return func(s *terraform.State) error {
fmt.Printf("test check group resource destroyed\n")
if testProvider.Meta() == nil {
t.Fatal("got nil provider metadata")
}
@@ -186,7 +208,7 @@ func testAccCheckGroupResourceDestroy(t *testing.T) resource.TestCheckFunc {
continue
case "boundary_group":
projClient := md.client.Clone()
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if ok {
projClient.SetScopeId(projID)
}
@@ -195,8 +217,8 @@ func testAccCheckGroupResourceDestroy(t *testing.T) resource.TestCheckFunc {
id := rs.Primary.ID
_, apiErr, _ := grps.Read(md.ctx, id)
if apiErr == nil || apiErr.Status != http.StatusNotFound {
return fmt.Errorf("Didn't get a 404 when reading destroyed group %q: %v", id, apiErr)
if apiErr == nil || apiErr.Status != http.StatusForbidden && apiErr.Status != http.StatusNotFound {
return fmt.Errorf("Didn't get a 403 or 404 when reading destroyed resource %q: %v", id, apiErr)
}
default:
+46 -39
View File
@@ -5,13 +5,14 @@ import (
"fmt"
"github.com/hashicorp/boundary/api/hosts"
"github.com/hashicorp/boundary/api/scopes"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
const (
hostCatalogNameKey = "name"
hostCatalogDescriptionKey = "description"
hostCatalogProjectIDKey = "project_id"
hostCatalogScopeIDKey = "scope_id"
hostCatalogTypeKey = "type"
hostCatalogTypeStatic = "Static"
)
@@ -31,15 +32,16 @@ func resourceHostCatalog() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
hostCatalogProjectIDKey: {
hostCatalogScopeIDKey: {
Type: schema.TypeString,
Optional: true,
Required: true,
ForceNew: true,
},
hostCatalogTypeKey: {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateHostCatalogType,
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
},
}
@@ -61,7 +63,7 @@ func validateHostCatalogType(val interface{}, key string) (warns []string, errs
}
// convertHostCatalogToResourceData creates a ResourceData type from a HostCatalog
func convertHostCatalogToResourceData(projectID string, h *hosts.HostCatalog, d *schema.ResourceData) error {
func convertHostCatalogToResourceData(h *hosts.HostCatalog, d *schema.ResourceData) error {
if h.Name != "" {
if err := d.Set(hostCatalogNameKey, h.Name); err != nil {
return err
@@ -80,8 +82,8 @@ func convertHostCatalogToResourceData(projectID string, h *hosts.HostCatalog, d
}
}
if projectID != "" {
if err := d.Set(hostCatalogProjectIDKey, projectID); err != nil {
if h.Scope.Id != "" {
if err := d.Set(hostCatalogScopeIDKey, h.Scope.Id); err != nil {
return err
}
}
@@ -92,27 +94,34 @@ func convertHostCatalogToResourceData(projectID string, h *hosts.HostCatalog, d
}
// convertResourceDataToHostCatalog returns a localy built HostCatalog using the values provided in the ResourceData.
func convertResourceDataToHostCatalog(d *schema.ResourceData) (string, *hosts.HostCatalog) {
h := &hosts.HostCatalog{}
func convertResourceDataToHostCatalog(d *schema.ResourceData) *hosts.HostCatalog {
h := &hosts.HostCatalog{Scope: &scopes.ScopeInfo{}}
if descVal, ok := d.GetOk(hostCatalogDescriptionKey); ok {
h.Description = descVal.(string)
}
if nameVal, ok := d.GetOk(hostCatalogNameKey); ok {
h.Name = nameVal.(string)
}
if typeVal, ok := d.GetOk(hostCatalogTypeKey); ok {
h.Type = typeVal.(string)
}
if d.Id() != "" {
h.Id = d.Id()
}
projID, ok := d.GetOk(hostCatalogProjectIDKey)
if !ok {
projID = ""
if scopeIDVal, ok := d.GetOk(hostCatalogScopeIDKey); ok {
// if scope_id is not set, don't override with an empty scope
if scopeIDVal.(string) != "" {
h.Scope.Id = scopeIDVal.(string)
fmt.Printf("[DEBUG] scope_id detected, reset client scope for %s to %s\n", h.Name, h.Scope.Id)
}
}
return projID.(string), h
return h
}
func resourceHostCatalogCreate(d *schema.ResourceData, meta interface{}) error {
@@ -120,12 +129,15 @@ func resourceHostCatalogCreate(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
projID, h := convertResourceDataToHostCatalog(d)
projClient := client.Clone()
projClient.SetScopeId(projID)
hcClient := hosts.NewHostCatalogsClient(projClient)
h := convertResourceDataToHostCatalog(d)
hcClient := hosts.NewHostCatalogsClient(client)
h, apiErr, err := hcClient.Create(ctx, hosts.WithName(h.Name), hosts.WithType(h.Type), hosts.WithDescription(h.Description))
h, apiErr, err := hcClient.Create(
ctx,
hosts.WithName(h.Name),
hosts.WithType(h.Type),
hosts.WithDescription(h.Description),
hosts.WithScopeId(h.Scope.Id))
if err != nil {
return fmt.Errorf("error calling new host catalog: %s", err.Error())
}
@@ -135,7 +147,7 @@ func resourceHostCatalogCreate(d *schema.ResourceData, meta interface{}) error {
d.SetId(h.Id)
return nil
return convertHostCatalogToResourceData(h, d)
}
func resourceHostCatalogRead(d *schema.ResourceData, meta interface{}) error {
@@ -143,12 +155,10 @@ func resourceHostCatalogRead(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
projID, h := convertResourceDataToHostCatalog(d)
projClient := client.Clone()
projClient.SetScopeId(projID)
hcClient := hosts.NewHostCatalogsClient(projClient)
h := convertResourceDataToHostCatalog(d)
hcClient := hosts.NewHostCatalogsClient(client)
h, apiErr, err := hcClient.Read(ctx, h.Id)
h, apiErr, err := hcClient.Read(ctx, h.Id, hosts.WithScopeId(h.Scope.Id))
if err != nil {
return fmt.Errorf("error calling new host catalog: %s", err.Error())
}
@@ -156,7 +166,7 @@ func resourceHostCatalogRead(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("error reading host catalog: %s", apiErr.Message)
}
return convertHostCatalogToResourceData(projID, h, d)
return convertHostCatalogToResourceData(h, d)
}
func resourceHostCatalogUpdate(d *schema.ResourceData, meta interface{}) error {
@@ -164,10 +174,8 @@ func resourceHostCatalogUpdate(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
projID, h := convertResourceDataToHostCatalog(d)
projClient := client.Clone()
projClient.SetScopeId(projID)
hcClient := hosts.NewHostCatalogsClient(projClient)
h := convertResourceDataToHostCatalog(d)
hcClient := hosts.NewHostCatalogsClient(client)
if d.HasChange(hostCatalogNameKey) {
h.Name = d.Get(hostCatalogNameKey).(string)
@@ -177,8 +185,8 @@ func resourceHostCatalogUpdate(d *schema.ResourceData, meta interface{}) error {
h.Description = d.Get(hostCatalogDescriptionKey).(string)
}
if d.HasChange(hostCatalogProjectIDKey) {
projClient.SetScopeId(d.Get(hostCatalogProjectIDKey).(string))
if d.HasChange(hostCatalogScopeIDKey) {
h.Scope.Id = d.Get(hostCatalogScopeIDKey).(string)
}
if d.HasChange(hostCatalogTypeKey) {
@@ -192,6 +200,7 @@ func resourceHostCatalogUpdate(d *schema.ResourceData, meta interface{}) error {
ctx,
h.Id,
0,
hosts.WithScopeId(h.Scope.Id),
hosts.WithAutomaticVersioning(),
hosts.WithName(h.Name),
hosts.WithDescription(h.Description))
@@ -202,7 +211,7 @@ func resourceHostCatalogUpdate(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("error updating host catalog: %s\n Invalid request fields: %v\n", apiErr.Message, apiErr.Details.RequestFields)
}
return convertHostCatalogToResourceData(projID, h, d)
return convertHostCatalogToResourceData(h, d)
}
func resourceHostCatalogDelete(d *schema.ResourceData, meta interface{}) error {
@@ -210,12 +219,10 @@ func resourceHostCatalogDelete(d *schema.ResourceData, meta interface{}) error {
client := md.client
ctx := md.ctx
projID, h := convertResourceDataToHostCatalog(d)
projClient := client.Clone()
projClient.SetScopeId(projID)
hcClient := hosts.NewHostCatalogsClient(projClient)
h := convertResourceDataToHostCatalog(d)
hcClient := hosts.NewHostCatalogsClient(client)
_, apiErr, err := hcClient.Delete(ctx, h.Id)
_, apiErr, err := hcClient.Delete(ctx, h.Id, hosts.WithScopeId(h.Scope.Id))
if err != nil {
return fmt.Errorf("error calling new host catalog: %s", err.Error())
}
+13 -13
View File
@@ -20,23 +20,23 @@ const (
)
var (
fooHostCatalog = fmt.Sprintf(`
orgHostCatalog = fmt.Sprintf(`
resource "boundary_host_catalog" "foo" {
description = "%s"
project_id = boundary_project.project1.id
scope_id = boundary_project.project1.id
type = "Static"
}`, fooHostCatalogDescription)
fooHostCatalogUpdate = fmt.Sprintf(`
orgHostCatalogUpdate = fmt.Sprintf(`
resource "boundary_host_catalog" "foo" {
description = "%s"
project_id = boundary_project.project1.id
scope_id = boundary_project.project1.id
type = "Static"
}`, fooHostCatalogDescriptionUpdate)
)
func TestAccHostCatalogCreate(t *testing.T) {
tc := controller.NewTestController(t, controller.WithDefaultOrgId("o_0000000000"))
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
@@ -46,7 +46,7 @@ func TestAccHostCatalogCreate(t *testing.T) {
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, firstProjectBar, fooHostCatalog),
Config: testConfig(url, firstProjectBar, orgHostCatalog),
Check: resource.ComposeTestCheckFunc(
testAccCheckProjectResourceExists("boundary_project.project1"),
testAccCheckHostCatalogResourceExists("boundary_host_catalog.foo"),
@@ -55,7 +55,7 @@ func TestAccHostCatalogCreate(t *testing.T) {
},
{
// test update
Config: testConfig(url, firstProjectBar, fooHostCatalogUpdate),
Config: testConfig(url, firstProjectBar, orgHostCatalogUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckHostCatalogResourceExists("boundary_host_catalog.foo"),
resource.TestCheckResourceAttr("boundary_host_catalog.foo", hostCatalogDescriptionKey, fooHostCatalogDescriptionUpdate),
@@ -101,9 +101,9 @@ func testAccCheckHostCatalogDestroyed(name string) resource.TestCheckFunc {
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -130,9 +130,9 @@ func testAccCheckHostCatalogResourceExists(name string) resource.TestCheckFunc {
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -157,9 +157,9 @@ func testAccCheckHostCatalogResourceDestroy(t *testing.T) resource.TestCheckFunc
case "boundary_host_catalog":
id := rs.Primary.ID
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
+3 -3
View File
@@ -14,7 +14,7 @@ import (
)
func TestAccProjectCreation(t *testing.T) {
tc := controller.NewTestController(t, controller.WithDefaultOrgId("o_0000000000"))
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
@@ -86,8 +86,8 @@ func testAccCheckProjectResourceDestroy(t *testing.T) resource.TestCheckFunc {
id := rs.Primary.ID
switch rs.Type {
case "boundary_project":
if _, apiErr, _ := scp.Read(md.ctx, id); apiErr == nil || apiErr.Status != http.StatusNotFound {
return fmt.Errorf("Didn't get a 404 when reading destroyed project %q: %v", id, apiErr)
if _, apiErr, _ := scp.Read(md.ctx, id); apiErr == nil || apiErr.Status != http.StatusNotFound && apiErr.Status != http.StatusForbidden {
return fmt.Errorf("Didn't get a 404 or 403 when reading destroyed project %q: %v", id, apiErr)
}
default:
t.Logf("Got unknown resource type %q", rs.Type)
+39 -40
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/hashicorp/boundary/api/roles"
"github.com/hashicorp/boundary/api/scopes"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
@@ -12,7 +13,7 @@ const (
roleDescriptionKey = "description"
rolePrincipalsKey = "principals"
roleGrantsKey = "grants"
roleProjectIDKey = "project_id"
roleScopeIDKey = "scope_id"
)
func resourceRole() *schema.Resource {
@@ -40,9 +41,11 @@ func resourceRole() *schema.Resource {
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
roleProjectIDKey: {
roleScopeIDKey: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
},
}
@@ -69,13 +72,17 @@ func convertRoleToResourceData(r *roles.Role, d *schema.ResourceData) error {
}
if r.Grants != nil {
if err := d.Set(roleGrantsKey, r.Grants); err != nil {
grants := []string{}
for _, grant := range r.Grants {
grants = append(grants, grant.Raw)
}
if err := d.Set(roleGrantsKey, grants); err != nil {
return err
}
}
if r.Scope.Id != "" {
if err := d.Set(roleProjectIDKey, r.Scope.Id); err != nil {
if err := d.Set(roleScopeIDKey, r.Scope.Id); err != nil {
return err
}
}
@@ -87,22 +94,27 @@ func convertRoleToResourceData(r *roles.Role, d *schema.ResourceData) error {
// convertResourceDataToRole returns a localy built Role using the values provided in the ResourceData.
func convertResourceDataToRole(d *schema.ResourceData) *roles.Role {
r := &roles.Role{}
if projIDVal, ok := d.GetOk(roleProjectIDKey); ok {
r := &roles.Role{Scope: &scopes.ScopeInfo{}}
if projIDVal, ok := d.GetOk(roleScopeIDKey); ok {
r.Scope.Id = projIDVal.(string)
}
if descVal, ok := d.GetOk(roleDescriptionKey); ok {
r.Description = descVal.(string)
}
if nameVal, ok := d.GetOk(roleNameKey); ok {
r.Name = nameVal.(string)
}
if val, ok := d.GetOk(rolePrincipalsKey); ok {
principalIds := val.(*schema.Set).List()
for _, i := range principalIds {
r.PrincipalIds = append(r.PrincipalIds, i.(string))
}
}
if val, ok := d.GetOk(roleGrantsKey); ok {
grants := val.(*schema.Set).List()
for _, i := range grants {
@@ -124,12 +136,7 @@ func resourceRoleCreate(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
r := convertResourceDataToRole(d)
projClient := client.Clone()
if r.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", r.Name, r.Scope.Id)
projClient.SetScopeId(r.Scope.Id)
}
rolesClient := roles.NewRolesClient(projClient)
rolesClient := roles.NewRolesClient(client)
principals := r.PrincipalIds
grants := []string{}
@@ -140,7 +147,8 @@ func resourceRoleCreate(d *schema.ResourceData, meta interface{}) error {
r, apiErr, err := rolesClient.Create(
ctx,
roles.WithName(r.Name),
roles.WithDescription(r.Description))
roles.WithDescription(r.Description),
roles.WithScopeId(r.Scope.Id))
if apiErr != nil {
return fmt.Errorf("error creating role: %s\n", apiErr.Message)
}
@@ -156,7 +164,8 @@ func resourceRoleCreate(d *schema.ResourceData, meta interface{}) error {
ctx,
r.Id,
r.Version,
grants)
grants,
roles.WithScopeId(r.Scope.Id))
if apiErr != nil {
return fmt.Errorf("error setting grants on role:: %s\n", apiErr.Message)
}
@@ -170,7 +179,8 @@ func resourceRoleCreate(d *schema.ResourceData, meta interface{}) error {
ctx,
r.Id,
r.Version,
principals)
principals,
roles.WithScopeId(r.Scope.Id))
if apiErr != nil {
return fmt.Errorf("error setting principals on role: %s\n", apiErr.Message)
}
@@ -181,7 +191,7 @@ func resourceRoleCreate(d *schema.ResourceData, meta interface{}) error {
d.SetId(r.Id)
return nil
return convertRoleToResourceData(r, d)
}
func resourceRoleRead(d *schema.ResourceData, meta interface{}) error {
@@ -190,14 +200,9 @@ func resourceRoleRead(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
r := convertResourceDataToRole(d)
projClient := client.Clone()
if r.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", r.Name, r.Scope.Id)
projClient.SetScopeId(r.Scope.Id)
}
rolesClient := roles.NewRolesClient(projClient)
rolesClient := roles.NewRolesClient(client)
r, apiErr, err := rolesClient.Read(ctx, r.Id)
r, apiErr, err := rolesClient.Read(ctx, r.Id, roles.WithScopeId(r.Scope.Id))
if err != nil {
return fmt.Errorf("error reading role: %s", err.Error())
}
@@ -214,12 +219,7 @@ func resourceRoleUpdate(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
r := convertResourceDataToRole(d)
projClient := client.Clone()
if r.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", r.Name, r.Scope.Id)
projClient.SetScopeId(r.Scope.Id)
}
rolesClient := roles.NewRolesClient(projClient)
rolesClient := roles.NewRolesClient(client)
if d.HasChange(roleNameKey) {
r.Name = d.Get(roleNameKey).(string)
@@ -235,7 +235,8 @@ func resourceRoleUpdate(d *schema.ResourceData, meta interface{}) error {
0,
roles.WithAutomaticVersioning(),
roles.WithName(r.Name),
roles.WithDescription(r.Description))
roles.WithDescription(r.Description),
roles.WithScopeId(r.Scope.Id))
if apiErr != nil || err != nil {
return fmt.Errorf("error updating role:\n API Err: %+v\n Err: %+v\n", *apiErr, err)
}
@@ -243,15 +244,17 @@ func resourceRoleUpdate(d *schema.ResourceData, meta interface{}) error {
if d.HasChange(roleGrantsKey) {
grants := []string{}
grantSet := d.Get(roleGrantsKey).(*schema.Set).List()
for _, grant := range grantSet {
grants = append(grants, grant.(string))
}
_, apiErr, err := rolesClient.SetGrants(
r, apiErr, err = rolesClient.SetGrants(
ctx,
r.Id,
r.Version,
grants)
grants,
roles.WithScopeId(r.Scope.Id))
if apiErr != nil || err != nil {
return fmt.Errorf("error setting grants on role:\n API Err: %+v\n Err: %+v\n", *apiErr, err)
}
@@ -268,7 +271,8 @@ func resourceRoleUpdate(d *schema.ResourceData, meta interface{}) error {
ctx,
r.Id,
r.Version,
principalIds)
principalIds,
roles.WithScopeId(r.Scope.Id))
if apiErr != nil || err != nil {
return fmt.Errorf("error updating principal on role:\n API Err: %+v\n Err: %+v\n", *apiErr, err)
}
@@ -283,14 +287,9 @@ func resourceRoleDelete(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
r := convertResourceDataToRole(d)
projClient := client.Clone()
if r.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", r.Name, r.Scope.Id)
projClient.SetScopeId(r.Scope.Id)
}
rolesClient := roles.NewRolesClient(projClient)
rolesClient := roles.NewRolesClient(client)
_, apiErr, err := rolesClient.Delete(ctx, r.Id)
_, apiErr, err := rolesClient.Delete(ctx, r.Id, roles.WithScopeId(r.Scope.Id))
if apiErr != nil || err != nil {
return fmt.Errorf("error deleting role:\n API Err: %+v\n Err: %+v\n", *apiErr, err)
}
+179 -148
View File
@@ -19,104 +19,120 @@ const (
)
var (
fooRole = fmt.Sprintf(`
orgRole = fmt.Sprintf(`
resource "boundary_role" "foo" {
name = "test"
name = "test"
description = "%s"
project_id = boundary_project.foo.id
}`, fooRoleDescription)
fooRoleUpdate = fmt.Sprintf(`
orgRoleUpdate = fmt.Sprintf(`
resource "boundary_role" "foo" {
name = "test"
name = "test"
description = "%s"
project_id = boundary_project.foo.id
}`, fooRoleDescriptionUpdate)
fooRoleWithUser = `
ProjToOrgRole = fmt.Sprintf(`
resource "boundary_role" "foo" {
name = "test"
description = "%s"
scope_id = "%s"
}`, fooRoleDescription, tcOrg)
projRole = fmt.Sprintf(`
resource "boundary_role" "foo" {
name = "test"
description = "%s"
scope_id = boundary_project.foo.id
}`, fooRoleDescription)
projRoleUpdate = fmt.Sprintf(`
resource "boundary_role" "foo" {
name = "test"
description = "%s"
scope_id = boundary_project.foo.id
}`, fooRoleDescriptionUpdate)
projRoleWithPrincipal = `
resource "boundary_user" "foo" {
name = "foo"
project_id = boundary_project.foo.id
name = "foo"
}
resource "boundary_role" "foo" {
name = "test"
description = "test description"
users = [boundary_user.foo.id]
project_id = boundary_project.foo.id
resource "boundary_role" "with_principal" {
name = "with_principal"
description = "with principal"
principals = [boundary_user.foo.id]
scope_id = boundary_project.foo.id
}`
fooRoleWithUserUpdate = `
projRoleWithPrincipalUpdate = `
resource "boundary_user" "foo" {
name = "foo"
project_id = boundary_project.foo.id
name = "foo"
}
resource "boundary_user" "bar" {
name = "bar"
project_id = boundary_project.foo.id
name = "bar"
}
resource "boundary_role" "foo" {
name = "test"
description = "test description"
users = [boundary_user.foo.id, boundary_user.bar.id]
project_id = boundary_project.foo.id
resource "boundary_role" "with_principal" {
name = "with_principal"
description = "with principal"
principals = [boundary_user.foo.id, boundary_user.bar.id]
scope_id = boundary_project.foo.id
}`
fooRoleWithGroups = `
projRoleWithGroups = `
resource "boundary_group" "foo" {
name = "foo"
project_id = boundary_project.foo.id
name = "foo"
scope_id = boundary_project.foo.id
}
resource "boundary_role" "foo" {
name = "test"
description = "test description"
groups = [boundary_group.foo.id]
project_id = boundary_project.foo.id
resource "boundary_role" "with_groups" {
name = "with_groups"
description = "with groups"
principals = [boundary_group.foo.id]
scope_id = boundary_project.foo.id
}`
fooRoleWithGroupsUpdate = `
projRoleWithGroupsUpdate = `
resource "boundary_group" "foo" {
name = "foo"
project_id = boundary_project.foo.id
name = "foo"
scope_id = boundary_project.foo.id
}
resource "boundary_group" "bar" {
name = "bar"
project_id = boundary_project.foo.id
name = "bar"
scope_id = boundary_project.foo.id
}
resource "boundary_role" "foo" {
name = "test"
description = "test description"
groups = [boundary_group.foo.id, boundary_group.bar.id]
project_id = boundary_project.foo.id
resource "boundary_role" "with_groups" {
name = "with_groups"
description = "with groups"
principals = [boundary_group.foo.id, boundary_group.bar.id]
scope_id = boundary_project.foo.id
}`
readonlyGrant = "id=*;actions=read"
readonlyGrantUpdate = "id=*;actions=read,create"
fooRoleWithGrants = fmt.Sprintf(`
resource "boundary_role" "foo" {
name = "readonly"
description = "test description"
grants = ["%s"]
project_id = boundary_project.foo.id
projRoleWithGrants = fmt.Sprintf(`
resource "boundary_role" "with_grants" {
name = "with_grants"
description = "with grants"
grants = ["%s"]
scope_id = boundary_project.foo.id
}`, readonlyGrant)
fooRoleWithGrantsUpdate = fmt.Sprintf(`
resource "boundary_role" "foo" {
name = "readonly"
description = "test description"
grants = ["%s", "%s"]
project_id = boundary_project.foo.id
projRoleWithGrantsUpdate = fmt.Sprintf(`
resource "boundary_role" "with_grants" {
name = "with_grants"
description = "with grants"
grants = ["%s", "%s"]
scope_id = boundary_project.foo.id
}`, readonlyGrant, readonlyGrantUpdate)
)
func TestAccRoleWithGrants(t *testing.T) {
tc := controller.NewTestController(t, controller.WithDefaultOrgId("o_0000000000"))
func TestAccRoleToOrgToProject(t *testing.T) {
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
@@ -125,31 +141,81 @@ func TestAccRoleWithGrants(t *testing.T) {
CheckDestroy: testAccCheckRoleResourceDestroy(t),
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, fooProject, fooRoleWithGrants),
// test org role create
Config: testConfig(url, orgRole),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
testAccCheckRoleResourceGrantsSet("boundary_role.foo", []string{readonlyGrant}),
resource.TestCheckResourceAttr("boundary_role.foo", "name", "readonly"),
resource.TestCheckResourceAttr("boundary_role.foo", "description", "test description"),
resource.TestCheckResourceAttr("boundary_role.foo", "name", "test"),
resource.TestCheckResourceAttr("boundary_role.foo", "description", fooRoleDescription),
),
},
{
// test update
Config: testConfig(url, fooProject, fooRoleWithGrantsUpdate),
// test org role update
Config: testConfig(url, orgRoleUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
testAccCheckRoleResourceGrantsSet("boundary_role.foo", []string{readonlyGrant, readonlyGrantUpdate}),
resource.TestCheckResourceAttr("boundary_role.foo", "name", "readonly"),
resource.TestCheckResourceAttr("boundary_role.foo", "description", "test description"),
resource.TestCheckResourceAttr("boundary_role.foo", "name", "test"),
resource.TestCheckResourceAttr("boundary_role.foo", "description", fooRoleDescriptionUpdate),
),
},
{
// test org to project role create
Config: testConfig(url, fooProject, projRole),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
resource.TestCheckResourceAttr("boundary_role.foo", "name", "test"),
resource.TestCheckResourceAttr("boundary_role.foo", "description", fooRoleDescription),
),
},
{
// test project role update
Config: testConfig(url, fooProject, projRoleUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
resource.TestCheckResourceAttr("boundary_role.foo", "name", "test"),
resource.TestCheckResourceAttr("boundary_role.foo", "description", fooRoleDescriptionUpdate),
),
},
},
})
}
func TestAccRoleWithUsers(t *testing.T) {
tc := controller.NewTestController(t, controller.WithDefaultOrgId("o_0000000000"))
func TestAccRoleWithGrants(t *testing.T) {
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
resource.Test(t, resource.TestCase{
Providers: testProviders,
CheckDestroy: testAccCheckRoleResourceDestroy(t),
Steps: []resource.TestStep{
{
// test project role create with grants
Config: testConfig(url, fooProject, projRoleWithGrants),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.with_grants"),
testAccCheckRoleResourceGrantsSet("boundary_role.with_grants", []string{readonlyGrant}),
resource.TestCheckResourceAttr("boundary_role.with_grants", "name", "with_grants"),
resource.TestCheckResourceAttr("boundary_role.with_grants", "description", "with grants"),
),
},
{
// test project role update with grants
Config: testConfig(url, fooProject, projRoleWithGrantsUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.with_grants"),
testAccCheckRoleResourceGrantsSet("boundary_role.with_grants", []string{readonlyGrant, readonlyGrantUpdate}),
resource.TestCheckResourceAttr("boundary_role.with_grants", "name", "with_grants"),
resource.TestCheckResourceAttr("boundary_role.with_grants", "description", "with grants"),
),
},
},
})
}
func TestAccRoleWithPrincipals(t *testing.T) {
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
@@ -159,24 +225,24 @@ func TestAccRoleWithUsers(t *testing.T) {
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, fooProject, fooRoleWithUser),
Config: testConfig(url, fooProject, projRoleWithPrincipal),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
testAccCheckRoleResourceUsersSet("boundary_role.foo", []string{"boundary_user.foo"}),
testAccCheckRoleResourceExists("boundary_role.with_principal"),
testAccCheckRoleResourcePrincipalsSet("boundary_role.with_principal", []string{"boundary_user.foo"}),
testAccCheckUserResourceExists("boundary_user.foo"),
resource.TestCheckResourceAttr("boundary_role.foo", roleDescriptionKey, "test description"),
resource.TestCheckResourceAttr("boundary_role.foo", roleNameKey, "test"),
resource.TestCheckResourceAttr("boundary_role.with_principal", roleDescriptionKey, "with principal"),
resource.TestCheckResourceAttr("boundary_role.with_principal", roleNameKey, "with_principal"),
resource.TestCheckResourceAttr("boundary_user.foo", "name", "foo"),
),
},
{
// test update
Config: testConfig(url, fooProject, fooRoleWithUserUpdate),
Config: testConfig(url, fooProject, projRoleWithPrincipalUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
testAccCheckRoleResourceExists("boundary_role.with_principal"),
testAccCheckUserResourceExists("boundary_user.foo"),
testAccCheckUserResourceExists("boundary_user.bar"),
testAccCheckRoleResourceUsersSet("boundary_role.foo", []string{"boundary_user.foo", "boundary_user.bar"}),
testAccCheckRoleResourcePrincipalsSet("boundary_role.with_principal", []string{"boundary_user.foo", "boundary_user.bar"}),
),
},
},
@@ -184,7 +250,7 @@ func TestAccRoleWithUsers(t *testing.T) {
}
func TestAccRoleWithGroups(t *testing.T) {
tc := controller.NewTestController(t, controller.WithDefaultOrgId("o_0000000000"))
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
@@ -194,61 +260,24 @@ func TestAccRoleWithGroups(t *testing.T) {
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, fooProject, fooRoleWithGroups),
Config: testConfig(url, fooProject, projRoleWithGroups),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
testAccCheckRoleResourceGroupsSet("boundary_role.foo", []string{"boundary_group.foo"}),
testAccCheckRoleResourceExists("boundary_role.with_groups"),
testAccCheckRoleResourceGroupsSet("boundary_role.with_groups", []string{"boundary_group.foo"}),
testAccCheckUserResourceExists("boundary_group.foo"),
resource.TestCheckResourceAttr("boundary_role.foo", roleDescriptionKey, "test description"),
resource.TestCheckResourceAttr("boundary_role.foo", roleNameKey, "test"),
resource.TestCheckResourceAttr("boundary_role.with_groups", roleDescriptionKey, "with groups"),
resource.TestCheckResourceAttr("boundary_role.with_groups", roleNameKey, "with_groups"),
resource.TestCheckResourceAttr("boundary_group.foo", "name", "foo"),
),
},
{
// test update
Config: testConfig(url, fooProject, fooRoleWithGroupsUpdate),
Config: testConfig(url, fooProject, projRoleWithGroupsUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
testAccCheckRoleResourceExists("boundary_role.with_groups"),
testAccCheckUserResourceExists("boundary_group.foo"),
testAccCheckUserResourceExists("boundary_group.bar"),
testAccCheckRoleResourceGroupsSet("boundary_role.foo", []string{"boundary_group.foo", "boundary_group.bar"}),
),
},
},
})
}
func TestAccRole(t *testing.T) {
tc := controller.NewTestController(t, controller.WithDefaultOrgId("o_0000000000"))
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
resource.Test(t, resource.TestCase{
Providers: testProviders,
CheckDestroy: testAccCheckRoleResourceDestroy(t),
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, fooProject, fooRole),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
resource.TestCheckResourceAttr("boundary_role.foo", roleDescriptionKey, fooRoleDescription),
resource.TestCheckResourceAttr("boundary_role.foo", roleNameKey, "test"),
),
},
{
// test update
Config: testConfig(url, fooProject, fooRoleUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleResourceExists("boundary_role.foo"),
resource.TestCheckResourceAttr("boundary_role.foo", roleDescriptionKey, fooRoleDescriptionUpdate),
),
},
{
// test destroy
Config: testConfig(url),
Check: resource.ComposeTestCheckFunc(
testAccCheckRoleDestroyed("boundary_role.foo"),
testAccCheckRoleResourceGroupsSet("boundary_role.with_groups", []string{"boundary_group.foo", "boundary_group.bar"}),
),
},
},
@@ -283,9 +312,9 @@ func testAccCheckRoleDestroyed(name string) resource.TestCheckFunc {
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -312,9 +341,9 @@ func testAccCheckRoleResourceExists(name string) resource.TestCheckFunc {
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -328,7 +357,7 @@ func testAccCheckRoleResourceExists(name string) resource.TestCheckFunc {
}
}
func testAccCheckRoleResourceUsersSet(name string, users []string) resource.TestCheckFunc {
func testAccCheckRoleResourcePrincipalsSet(name string, principals []string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[name]
if !ok {
@@ -341,7 +370,7 @@ func testAccCheckRoleResourceUsersSet(name string, users []string) resource.Test
}
userIDs := []string{}
for _, userResourceName := range users {
for _, userResourceName := range principals {
ur, ok := s.RootModule().Resources[userResourceName]
if !ok {
return fmt.Errorf("user resource not found: %s", userResourceName)
@@ -349,16 +378,16 @@ func testAccCheckRoleResourceUsersSet(name string, users []string) resource.Test
userID := ur.Primary.ID
if id == "" {
return fmt.Errorf("user resource ID not set")
return fmt.Errorf("principal resource ID not set")
}
userIDs = append(userIDs, userID)
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -369,21 +398,21 @@ func testAccCheckRoleResourceUsersSet(name string, users []string) resource.Test
return fmt.Errorf("Got an error when reading role %q: %v", id, err)
}
// for every user set as a principal on the role in the state, ensure
// for every principal set as a principal on the role in the state, ensure
// each role in boundary has the same setings
if len(r.PrincipalIds) == 0 {
return fmt.Errorf("no users found in boundary")
return fmt.Errorf("no principals found in boundary")
}
for _, stateUser := range r.PrincipalIds {
for _, statePrincipal := range r.PrincipalIds {
ok := false
for _, gotUser := range userIDs {
if gotUser == stateUser {
for _, gotPrincipal := range userIDs {
if gotPrincipal == statePrincipal {
ok = true
}
}
if !ok {
return fmt.Errorf("user in state not set in boundary: %s", stateUser)
return fmt.Errorf("principal in state not set in boundary: %s", statePrincipal)
}
}
@@ -419,9 +448,9 @@ func testAccCheckRoleResourceGroupsSet(name string, groups []string) resource.Te
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -432,7 +461,7 @@ func testAccCheckRoleResourceGroupsSet(name string, groups []string) resource.Te
return fmt.Errorf("Got an error when reading role %q: %v", id, err)
}
// for every user set as a principal on the role in the state, ensure
// for every principal set as a principal on the role in the state, ensure
// each role in boundary has the same setings
if len(r.PrincipalIds) == 0 {
return fmt.Errorf("no groups found in boundary")
@@ -467,9 +496,9 @@ func testAccCheckRoleResourceGrantsSet(name string, expectedGrants []string) res
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -493,7 +522,7 @@ func testAccCheckRoleResourceGrantsSet(name string, expectedGrants []string) res
}
}
if !ok {
return fmt.Errorf("expected grant not found on role, %s: %s\n Have: %v\n", r.Name, grant, r)
return fmt.Errorf("expected grant not found on role, %s: %s\n Have: %#v\n", r.Name, grant, r)
}
}
@@ -510,6 +539,8 @@ func testAccCheckRoleResourceDestroy(t *testing.T) resource.TestCheckFunc {
for _, rs := range s.RootModule().Resources {
switch rs.Type {
case "boundary_project":
continue
case "boundary_user":
continue
case "boundary_group":
@@ -517,21 +548,21 @@ func testAccCheckRoleResourceDestroy(t *testing.T) resource.TestCheckFunc {
case "boundary_role":
id := rs.Primary.ID
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
rolesClient := roles.NewRolesClient(projClient)
_, apiErr, _ := rolesClient.Read(md.ctx, id)
if apiErr == nil || apiErr.Status != http.StatusNotFound {
return fmt.Errorf("Didn't get a 404 when reading destroyed role %q: %v", id, apiErr)
if apiErr == nil || apiErr.Status != http.StatusNotFound && apiErr.Status != http.StatusForbidden {
return fmt.Errorf("Didn't get a 404 or 403 when reading destroyed role %q: %v", id, apiErr)
}
default:
t.Logf("Got unknown resource type %q", rs.Type)
continue
}
}
return nil
+25 -35
View File
@@ -3,6 +3,7 @@ package provider
import (
"fmt"
"github.com/hashicorp/boundary/api/scopes"
"github.com/hashicorp/boundary/api/users"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
@@ -10,7 +11,7 @@ import (
const (
userNameKey = "name"
userDescriptionKey = "description"
userProjectIDKey = "project_id"
userScopeIDKey = "scope_id"
)
func resourceUser() *schema.Resource {
@@ -28,9 +29,11 @@ func resourceUser() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
userProjectIDKey: {
userScopeIDKey: {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
},
},
}
@@ -51,7 +54,7 @@ func convertUserToResourceData(u *users.User, d *schema.ResourceData) error {
}
if u.Scope.Id != "" {
if err := d.Set(userProjectIDKey, u.Scope.Id); err != nil {
if err := d.Set(userScopeIDKey, u.Scope.Id); err != nil {
return err
}
}
@@ -63,15 +66,18 @@ func convertUserToResourceData(u *users.User, d *schema.ResourceData) error {
// convertResourceDataToUser returns a localy built User using the values provided in the ResourceData.
func convertResourceDataToUser(d *schema.ResourceData) *users.User {
u := &users.User{}
u := &users.User{Scope: &scopes.ScopeInfo{}}
if descVal, ok := d.GetOk(userDescriptionKey); ok {
u.Description = descVal.(string)
}
if nameVal, ok := d.GetOk(userNameKey); ok {
u.Name = nameVal.(string)
}
if projIDVal, ok := d.GetOk(userProjectIDKey); ok {
u.Scope.Id = projIDVal.(string)
if scopeIDVal, ok := d.GetOk(userScopeIDKey); ok {
u.Scope.Id = scopeIDVal.(string)
}
if d.Id() != "" {
@@ -87,17 +93,13 @@ func resourceUserCreate(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
u := convertResourceDataToUser(d)
projClient := client.Clone()
if u.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", u.Name, u.Scope.Id)
projClient.SetScopeId(u.Scope.Id)
}
usrs := users.NewUsersClient(projClient)
usrs := users.NewUsersClient(client)
u, apiErr, err := usrs.Create(
ctx,
users.WithName(u.Name),
users.WithDescription(u.Description))
users.WithDescription(u.Description),
users.WithScopeId(u.Scope.Id))
if err != nil {
return fmt.Errorf("error calling new user: %s", err.Error())
}
@@ -107,7 +109,7 @@ func resourceUserCreate(d *schema.ResourceData, meta interface{}) error {
d.SetId(u.Id)
return nil
return convertUserToResourceData(u, d)
}
func resourceUserRead(d *schema.ResourceData, meta interface{}) error {
@@ -116,14 +118,9 @@ func resourceUserRead(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
u := convertResourceDataToUser(d)
projClient := client.Clone()
if u.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", u.Name, u.Scope.Id)
projClient.SetScopeId(u.Scope.Id)
}
usrs := users.NewUsersClient(projClient)
usrs := users.NewUsersClient(client)
u, apiErr, err := usrs.Read(ctx, u.Id)
u, apiErr, err := usrs.Read(ctx, u.Id, users.WithScopeId(u.Scope.Id))
if err != nil {
return fmt.Errorf("error reading user: %s", err.Error())
}
@@ -140,12 +137,7 @@ func resourceUserUpdate(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
u := convertResourceDataToUser(d)
projClient := client.Clone()
if u.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", u.Name, u.Scope.Id)
projClient.SetScopeId(u.Scope.Id)
}
usrs := users.NewUsersClient(projClient)
usrs := users.NewUsersClient(client)
if d.HasChange(userNameKey) {
u.Name = d.Get(userNameKey).(string)
@@ -155,13 +147,16 @@ func resourceUserUpdate(d *schema.ResourceData, meta interface{}) error {
u.Description = d.Get(userDescriptionKey).(string)
}
u.Scope.Id = d.Get(userScopeIDKey).(string)
u, apiErr, err := usrs.Update(
ctx,
u.Id,
0,
users.WithAutomaticVersioning(),
users.WithName(u.Name),
users.WithDescription(u.Description))
users.WithDescription(u.Description),
users.WithScopeId(u.Scope.Id))
if err != nil {
return err
}
@@ -178,14 +173,9 @@ func resourceUserDelete(d *schema.ResourceData, meta interface{}) error {
ctx := md.ctx
u := convertResourceDataToUser(d)
projClient := client.Clone()
if u.Scope.Id != "" {
fmt.Printf("[DEBUG] project_id detected, resetting client scope for %s to %s\n", u.Name, u.Scope.Id)
projClient.SetScopeId(u.Scope.Id)
}
usrs := users.NewUsersClient(projClient)
usrs := users.NewUsersClient(client)
_, apiErr, err := usrs.Delete(ctx, u.Id)
_, apiErr, err := usrs.Delete(ctx, u.Id, users.WithScopeId(u.Scope.Id))
if err != nil {
return fmt.Errorf("error deleting user: %s", err.Error())
}
+13 -80
View File
@@ -1,10 +1,8 @@
package provider
import (
"errors"
"fmt"
"net/http"
"strings"
"testing"
"github.com/hashicorp/boundary/api/users"
@@ -20,29 +18,21 @@ const (
)
var (
fooUser = fmt.Sprintf(`
orgUser = fmt.Sprintf(`
resource "boundary_user" "foo" {
name = "test"
description = "%s"
project_id = boundary_project.foo.id
}`, fooUserDescription)
fooUserUpdate = fmt.Sprintf(`
orgUserUpdate = fmt.Sprintf(`
resource "boundary_user" "foo" {
name = "test"
description = "%s"
project_id = boundary_project.foo.id
}`, fooUserDescriptionUpdate)
fooUserUnset = fmt.Sprintf(`
resource "boundary_user" "foo" {
name = "test"
description = "%s"
project_id = boundary_project.foo.id
}`, fooUserDescriptionUnset)
)
func TestAccUser(t *testing.T) {
tc := controller.NewTestController(t, controller.WithDefaultOrgId("o_0000000000"))
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
@@ -52,85 +42,28 @@ func TestAccUser(t *testing.T) {
Steps: []resource.TestStep{
{
// test create
Config: testConfig(url, fooProject, fooUser),
Config: testConfig(url, orgUser),
Check: resource.ComposeTestCheckFunc(
testAccCheckUserResourceExists("boundary_user.foo"),
resource.TestCheckResourceAttr("boundary_user.foo", userDescriptionKey, fooUserDescription),
resource.TestCheckResourceAttr("boundary_user.foo", userNameKey, "test"),
resource.TestCheckResourceAttr("boundary_user.foo", userScopeIDKey, tcOrg),
),
},
{
// test update
Config: testConfig(url, fooProject, fooUserUnset),
Check: resource.ComposeTestCheckFunc(
testAccCheckUserResourceExists("boundary_user.foo"),
resource.TestCheckResourceAttr("boundary_user.foo", userDescriptionKey, fooUserDescriptionUnset),
),
},
{
// test unset
Config: testConfig(url, fooProject, fooUserUpdate),
// test update description
Config: testConfig(url, orgUserUpdate),
Check: resource.ComposeTestCheckFunc(
testAccCheckUserResourceExists("boundary_user.foo"),
resource.TestCheckResourceAttr("boundary_user.foo", userDescriptionKey, fooUserDescriptionUpdate),
),
},
{
// test destroy
Config: testConfig(url),
Check: resource.ComposeTestCheckFunc(
testAccCheckUserDestroyed("boundary_user.foo"),
resource.TestCheckResourceAttr("boundary_user.foo", userNameKey, "test"),
resource.TestCheckResourceAttr("boundary_user.foo", userScopeIDKey, tcOrg),
),
},
},
})
}
// testAccCheckUserDestroyed checks the terraform state for the host
// catalog and returns an error if found.
//
// TODO(malnick) This method falls short of checking the Boundary API for
// the resource if the resource is not found in state. This is due to us not
// having the host catalog ID, but it doesn't guarantee that the resource was
// successfully removed.
//
// It does check Boundary if the resource is found in state to point out any
// misalignment between what is in state and the actual configuration.
func testAccCheckUserDestroyed(name string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[name]
if !ok {
// If it's not in state, it's destroyed in TF but not guaranteed to be destroyed
// in Boundary. Need to find a way to get the host catalog ID here so we can
// form a lookup to the WT API to check this.
return nil
}
errs := []string{}
errs = append(errs, fmt.Sprintf("Found user resource in state: %s", name))
id := rs.Primary.ID
if id == "" {
return fmt.Errorf("No ID is set")
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
if !ok {
return fmt.Errorf("project_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
usrs := users.NewUsersClient(projClient)
if _, apiErr, _ := usrs.Read(md.ctx, id); apiErr == nil || apiErr.Status != http.StatusNotFound {
errs = append(errs, fmt.Sprintf("User not destroyed %q: %v", id, apiErr))
}
return errors.New(strings.Join(errs, ","))
}
}
func testAccCheckUserResourceExists(name string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[name]
@@ -144,9 +77,9 @@ func testAccCheckUserResourceExists(name string) resource.TestCheckFunc {
}
md := testProvider.Meta().(*metaData)
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
@@ -172,9 +105,9 @@ func testAccCheckUserResourceDestroy(t *testing.T) resource.TestCheckFunc {
case "boundary_user":
id := rs.Primary.ID
projID, ok := rs.Primary.Attributes["project_id"]
projID, ok := rs.Primary.Attributes["scope_id"]
if !ok {
return fmt.Errorf("project_id is not set")
return fmt.Errorf("scope_id is not set")
}
projClient := md.client.Clone()
projClient.SetScopeId(projID)
+1 -1
View File
@@ -17,7 +17,7 @@ Do not keep your authentication password in HCL for production environments, use
```hcl
provider "boundary" {
base_url = "https://127.0.0.1:9200"
default_organization = "o_0000000000"
default_scope = "o_0000000000"
auth_method_id = "am_1234567890"
auth_method_username = "foo"
auth_method_password = "bar"
+16 -2
View File
@@ -18,9 +18,23 @@ resource "boundary_group" "example" {
}
```
Usage for project-specific group:
```hcl
resource "boundary_project" "foo" {
name = "foo_project"
}
resource "boundary_group" "example" {
name = "My group"
description = "My first group!"
scope_id = boundary_project.foo.id
}
```
## Argument Reference
The following arguments are optional:
* `name` - The group name. Defaults to the resource name.
* `description` - The group description.
* `name` - The group name. Defaults to the resource name.
* `scope_id` - The scope ID in which the resource is created. Defaults to the provider's `default_scope` if unset.
@@ -22,7 +22,7 @@ resource "boundary_host_catalog" "example" {
name = "My catalog"
description = "My first host catalog!"
type = "Static"
project_id = boundary_project.example.id
scope_id = boundary_project.example.id
}
```
@@ -30,9 +30,8 @@ resource "boundary_host_catalog" "example" {
The following arguments are required:
* `type` - The host catalog type. Only `Static` (yes, title case) is supported.
* `project_id` - The project in which to create this host catalog.
* `scope_id` - The scope ID in which the resource is created.
The following arguments are optional:
* `name` - The host catalog name. Defaults to the resource name.
* `description` - The host catalog description.
+24 -1
View File
@@ -54,9 +54,32 @@ resource "boundary_role" "readonly" {
}
```
Usage for a project-specific role:
```hcl
resource "boundary_project" "foo" {
name = "foo_project"
}
resource "boundary_user" "readonly" {
name = "readonly"
description = "A readonly user"
}
resource "boundary_role" "readonly" {
name = "readonly"
description = "A readonly role"
principals = [boundary_user.readonly.id]
grants = ["id=*;action=read"]
scope_id = boundary_project.foo.id
}
```
## Argument Reference
The following arguments are optional:
* `name` - The role name. Defaults to the resource name.
* `description` - The role description.
* `grants` - A list of stringified grants for the role.
* `name` - The role name. Defaults to the resource name.
* `principals` - A list of principal (user or group) IDs to add as principals on the role.
* `scope_id` - The scope ID in which the resource is created. Defaults to the provider's `default_scope` if unset.
+11 -1
View File
@@ -18,9 +18,19 @@ resource "boundary_user" "example" {
}
```
Usage for non-default organization (users are organization level only resources):
```hcl
resource "boundary_user" "example" {
name = "My user"
description = "My first user!"
scope_id = "o_1234567890"
}
```
## Argument Reference
The following arguments are optional:
* `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.