diff --git a/go.mod b/go.mod index 50b72420..ac7d660d 100755 --- a/go.mod +++ b/go.mod @@ -2,67 +2,53 @@ module github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute go 1.17 -require github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.1 +require github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0 require ( - cloud.google.com/go v0.65.0 // indirect - cloud.google.com/go/storage v1.10.0 // indirect - github.com/agext/levenshtein v1.2.2 // indirect + github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect - github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/aws/aws-sdk-go v1.37.0 // indirect - github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.7.0 // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/golang/protobuf v1.4.2 // indirect - github.com/googleapis/gax-go/v2 v2.0.5 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.8 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect - github.com/hashicorp/go-getter v1.5.3 // indirect - github.com/hashicorp/go-hclog v0.15.0 // indirect - github.com/hashicorp/go-multierror v1.0.0 // indirect - github.com/hashicorp/go-plugin v1.4.1 // indirect - github.com/hashicorp/go-safetemp v1.0.0 // indirect - github.com/hashicorp/go-uuid v1.0.1 // indirect - github.com/hashicorp/go-version v1.3.0 // indirect - github.com/hashicorp/hcl/v2 v2.8.2 // indirect + github.com/hashicorp/go-hclog v1.2.1 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-plugin v1.4.4 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/hc-install v0.3.2 // indirect + github.com/hashicorp/hcl/v2 v2.13.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.14.0 // indirect - github.com/hashicorp/terraform-json v0.12.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.3.0 // indirect - github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/jstemmer/go-junit-report v0.9.1 // indirect - github.com/klauspost/compress v1.11.2 // indirect - github.com/mattn/go-colorable v0.1.4 // indirect - github.com/mattn/go-isatty v0.0.10 // indirect + github.com/hashicorp/terraform-exec v0.16.1 // indirect + github.com/hashicorp/terraform-json v0.14.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.9.1 // indirect + github.com/hashicorp/terraform-plugin-log v0.4.1 // indirect + github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.0.4 // indirect - github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/oklog/run v1.0.0 // indirect - github.com/ulikunitz/xz v0.5.8 // indirect + github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/zclconf/go-cty v1.8.4 // indirect - go.opencensus.io v0.22.4 // indirect - golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/mod v0.3.0 // indirect - golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect - golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect - golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 // indirect - golang.org/x/text v0.3.5 // indirect - golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/api v0.34.0 // indirect - google.golang.org/appengine v1.6.6 // indirect - google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect - google.golang.org/grpc v1.32.0 // indirect - google.golang.org/protobuf v1.25.0 // indirect + github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect + github.com/vmihailenco/tagparser v0.1.2 // indirect + github.com/zclconf/go-cty v1.10.0 // indirect + golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 // indirect + google.golang.org/grpc v1.47.0 // indirect + google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/go.sum b/go.sum index 031124c7..e3a3b88b 100755 --- a/go.sum +++ b/go.sum @@ -1,44 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= @@ -47,11 +9,11 @@ github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/ github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -59,26 +21,19 @@ github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFU github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.37.0 h1:GzFnhOIsrGyQ69s7VgqtrG2BG8v7X7vwB3Xpbd/DBBk= -github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -88,10 +43,14 @@ github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3 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= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= @@ -101,115 +60,96 @@ github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= -github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= -github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= -github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= +github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.4.4 h1:NVdrSdFRt3SkZtNckJ6tog7gbpRrcbOjQi/rgF7JYWQ= +github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY= -github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= +github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= +github.com/hashicorp/hc-install v0.3.2 h1:oiQdJZvXmkNcRcEOOfM5n+VTsvNjWQeOjfAoO6dKSH8= +github.com/hashicorp/hc-install v0.3.2/go.mod h1:xMG6Tr8Fw1WFjlxH0A9v61cW15pFwgEGqEz0V4jisHs= +github.com/hashicorp/hcl/v2 v2.12.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= +github.com/hashicorp/hcl/v2 v2.13.0 h1:0Apadu1w6M11dyGFxWnmhhcMjkbAiKCv7G1r/2QgCNc= +github.com/hashicorp/hcl/v2 v2.13.0/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.14.0 h1:UQoUcxKTZZXhyyK68Cwn4mApT4mnFPmEXPiqaHL9r+w= -github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= -github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= -github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= -github.com/hashicorp/terraform-plugin-go v0.3.0 h1:AJqYzP52JFYl9NABRI7smXI1pNjgR5Q/y2WyVJ/BOZA= -github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.1 h1:vpzKKP2dIFb9n89AG8Wxl758/5JSZWZH0OuKdlq0M38= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.1/go.mod h1:o3pdss6ynDZW9FfiZ+rETUH5LEVufrXdhwLU+5OiRo0= +github.com/hashicorp/terraform-exec v0.16.1 h1:NAwZFJW2L2SaCBVZoVaH8LPImLOGbPLkSHy0IYbs2uE= +github.com/hashicorp/terraform-exec v0.16.1/go.mod h1:aj0lVshy8l+MHhFNoijNHtqTJQI3Xlowv5EOsEaGO7M= +github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk= +github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s= +github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM= +github.com/hashicorp/terraform-plugin-go v0.9.1 h1:vXdHaQ6aqL+OF076nMSBV+JKPdmXlzG5mzVDD04WyPs= +github.com/hashicorp/terraform-plugin-go v0.9.1/go.mod h1:ItjVSlQs70otlzcCwlPcU8FRXLdO973oYFRZwAOxy8M= +github.com/hashicorp/terraform-plugin-log v0.4.0/go.mod h1:9KclxdunFownr4pIm1jdmwKRmE4d6HVG2c9XDq47rpg= +github.com/hashicorp/terraform-plugin-log v0.4.1 h1:xpbmVhvuU3mgHzLetOmx9pkOL2rmgpu302XxddON6eo= +github.com/hashicorp/terraform-plugin-log v0.4.1/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0 h1:Qr5fWNg1SPSfCRMtou67Y6Kcy9UnMYRNlIJTKRuUvXU= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0/go.mod h1:b+LFg8WpYgFgvEBP/6Htk5H9/pJp1V1E8NJAekfH2Ws= +github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co= +github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg= +github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI= +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/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= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= +github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -217,20 +157,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -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= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= -github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -243,46 +171,42 @@ github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LE github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.4 h1:ZU1VNC02qyufSZsjjs7+khruk2fKvbQ3TwRV/IBCeFA= -github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -295,75 +219,43 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= -github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.10.0 h1:mp9ZXQeIcN8kAwuqorjH+Q+njbJKjLrvB2yIh4q7U+0= +github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0= +golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -373,219 +265,104 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 h1:RX8C8PRZc2hTIod4ds8ij+/4RQX3AqhYj3uOHmyaz4E= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b h1:2n253B2r0pYSmEV+UNCQoPfU/FiaizQEK5Gu4Bq4JE8= +golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb h1:KVWk3RW1AZlxWum4tYqegLgwJHb5oouozcGM8HfNQaw= -golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.34.0 h1:k40adF3uR+6x/+hO5Dh4ZFUqFp67vxvbpafFiJxl10A= -google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -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-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d h1:92D1fum1bJLKSdr11OJ+54YeCMCGYIygTA7R/YZxH5M= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 h1:W70HjnmXFJm+8RNjOpIDYW2nKsSi/af0VvIZUtYkwuU= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -595,32 +372,26 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/api/cnnf/cnnf.go b/internal/api/cnnf/cnnf.go new file mode 100644 index 00000000..c5472b7b --- /dev/null +++ b/internal/api/cnnf/cnnf.go @@ -0,0 +1,40 @@ +package cnnf + +import ( + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/collection" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/common" +) + +type Rule struct { + Disabled bool `json:"disabled,omitempty"` + Dst int `json:"dst,omitempty"` // ID of each dst firewall entity. 20 bits are used. Max legal value: 2^20-1 + Effect string `json:"effect,omitempty"` + ID int `json:"id,omitempty"` + Modified string `json:"modified,omitempty"` + Name string `json:"name,omitempty"` + Notes string `json:"notes,omitempty"` + Owner string `json:"owner,omitempty"` + Ports []common.PortRange `json:"ports,omitempty"` + PreviousName string `json:"previousName,omitempty"` + Src int `json:"src,omitempty"` +} + +type AllowAllConnections struct { + Inbound []string `json:"inbound,omitempty"` + Outbound []string `json:"outbound,omitempty"` +} + +type Subnet struct { + CIDR string `json:"cidr,omitempty"` + Name string `json:"name,omitempty"` +} + +type Entities struct { + Id int `json:"_id,omitempty"` + AllowAll AllowAllConnections `json:"allowAll,omitempty"` + Collections []collection.Collection `json:"collection,omitempty"` + Domains []string `json:"domains,omitempty"` + Name string `json:"name,omitempty"` + Subnets []Subnet `json:"subnets,omitempty"` + Type string `json:"type,omitempty"` +} diff --git a/internal/api/common/common.go b/internal/api/common/common.go new file mode 100644 index 00000000..f36361a6 --- /dev/null +++ b/internal/api/common/common.go @@ -0,0 +1,12 @@ +package common + +type Secret struct { + Encrypted string `json:"encrypted,omitempty"` + Plain string `json:"plain,omitempty"` +} + +type PortRange struct { + Deny bool `json:"deny,omitempty"` + End int `json:"end,omitempty"` + Start int `json:"start,omitempty"` +} diff --git a/internal/api/customrules/ref.go b/internal/api/customrules/ref.go new file mode 100644 index 00000000..df17cf9a --- /dev/null +++ b/internal/api/customrules/ref.go @@ -0,0 +1,7 @@ +package customrules + +type Ref struct { + Id int `json:"_id,omitempty"` + Action string `json:"action,omitempty"` + Effect string `json:"effect,omitempty"` +} diff --git a/internal/api/policy/firewall.go b/internal/api/policy/firewall.go new file mode 100644 index 00000000..ea62b5de --- /dev/null +++ b/internal/api/policy/firewall.go @@ -0,0 +1,169 @@ +package policy + +import ( + "fmt" + "net/http" + + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/cnnf" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/waas" +) + +const ( + FirewallAppAppEmbeddedEndpoint = "api/v1/policies/firewall/app/app-embedded" + FirewallAppContainerEndpoint = "api/v1/policies/firewall/app/container" + FirewallAppHostEndpoint = "api/v1/policies/firewall/app/host" + FirewallAppAPISpecEndpoint = "api/v1/policies/firewall/app/apispec" + FirewallAppNetworkListEndpoint = "api/v1/policies/firewall/app/network-list" + FirewallAppOutOfBandEndpoint = "api/v1/policies/firewall/app/out-of-band" + FirewallAppServerlessEndpoint = "api/v1/policies/firewall/app/serverless" + + FirewallNetworkEndpoint = "api/v1/policies/firewall/network" +) + +type FirewallAppPolicy struct { + Id int `json:"_id,omitempty"` + MaxPort int `json:"maxPort,omitempty"` + MinPort int `json:"minPort,omitempty"` + Rules []waas.WaasRule `json:"rules,omitempty"` +} + +type FirewallAppNetworkList struct { + Id int `json:"_id,omitempty"` + Description string `json:"description,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Modified string `json:"modified,omitempty"` + Name string `json:"name,omitempty"` + Notes string `json:"notes,omitempty"` + Owner string `json:"owner,omitempty"` + PreviousName string `json:"previousName,omitempty"` + Subnets []string `json:"subnets,omitempty"` +} + +type FirewallNetworkPolicy struct { + Id int `json:"_id,omitempty"` + ContainerEnabled bool `json:"containerEnabled,omitempty"` + ContainerRules []cnnf.Rule `json:"containerRules,omitempty"` + HostEnabled bool `json:"hostEnabled,omitempty"` + HostRules []cnnf.Rule `json:"hostRules,omitempty"` + Modified string `json:"modified,omitempty"` + NetworkEntities []cnnf.Entities `json:"networkEntities,omitempty"` + Owner string `json:"owner,omitempty"` +} + +// Resolve endpoints defined in an OpenAPI/Swagger specification +func ResolveFirewallAppAPISpec(c api.Client, content string) (waas.WaasAPISpec, error) { + var ans waas.WaasAPISpec + if err := c.Request(http.MethodPost, FirewallAppAPISpecEndpoint, nil, content, &ans); err != nil { + return ans, fmt.Errorf("error resolving app firewall api spec: %s", err) + } + return ans, nil +} + +// Create the current firewall app network list. +func CreateFirewallAppNetworkList(c api.Client, networkList FirewallAppNetworkList) error { + return c.Request(http.MethodPost, FirewallAppNetworkListEndpoint, nil, networkList, nil) +} + +// Get the current app-embedded app firewall policy. +func GetFirewallAppAppEmbedded(c api.Client) (FirewallAppPolicy, error) { + var ans FirewallAppPolicy + if err := c.Request(http.MethodGet, FirewallAppAppEmbeddedEndpoint, nil, nil, &ans); err != nil { + return ans, fmt.Errorf("error getting app-embedded app firewall policy: %s", err) + } + return ans, nil +} + +// Get the current container app firewall policy. +func GetFirewallAppContainer(c api.Client) (FirewallAppPolicy, error) { + var ans FirewallAppPolicy + if err := c.Request(http.MethodGet, FirewallAppContainerEndpoint, nil, nil, &ans); err != nil { + return ans, fmt.Errorf("error getting container app firewall policy: %s", err) + } + return ans, nil +} + +// Get the current host app firewall policy. +func GetFirewallAppHost(c api.Client) (FirewallAppPolicy, error) { + var ans FirewallAppPolicy + if err := c.Request(http.MethodGet, FirewallAppHostEndpoint, nil, nil, &ans); err != nil { + return ans, fmt.Errorf("error getting host app firewall policy: %s", err) + } + return ans, nil +} + +// Get the current out of band app firewall policy. +func GetFirewallAppOutOfBand(c api.Client) (FirewallAppPolicy, error) { + var ans FirewallAppPolicy + if err := c.Request(http.MethodGet, FirewallAppOutOfBandEndpoint, nil, nil, &ans); err != nil { + return ans, fmt.Errorf("error getting out of band app firewall policy: %s", err) + } + return ans, nil +} + +// Get the current serverless app firewall policy. +func GetFirewallAppServerless(c api.Client) (FirewallAppPolicy, error) { + var ans FirewallAppPolicy + if err := c.Request(http.MethodGet, FirewallAppServerlessEndpoint, nil, nil, &ans); err != nil { + return ans, fmt.Errorf("error getting serverless app firewall policy: %s", err) + } + return ans, nil +} + +// Get the current firewall app network list. +func GetFirewallAppNetworkList(c api.Client) (FirewallAppNetworkList, error) { + var ans FirewallAppNetworkList + if err := c.Request(http.MethodGet, FirewallAppNetworkListEndpoint, nil, nil, &ans); err != nil { + return ans, fmt.Errorf("error getting firewall app network list: %s", err) + } + return ans, nil +} + +// Get the current firewall network policy. +func GetFirewallNetworkPolicy(c api.Client) (FirewallNetworkPolicy, error) { + var ans FirewallNetworkPolicy + if err := c.Request(http.MethodGet, FirewallNetworkEndpoint, nil, nil, &ans); err != nil { + return ans, fmt.Errorf("error getting firewall network policy: %s", err) + } + return ans, nil +} + +// Update the current app-embedded app firewall policy. +func UpdateFirewallAppAppEmbedded(c api.Client, policy FirewallAppPolicy) error { + return c.Request(http.MethodPut, FirewallAppAppEmbeddedEndpoint, nil, policy, nil) +} + +// Update the current container app firewall policy. +func UpdateFirewallAppContainer(c api.Client, policy FirewallAppPolicy) error { + return c.Request(http.MethodPut, FirewallAppContainerEndpoint, nil, policy, nil) +} + +// Update the current host app firewall policy. +func UpdateFirewallAppHost(c api.Client, policy FirewallAppPolicy) error { + return c.Request(http.MethodPut, FirewallAppHostEndpoint, nil, policy, nil) +} + +// Update the current out of band app firewall policy. +func UpdateFirewallAppOutOfBand(c api.Client, policy FirewallAppPolicy) error { + return c.Request(http.MethodPut, FirewallAppOutOfBandEndpoint, nil, policy, nil) +} + +// Update the current serverless app firewall policy. +func UpdateFirewallAppServerless(c api.Client, policy FirewallAppPolicy) error { + return c.Request(http.MethodPut, FirewallAppServerlessEndpoint, nil, policy, nil) +} + +// Update the current firewall app network list. +func UpdateFirewallAppNetworkList(c api.Client, networkList FirewallAppNetworkList) error { + return c.Request(http.MethodPut, FirewallAppNetworkListEndpoint, nil, networkList, nil) +} + +// Update the current firewall network policy. +func UpdateFirewallNetworkPolicy(c api.Client, policy FirewallNetworkPolicy) error { + return c.Request(http.MethodPut, FirewallNetworkEndpoint, nil, policy, nil) +} + +// Delete a firewall app network list. +func DeleteFirewallAppNetworkList(c api.Client, name string) error { + return c.Request(http.MethodDelete, fmt.Sprintf("%s/%s", FirewallAppNetworkListEndpoint, name), nil, nil, nil) +} diff --git a/internal/api/waas/waas.go b/internal/api/waas/waas.go new file mode 100644 index 00000000..4efd2cdc --- /dev/null +++ b/internal/api/waas/waas.go @@ -0,0 +1,275 @@ +package waas + +import ( + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/collection" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/common" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/customrules" +) + +type WaasEndpoint struct { + BasePath string `json:"basePath,omitempty"` + ExposedPort int `json:"exposedPort,omitempty"` + GRPC bool `json:"grpc,omitempty"` + Host string `json:"host,omitempty"` + HTTP2 bool `json:"http2,omitempty"` + InternalPort int `json:"internalPort,omitempty"` + TLS bool `json:"tls,omitempty"` +} + +type WaasParam struct { + AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` + Array bool `json:"array,omitempty"` + Explode bool `json:"explode,omitempty"` + Location string `json:"location,omitempty"` + Max int `json:"max,omitempty"` + Min int `json:"min,omitempty"` + Name string `json:"name,omitempty"` + Required bool `json:"required,omitempty"` + Style string `json:"style,omitempty"` + Type string `json:"type,omitempty"` +} + +type WaasMethod struct { + Method string `json:"method,omitempty"` + Parameters []WaasParam `json:"parameters,omitempty"` +} + +type WaasPath struct { + Methods []WaasMethod `json:"methods,omitempty"` + Path string `json:"path,omitempty"` +} + +type WaasExceptionField struct { + Key string `json:"key,omitempty"` + Location string `json:"location,omitempty"` +} + +type WaasProtectionConfig struct { + Effect string `json:"effect,omitempty"` + ExceptionFields []WaasExceptionField `json:"exceptionFields,omitempty"` +} + +type WaasBodyConfig struct { + InspectionLimitExceededEffect string `json:"inspectionLimitExceededEffect,omitempty"` + InspectionSizeBytes int `json:"inspectionSizeBytes,omitempty"` + Skip bool `json:"skip,omitempty"` +} + +type WaasJSInjectionSpec struct { + Enabled bool `json:"enabled,omitempty"` + TimeoutEffect string `json:"timeoutEffect,omitempty"` +} + +type WaasKnownBotProtectionsSpec struct { + Archiving string `json:"archiving,omitempty"` + BusinessAnalytics string `json:"businessAnalytics,omitempty"` + CareerSearch string `json:"careerSearch,omitempty"` + ContentFeedClients string `json:"contentFeedClients,omitempty"` + Educational string `json:"educational,omitempty"` + Financial string `json:"financial,omitempty"` + MediaSearch string `json:"mediaSearch,omitempty"` + News string `json:"news,omitempty"` + SearchEngineCrawlers string `json:"searchEngineCrawlers,omitempty"` +} + +type WaasReCAPTCHASpec struct { + AllSessions bool `json:"allSessions,omitempty"` + Enabled bool `json:"enabled,omitempty"` + SecretKey common.Secret `json:"secretKey,omitempty"` + SiteKey string `json:"siteKey,omitempty"` + SuccessExpirationHours int `json:"successExpirationHours,omitempty"` + Type string `json:"type,omitempty"` +} + +type WaasRequestAnomalies struct { + Effect string `json:"effect,omitempty"` + Threshold int `json:"threshold,omitempty"` +} + +type WaasUnknownBotProtectionSpec struct { + APILibraries string `json:"apiLibraries,omitempty"` + BotImpersonation string `json:"botImpersonation,omitempty"` + BrowserImpersonation string `json:"browserImpersonation,omitempty"` + Generic string `json:"generic,omitempty"` + RequestAnomalies WaasRequestAnomalies `json:"requestAnomalies,omitempty"` + WebAutomationTools string `json:"webAutomationTools,omitempty"` + WebScrapers string `json:"webScrapers,omitempty"` +} + +type WaasUserDefinedBot struct { + Effect string `json:"effect,omitempty"` + HeaderName string `json:"headerName,omitempty"` + HeaderValues []string `json:"headerValues,omitempty"` + Name string `json:"name,omitempty"` + Subnets []string `json:"subnets,omitempty"` +} + +type WaasBotProtectionSpec struct { + InterstitialPage bool `json:"interstitialPage,omitempty"` + JSInjectionSpec WaasJSInjectionSpec `json:"jsInjectionSpec,omitempty"` + KnownBotProtectionsSpec WaasKnownBotProtectionsSpec `json:"knownBotProtectionsSpec,omitempty"` + ReCAPTCHASpec WaasReCAPTCHASpec `json:"reCAPTCHASpec,omitempty"` + SessionValidation string `json:"sessionValidation,omitempty"` + UnknownBotProtectionSpec WaasUnknownBotProtectionSpec `json:"unknownBotProtectionSpec,omitempty"` + UserDefinedBots []WaasUserDefinedBot `json:"userDefinedBots,omitempty"` +} + +type WaasCustomBlockResponseConfig struct { + Body string `json:"body,omitempty"` + Code int `json:"code,omitempty"` + Enabled bool `json:"enabled,omitempty"` +} + +type WaasDoSRates struct { + Average int `json:"average,omitempty"` + Burst int `json:"burst,omitempty"` +} + +type WaasStatusCodeRange struct { + End int `json:"end,omitempty"` + Start int `json:"start,omitempty"` +} + +type WaasDoSMatchCondition struct { + FileTypes []string `json:"fileTypes,omitempty"` + Methods []string `json:"methods,omitempty"` + ResponseCodeRanges []WaasStatusCodeRange `json:"responseCodeRanges,omitempty"` +} + +type WaasDoSConfig struct { + Alert WaasDoSRates `json:"alert,omitempty"` + Ban WaasDoSRates `json:"ban,omitempty"` + Enabled bool `json:"enabled,omitempty"` + ExcludedNetworkLists []string `json:"excludedNetworkLists,omitempty"` + MatchConditions []WaasDoSMatchCondition `json:"matchConditions,omitempty"` + TrackSession bool `json:"trackSession,omitempty"` +} + +type WaasHeaderSpec struct { + Allow bool `json:"allow,omitempty"` + Effect string `json:"effect,omitempty"` + Name string `json:"name,omitempty"` + Required bool `json:"required,omitempty"` + Values []string `json:"values,omitempty"` +} + +type WaasIntelGatheringConfig struct { + InfoLeakageEffect string `json:"infoLeakageEffect,omitempty"` + RemoveFingerprintsEnabled bool `json:"removeFingerprintsEnabled,omitempty"` +} + +type WaasMaliciousUploadConfig struct { + AllowedExtensions []string `json:"allowedExtensions,omitempty"` + AllowedFileTypes []string `json:"allowedFileTypes,omitempty"` + Effect string `json:"effect,omitempty"` +} + +type WaasAccessControls struct { + Alert []string `json:"alert,omitempty"` + Allow []string `json:"allow,omitempty"` + AllowMode bool `json:"allowMode,omitempty"` + Enabled bool `json:"enabled,omitempty"` + FallbackEffect string `json:"fallbackEffect,omitempty"` + Prevent []string `json:"prevent,omitempty"` +} + +type WaasNetworkControls struct { + AdvancedProtectionEffect string `json:"advancedProtectionEffect,omitempty"` + Countries WaasAccessControls `json:"countries,omitempty"` + ExceptionSubnets []string `json:"exceptionSubnets,omitempty"` + Subnets WaasAccessControls `json:"subnets,omitempty"` +} + +type WaasRemoteHostForwardingConfig struct { + Enabled bool `json:"enabled,omitempty"` + Target string `json:"target,omitempty"` +} + +type WaasResponseHeaderSpec struct { + Name string `json:"name,omitempty"` + Override bool `json:"override,omitempty"` + Values []string `json:"values,omitempty"` +} + +type WaasHSTSConfig struct { + Enabled bool `json:"enabled,omitempty"` + IncludeSubdomains bool `json:"includeSubdomains,omitempty"` + MaxAgeSeconds int `json:"maxAgeSeconds,omitempty"` + Preload bool `json:"preload,omitempty"` +} + +type WaasCertificateMeta struct { + IssuerName string `json:"issuerName,omitempty"` + NotAfter string `json:"notAfter,omitempty"` + SubjectName string `json:"subjectName,omitempty"` +} + +type WaasTLSConfig struct { + HSTSConfig WaasHSTSConfig `json:"HSTSConfig,omitempty"` + Metadata WaasCertificateMeta `json:"metadata,omitempty"` + MinTLSVersion string `json:"minTLSVersion,omitempty"` +} + +type WaasApplicationSpec struct { + APISpec WaasAPISpec `json:"apiSpec,omitempty"` + AppID string `json:"appID,omitempty"` + AttackTools WaasProtectionConfig `json:"attackTools,omitempty"` + BanDurationMinutes int `json:"banDurationMinutes,omitempty"` + Body WaasBodyConfig `json:"body,omitempty"` + BotProtectionSpec WaasBotProtectionSpec `json:"botProtectionSpec,omitempty"` + Certificate common.Secret `json:"certificate,omitempty"` + ClickjackingEnabled bool `json:"clickjackingEnabled,omitempty"` + CMDI WaasProtectionConfig `json:"cmdi,omitempty"` + CodeInjection WaasProtectionConfig `json:"codeInjection,omitempty"` + CSRFEnabled bool `json:"csrfEnabled,omitempty"` + CustomBlockResponse WaasCustomBlockResponseConfig `json:"customBlockResponse,omitempty"` + CustomRules []customrules.Ref `json:"customRules,omitempty"` + DisableEventIDHeader bool `json:"disableEventIDHeader,omitempty"` + DoSConfig WaasDoSConfig `json:"dosConfig,omitempty"` + HeaderSpecs []WaasHeaderSpec `json:"headerSpecs,omitempty"` + IntelGathering WaasIntelGatheringConfig `json:"intelGathering,omitempty"` + LFI WaasProtectionConfig `json:"lfi,omitempty"` + MalformedReq WaasProtectionConfig `json:"malformedReq,omitempty"` + MaliciousUpload WaasMaliciousUploadConfig `json:"maliciousUpload,omitempty"` + NetworkControls WaasNetworkControls `json:"networkControls,omitempty"` + RemoteHostForwarding WaasRemoteHostForwardingConfig `json:"remoteHostForwarding,omitempty"` + ResponseHeaderSpecs WaasResponseHeaderSpec `json:"responseHeaderSpecs,omitempty"` + SessionCookieBan bool `json:"sessionCookieBan,omitempty"` + SessionCookieEnabled bool `json:"sessionCookieEnabled,omitempty"` + SessionCookieSameSite string `json:"sessionCookieSameSite,omitempty"` + SessionCookieSecure bool `json:"sessionCookieSecure,omitempty"` + Shellshock WaasProtectionConfig `json:"shellshock,omitempty"` + SQLI WaasProtectionConfig `json:"sqli,omitempty"` + TLSConfig WaasTLSConfig `json:"tlsConfig,omitempty"` + XSS WaasProtectionConfig `json:"xss,omitempty"` +} + +type WaasTrafficMirroringConfig struct { + Enabled bool `json:"enabled,omitempty"` +} + +type WaasRule struct { + AllowMalformedHttpHeaderNames bool `json:"allowMalformedHttpHeaderNames,omitempty"` + ApplicationsSpec []WaasApplicationSpec `json:"applicationsSpec,omitempty"` + AutoProtectPorts bool `json:"autoProtectPorts,omitempty"` + Collections []collection.Collection `json:"collections,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Modified string `json:"modified,omitempty"` + Name string `json:"name,omitempty"` + Notes string `json:"notes,omitempty"` + Owner string `json:"owner,omitempty"` + PreviousName string `json:"previousName,omitempty"` + ReadTimeoutSeconds int `json:"readTimeoutSeconds,omitempty"` + SkipAPILearning bool `json:"skipAPILearning,omitempty"` + TrafficMirroring WaasTrafficMirroringConfig `json:"trafficMirroring,omitempty"` + Windows bool `json:"windows,omitempty"` +} + +type WaasAPISpec struct { + Description string `json:"description,omitempty"` + Effect string `json:"effect,omitempty"` + Endpoints []WaasEndpoint `json:"endpoints,omitempty"` + FallbackEffect string `json:"fallbackEffect,omitempty"` + Paths []WaasPath `json:"paths,omitempty"` + QueryParamFallbackEffect string `json:"queryParamFallbackEffect,omitempty"` +} diff --git a/internal/convert/firewall.go b/internal/convert/firewall.go new file mode 100644 index 00000000..d77152b4 --- /dev/null +++ b/internal/convert/firewall.go @@ -0,0 +1,230 @@ +package convert + +import ( + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/policy" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/waas" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func SchemaToFirewallAppPolicy(d *schema.ResourceData) (policy.FirewallAppPolicy, error) { + policy := policy.FirewallAppPolicy{} + + if val, ok := d.GetOk("max_port"); ok { + policy.MaxPort = val.(int) + } + + if val, ok := d.GetOk("min_port"); ok { + policy.MinPort = val.(int) + } + + if schemaRules, ok := d.GetOk("rules"); ok { + iterRules := schemaRules.([]interface{}) + + for _, schemaRule := range iterRules { + mapRule := schemaRule.(map[string]interface{}) + rule := waas.WaasRule{} + + if val, ok := mapRule["allow_malformed_http_header_names"]; ok { + rule.AllowMalformedHttpHeaderNames = val.(bool) + } + + if schemaApplications, ok := mapRule["applications"]; ok { + iterApplications := schemaApplications.([]interface{}) + + for _, schemaApplication := range iterApplications { + mapApplication := schemaApplication.(map[string]interface{}) + application := waas.WaasApplicationSpec{} + + if schemaAPIs, ok := mapApplication["api"]; ok { + iterAPIs := schemaAPIs.([]interface{}) + + if len(iterAPIs) == 1 { + mapAPI := iterAPIs[0].(map[string]interface{}) + api := waas.WaasAPISpec{} + + if val, ok := mapAPI["description"]; ok { + api.Description = val.(string) + } + + if val, ok := mapAPI["effect"]; ok { + api.Effect = val.(string) + } + + if schemaEndpoints, ok := mapAPI["endpoints"]; ok { + iterEndpoints := schemaEndpoints.([]interface{}) + for _, schemaEndpoint := range iterEndpoints { + mapEndpoint := schemaEndpoint.(map[string]interface{}) + endpoint := waas.WaasEndpoint{} + + if val, ok := mapEndpoint["base_path"]; ok { + endpoint.BasePath = val.(string) + } + + if val, ok := mapEndpoint["exposed_port"]; ok { + endpoint.ExposedPort = val.(int) + } + + if val, ok := mapEndpoint["grpc"]; ok { + endpoint.GRPC = val.(bool) + } + + if val, ok := mapEndpoint["host"]; ok { + endpoint.Host = val.(string) + } + + if val, ok := mapEndpoint["http2"]; ok { + endpoint.HTTP2 = val.(bool) + } + + if val, ok := mapEndpoint["internal_port"]; ok { + endpoint.InternalPort = val.(int) + } + + if val, ok := mapEndpoint["tls"]; ok { + endpoint.TLS = val.(bool) + } + + api.Endpoints = append(api.Endpoints, endpoint) + } + } + + if val, ok := mapAPI["fallback_effect"]; ok { + api.FallbackEffect = val.(string) + } + + if schemaPaths, ok := mapAPI["paths"]; ok { + iterPaths := schemaPaths.([]interface{}) + for _, schemaPath := range iterPaths { + mapPath := schemaPath.(map[string]interface{}) + path := waas.WaasPath{} + + if schemaMethods, ok := mapPath["methods"]; ok { + iterMethods := schemaMethods.([]interface{}) + for _, schemaMethod := range iterMethods { + mapMethod := schemaMethod.(map[string]interface{}) + method := waas.WaasMethod{} + + if val, ok := mapMethod["method"]; ok { + method.Method = val.(string) + } + + if schemaParameters, ok := mapMethod["parameters"]; ok { + iterParameters := schemaParameters.([]interface{}) + for _, schemaParameter := range iterParameters { + mapParameter := schemaParameter.(map[string]interface{}) + parameter := waas.WaasParam{} + + if val, ok := mapParameter["allow_empty_value"]; ok { + parameter.AllowEmptyValue = val.(bool) + } + + if val, ok := mapParameter["array"]; ok { + parameter.Array = val.(bool) + } + + if val, ok := mapParameter["explode"]; ok { + parameter.Explode = val.(bool) + } + + if val, ok := mapParameter["location"]; ok { + parameter.Location = val.(string) + } + + if val, ok := mapParameter["max"]; ok { + parameter.Max = val.(int) + } + + if val, ok := mapParameter["min"]; ok { + parameter.Min = val.(int) + } + + if val, ok := mapParameter["name"]; ok { + parameter.Name = val.(string) + } + + if val, ok := mapParameter["required"]; ok { + parameter.Required = val.(bool) + } + + if val, ok := mapParameter["style"]; ok { + parameter.Style = val.(string) + } + + if val, ok := mapParameter["type"]; ok { + parameter.Type = val.(string) + } + + method.Parameters = append(method.Parameters, parameter) + } + } + + path.Methods = append(path.Methods, method) + } + } + + if val, ok := mapPath["path"]; ok { + path.Path = val.(string) + } + + api.Paths = append(api.Paths, path) + } + } + + if val, ok := mapAPI["query_param_effect"]; ok { + api.QueryParamFallbackEffect = val.(string) + } + + application.APISpec = api + } + } + + if val, ok := mapApplication["app_id"]; ok { + application.AppID = val.(string) + } + + if schemaAttackTools, ok := mapApplication["attack_tools"]; ok { + iterAttackTools := schemaAttackTools.([]interface{}) + + if len(iterAttackTools) == 1 { + mapAttackTools := iterAttackTools[0].(map[string]interface{}) + attackTools := waas.WaasProtectionConfig{} + + if val, ok := mapAttackTools["effect"]; ok { + attackTools.Effect = val.(string) + } + + if schemaAttackToolsExceptions, ok := mapAttackTools["exceptions"]; ok { + iterAttackToolsExceptions := schemaAttackToolsExceptions.([]interface{}) + + for _, schemaAttackException := range iterAttackToolsExceptions { + mapAttackToolsException := schemaAttackException.(map[string]interface{}) + attackToolsException := waas.WaasExceptionField{} + + if val, ok := mapAttackToolsException["key"]; ok { + attackToolsException.Key = val.(string) + } + + if val, ok := mapAttackToolsException["location"]; ok { + attackToolsException.Location = val.(string) + } + + attackTools.ExceptionFields = append(attackTools.ExceptionFields, attackToolsException) + } + } + + application.AttackTools = attackTools + } + } + + if val, ok := mapApplication["ban_duration"]; ok { + application.BanDurationMinutes = val.(int) + } + + } + } + } + } + + return policy, nil + +} diff --git a/internal/provider/resource_collection_test.go b/internal/provider/resource_collection_test.go index adc3fd52..35a1c6ec 100755 --- a/internal/provider/resource_collection_test.go +++ b/internal/provider/resource_collection_test.go @@ -110,7 +110,7 @@ func testAccCheckCollectionExists(n string, o *collection.Collection) resource.T client := testAccProvider.Meta().(*api.Client) name := rs.Primary.ID - lo, err := collection.Get(*client, name) + lo, err := collection.GetCollection(*client, name) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -151,7 +151,7 @@ func testAccCollectionDestroy(s *terraform.State) error { if rs.Primary.ID != "" { name := rs.Primary.ID - if err := collection.Delete(*client, name); err == nil { + if err := collection.DeleteCollection(*client, name); err == nil { return fmt.Errorf("Object %q still exists", name) } } diff --git a/internal/provider/resource_credentials_test.go b/internal/provider/resource_credentials_test.go index 4d6202c8..75c0b8bd 100644 --- a/internal/provider/resource_credentials_test.go +++ b/internal/provider/resource_credentials_test.go @@ -1,10 +1,12 @@ package provider import ( + "bytes" "fmt" "testing" "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/auth" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -12,8 +14,8 @@ import ( func TestCredentialsConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccCredentialsConfig") - var o group.Group - id := fmt.Sprintf("tf%s", acctest.RandString(6)) + var o auth.Credential + name := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -21,17 +23,17 @@ func TestCredentialsConfig(t *testing.T) { CheckDestroy: testAccCredentialsDestroy, Steps: []resource.TestStep{ { - Config: testAccCredentialsConfig(id), + Config: testAccCredentialsConfig(name), Check: resource.ComposeTestCheckFunc( testAccCheckCredentialsExists("prismacloudcompute_credentials.test", &o), - testAccCheckCredentialsAttributes(&o, id, true), + testAccCheckCredentialsAttributes(&o, name, true), ), }, { - Config: testAccCredentialsConfig(id), + Config: testAccCredentialsConfig(name), Check: resource.ComposeTestCheckFunc( testAccCheckCredentialsExists("prismacloudcompute_credentials.test", &o), - testAccCheckCredentialsAttributes(&o, id, true), + testAccCheckCredentialsAttributes(&o, name, true), ), }, }, @@ -39,8 +41,8 @@ func TestCredentialsConfig(t *testing.T) { } func TestCredentialsNetwork(t *testing.T) { - var o group.Group - id := fmt.Sprintf("tf%s", acctest.RandString(6)) + var o auth.Credential + name := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -48,17 +50,17 @@ func TestCredentialsNetwork(t *testing.T) { CheckDestroy: testAccCredentialsDestroy, Steps: []resource.TestStep{ { - Config: testAccCredentialsConfig(id), + Config: testAccCredentialsConfig(name), Check: resource.ComposeTestCheckFunc( testAccCheckCredentialsExists("prismacloudcompute_credentials.test", &o), - testAccCheckCredentialsAttributes(&o, id, true), + testAccCheckCredentialsAttributes(&o, name, true), ), }, { - Config: testAccCredentialsConfig(id), + Config: testAccCredentialsConfig(name), Check: resource.ComposeTestCheckFunc( testAccCheckCredentialsExists("prismacloudcompute_credentials.test", &o), - testAccCheckCredentialsAttributes(&o, id, true), + testAccCheckCredentialsAttributes(&o, name, true), ), }, }, @@ -66,7 +68,7 @@ func TestCredentialsNetwork(t *testing.T) { } func TestCredentialsAuditEvent(t *testing.T) { - var o group.Group + var o auth.Credential id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -92,7 +94,7 @@ func TestCredentialsAuditEvent(t *testing.T) { }) } -func testCredentialsExists(n string, o *group.Group) resource.TestCheckFunc { +func testAccCheckCredentialsExists(n string, o *auth.Credential) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.GroupId) @@ -106,61 +108,61 @@ func testCredentialsExists(n string, o *group.Group) resource.TestCheckFunc { } client := testAccProvider.Meta().(*api.Client) - lo, err := Credentials.Get(*client) + id := rs.Primary.ID + lo, err := auth.GetCredential(*client, id) if err != nil { return fmt.Errorf("Error in get: %s", err) } - *o = lo + o = lo return nil } } -// func testCredentialsAttributes(o *group.Group, id string, learningDisabled bool) resource.TestCheckFunc { -// return func(s *terraform.State) error { -// if o.GroupId != id { -// return fmt.Errorf("\n\nGroupId is %s, expected %s", o.GroupId, id) -// } else { -// fmt.Printf("\n\nName is %s", o.GroupId) -// } - -// if o.LearningDisabled != learningDisabled { -// return fmt.Errorf("LearningDisabled is %t, expected %t", o.LearningDisabled, learningDisabled) -// } - -// return nil -// } -// } - -// func testCredentialsDestroy(s *terraform.State) error { -// /* client := testAccProvider.Meta().(*api.Client) - -// for _, rs := range s.RootModule().Resources { - -// if rs.Type != "prismacloudcompute_credentials" { -// continue -// } - -// if rs.Primary.ID != "" { -// name := rs.Primary.ID -// if err := group.Delete(client, name); err == nil { -// return fmt.Errorf("Object %q still exists", name) -// } -// } -// return nil -// } -// */ -// return nil -// } - -// func testCredentialsConfig(id string) string { -// var buf bytes.Buffer -// buf.Grow(500) - -// buf.WriteString(fmt.Sprintf(` -// resource "prismacloudcompute_credentials" "test" { -// name = %q -// }`, id)) - -// return buf.String() -// } +func testAccCheckCredentialsAttributes(o *auth.Credential, id string, skipVerify bool) resource.TestCheckFunc { + return func(s *terraform.State) error { + if o.Id != id { + return fmt.Errorf("\n\nCredentialId is %s, expected %s", o.Id, id) + } else { + fmt.Printf("\n\nId is %s", o.Id) + } + + if o.SkipVerify != skipVerify { + return fmt.Errorf("SkipVerify is %t, expected %t", o.SkipVerify, skipVerify) + } + + return nil + } +} + +func testAccCredentialsDestroy(s *terraform.State) error { + client := testAccProvider.Meta().(*api.Client) + + for _, rs := range s.RootModule().Resources { + + if rs.Type != "prismacloudcompute_credentials" { + continue + } + + if rs.Primary.ID != "" { + id := rs.Primary.ID + if err := auth.DeleteCredential(*client, id); err == nil { + return fmt.Errorf("Object %q still exists", id) + } + } + return nil + } + return nil +} + +func testAccCredentialsConfig(id string) string { + var buf bytes.Buffer + buf.Grow(500) + + buf.WriteString(fmt.Sprintf(` +resource "prismacloudcompute_credentials" "test" { + id = %q +}`, id)) + + return buf.String() +} diff --git a/internal/provider/resource_custom_compliance_test.go b/internal/provider/resource_custom_compliance_test.go index 011145b0..e422e6e6 100644 --- a/internal/provider/resource_custom_compliance_test.go +++ b/internal/provider/resource_custom_compliance_test.go @@ -3,6 +3,7 @@ package provider import ( "bytes" "fmt" + "strconv" "testing" "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" @@ -110,7 +111,7 @@ func testAccCheckCustomComplianceExists(n string, o *policy.CustomCompliance) re client := testAccProvider.Meta().(*api.Client) name := rs.Primary.ID - lo, err := policy.Get(*client, name) + lo, err := policy.GetCustomComplianceByName(*client, name) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -142,9 +143,9 @@ func testAccCustomComplianceDestroy(s *terraform.State) error { } if rs.Primary.ID != "" { - name := rs.Primary.ID - if err := policy.Delete(*client, name); err == nil { - return fmt.Errorf("Object %q still exists", name) + id, _ := strconv.Atoi(rs.Primary.ID) + if err := policy.DeleteCustomCompliance(*client, id); err == nil { + return fmt.Errorf("Object %q still exists", id) } } return nil diff --git a/internal/provider/resource_custom_rule_test.go b/internal/provider/resource_custom_rule_test.go index 7b6dcf69..cf73b7bb 100755 --- a/internal/provider/resource_custom_rule_test.go +++ b/internal/provider/resource_custom_rule_test.go @@ -3,6 +3,7 @@ package provider import ( "bytes" "fmt" + "strconv" "testing" "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" @@ -110,7 +111,7 @@ func testAccCheckCustomRuleExists(n string, o *rule.CustomRule) resource.TestChe client := testAccProvider.Meta().(*api.Client) name := rs.Primary.ID - lo, err := rule.Get(*client, name) + lo, err := rule.GetCustomRuleByName(*client, name) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -120,7 +121,7 @@ func testAccCheckCustomRuleExists(n string, o *rule.CustomRule) resource.TestChe } } -func testAccCheckCustomRuleAttributes(o *rule.CustomRule, name string, description string, color string) resource.TestCheckFunc { +func testAccCheckCustomRuleAttributes(o *rule.CustomRule, name string, description string, typeOfCustomRuleAttribute string) resource.TestCheckFunc { return func(s *terraform.State) error { if o.Name != name { return fmt.Errorf("\n\nName is %s, expected %s", o.Name, name) @@ -132,8 +133,8 @@ func testAccCheckCustomRuleAttributes(o *rule.CustomRule, name string, descripti return fmt.Errorf("Description is %s, expected %s", o.Description, description) } - if o.Color != color { - return fmt.Errorf("Color type is %q, expected %q", o.Color, color) + if o.Type != typeOfCustomRuleAttribute { + return fmt.Errorf("Type is %q, expected %q", o.Type, typeOfCustomRuleAttribute) } return nil @@ -150,9 +151,9 @@ func testAccCustomRuleDestroy(s *terraform.State) error { } if rs.Primary.ID != "" { - name := rs.Primary.ID - if err := rule.Delete(*client, name); err == nil { - return fmt.Errorf("Object %q still exists", name) + id, _ := strconv.Atoi(rs.Primary.ID) + if err := rule.DeleteCustomRule(*client, id); err == nil { + return fmt.Errorf("Object %q still exists", id) } } return nil diff --git a/internal/provider/resource_groups_test.go b/internal/provider/resource_groups_test.go index ca79cce0..ed9f366d 100644 --- a/internal/provider/resource_groups_test.go +++ b/internal/provider/resource_groups_test.go @@ -1,10 +1,12 @@ package provider import ( + "bytes" "fmt" "testing" "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/auth" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -12,7 +14,7 @@ import ( func TestGroupsConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccGroupsConfig") - var o group.Group + var o auth.Group id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -39,7 +41,7 @@ func TestGroupsConfig(t *testing.T) { } func TestGroupsNetwork(t *testing.T) { - var o group.Group + var o auth.Group id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -66,7 +68,7 @@ func TestGroupsNetwork(t *testing.T) { } func TestGroupsAuditEvent(t *testing.T) { - var o group.Group + var o auth.Group id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -92,7 +94,7 @@ func TestGroupsAuditEvent(t *testing.T) { }) } -func testGroupsExists(n string, o *group.Group) resource.TestCheckFunc { +func testAccCheckGroupsExists(n string, o *auth.Group) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.GroupId) @@ -106,61 +108,61 @@ func testGroupsExists(n string, o *group.Group) resource.TestCheckFunc { } client := testAccProvider.Meta().(*api.Client) - lo, err := groups.Get(*client) + id := rs.Primary.ID + lo, err := auth.GetGroup(*client, id) if err != nil { return fmt.Errorf("Error in get: %s", err) } - *o = lo + o = lo return nil } } -// func testGroupsAttributes(o *group.Group, id string, learningDisabled bool) resource.TestCheckFunc { -// return func(s *terraform.State) error { -// if o.GroupId != id { -// return fmt.Errorf("\n\nGroupId is %s, expected %s", o.GroupId, id) -// } else { -// fmt.Printf("\n\nName is %s", o.GroupId) -// } - -// if o.LearningDisabled != learningDisabled { -// return fmt.Errorf("LearningDisabled is %t, expected %t", o.LearningDisabled, learningDisabled) -// } - -// return nil -// } -// } - -// func testGroupsDestroy(s *terraform.State) error { -// /* client := testAccProvider.Meta().(*api.Client) - -// for _, rs := range s.RootModule().Resources { - -// if rs.Type != "prismacloudcompute_groups" { -// continue -// } - -// if rs.Primary.ID != "" { -// name := rs.Primary.ID -// if err := group.Delete(client, name); err == nil { -// return fmt.Errorf("Object %q still exists", name) -// } -// } -// return nil -// } -// */ -// return nil -// } - -// func testGroupsConfig(id string) string { -// var buf bytes.Buffer -// buf.Grow(500) - -// buf.WriteString(fmt.Sprintf(` -// resource "prismacloudcompute_groups" "test" { -// name = %q -// }`, id)) - -// return buf.String() -// } +func testAccCheckGroupsAttributes(o *auth.Group, id string, oauthGroup bool) resource.TestCheckFunc { + return func(s *terraform.State) error { + if o.Id != id { + return fmt.Errorf("\n\nGroupId is %s, expected %s", o.Id, id) + } else { + fmt.Printf("\n\nName is %s", o.Id) + } + + if o.OauthGroup != oauthGroup { + return fmt.Errorf("LearningDisabled is %t, expected %t", o.OauthGroup, oauthGroup) + } + + return nil + } +} + +func testAccGroupsDestroy(s *terraform.State) error { + client := testAccProvider.Meta().(*api.Client) + + for _, rs := range s.RootModule().Resources { + + if rs.Type != "prismacloudcompute_groups" { + continue + } + + if rs.Primary.ID != "" { + name := rs.Primary.ID + if err := auth.DeleteGroup(*client, name); err == nil { + return fmt.Errorf("Object %q still exists", name) + } + } + return nil + } + return nil +} + +func testAccGroupsConfig(id string) string { + var buf bytes.Buffer + buf.Grow(500) + + buf.WriteString(fmt.Sprintf(` +resource "prismacloudcompute_groups" "test" { + name = %q +}`, id)) + + return buf.String() +} diff --git a/internal/provider/resource_policies_admission_test.go b/internal/provider/resource_policies_admission_test.go index ed498250..39319f22 100644 --- a/internal/provider/resource_policies_admission_test.go +++ b/internal/provider/resource_policies_admission_test.go @@ -15,7 +15,7 @@ import ( func TestAccPolicyAdmissionConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccPolicyAdmissionConfig") - var o policy.Policy + var o policy.AdmissionPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -26,15 +26,8 @@ func TestAccPolicyAdmissionConfig(t *testing.T) { { Config: testAccPolicyAdmissionConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test", &o), - testAccCheckPolicyAdmissionAttributes(&o, id, true), - ), - }, - { - Config: testAccPolicyAdmissionConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test", &o), - testAccCheckPolicyAdmissionAttributes(&o, id, true), + testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test"), + testAccCheckPolicyAdmissionAttributes(&o, id), ), }, }, @@ -42,7 +35,7 @@ func TestAccPolicyAdmissionConfig(t *testing.T) { } func TestAccPolicyAdmissionNetwork(t *testing.T) { - var o policy.Policy + var o policy.AdmissionPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -53,15 +46,8 @@ func TestAccPolicyAdmissionNetwork(t *testing.T) { { Config: testAccPolicyAdmissionConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test", &o), - testAccCheckPolicyAdmissionAttributes(&o, id, true), - ), - }, - { - Config: testAccPolicyAdmissionConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test", &o), - testAccCheckPolicyAdmissionAttributes(&o, id, true), + testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test"), + testAccCheckPolicyAdmissionAttributes(&o, id), ), }, }, @@ -69,7 +55,7 @@ func TestAccPolicyAdmissionNetwork(t *testing.T) { } func TestAccPolicyAdmissionAuditEvent(t *testing.T) { - var o policy.Policy + var o policy.AdmissionPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -80,22 +66,15 @@ func TestAccPolicyAdmissionAuditEvent(t *testing.T) { { Config: testAccPolicyAdmissionConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test", &o), - testAccCheckPolicyAdmissionAttributes(&o, id, true), - ), - }, - { - Config: testAccPolicyAdmissionConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test", &o), - testAccCheckPolicyAdmissionAttributes(&o, id, true), + testAccCheckPolicyAdmissionExists("prismacloudcompute_policies_admission.test"), + testAccCheckPolicyAdmissionAttributes(&o, id), ), }, }, }) } -func testAccCheckPolicyAdmissionExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyAdmissionExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,26 +88,21 @@ func testAccCheckPolicyAdmissionExists(n string, o *policy.Policy) resource.Test } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.ComplianceHostEndpoint) + _, err := policy.GetAdmission(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } - *o = lo return nil } } -func testAccCheckPolicyAdmissionAttributes(o *policy.Policy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyAdmissionAttributes(o *policy.AdmissionPolicy, id string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) + if o.Id != id { + return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.Id, id) } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - - if o.PolicyType != policyType { - return fmt.Errorf("PolicyType is %s, expected %s", o.PolicyType, policyType) + fmt.Printf("\n\nId is %s", o.Id) } return nil diff --git a/internal/provider/resource_policies_compliance_ci_coderepo_test.go b/internal/provider/resource_policies_compliance_ci_coderepo_test.go index ee18f11d..dc4079a2 100644 --- a/internal/provider/resource_policies_compliance_ci_coderepo_test.go +++ b/internal/provider/resource_policies_compliance_ci_coderepo_test.go @@ -27,14 +27,7 @@ func TestAccPolicyComplianceCiCoderepoConfig(t *testing.T) { Config: testAccPolicyComplianceCiCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyComplianceCiCoderepoExists("prismacloudcompute_policies_compliance_coderepo.test", &o), - testAccCheckPolicyComplianceCiCoderepoAttributes(&o, id, "network"), - ), - }, - { - Config: testAccPolicyComplianceCiCoderepoConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiCoderepoExists("prismacloudcompute_policies_compliance_coderepo.test", &o), - testAccCheckPolicyComplianceCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyComplianceCiCoderepoAttributes(&o, "network"), ), }, }, @@ -54,14 +47,7 @@ func TestAccPolicyComplianceCiCoderepoNetwork(t *testing.T) { Config: testAccPolicyComplianceCiCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyComplianceCiCoderepoExists("prismacloudcompute_policies_compliance_coderepo.test", &o), - testAccCheckPolicyComplianceCiCoderepoAttributes(&o, id, "network"), - ), - }, - { - Config: testAccPolicyComplianceCiCoderepoConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiCoderepoExists("prismacloudcompute_policies_compliance_coderepo.test", &o), - testAccCheckPolicyComplianceCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyComplianceCiCoderepoAttributes(&o, "network"), ), }, }, @@ -81,14 +67,7 @@ func TestAccPolicyComplianceCiCoderepoAuditEvent(t *testing.T) { Config: testAccPolicyComplianceCiCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyComplianceCiCoderepoExists("prismacloudcompute_policies_compliance_coderepo.test", &o), - testAccCheckPolicyComplianceCiCoderepoAttributes(&o, id, "network"), - ), - }, - { - Config: testAccPolicyComplianceCiCoderepoConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiCoderepoExists("prismacloudcompute_policies_compliance_coderepo.test", &o), - testAccCheckPolicyComplianceCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyComplianceCiCoderepoAttributes(&o, "network"), ), }, }, @@ -119,14 +98,8 @@ func testAccCheckPolicyComplianceCiCoderepoExists(n string, o *policy.Compliance } } -func testAccCheckPolicyComplianceCiCoderepoAttributes(o *policy.ComplianceCoderepoPolicy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyComplianceCiCoderepoAttributes(o *policy.ComplianceCoderepoPolicy, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.Id != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.Id, id) - } else { - fmt.Printf("\n\nName is %s", o.Id) - } - if o.Type != policyType { return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } diff --git a/internal/provider/resource_policies_compliance_ci_images_test.go b/internal/provider/resource_policies_compliance_ci_images_test.go index 05823edc..cd3c54d2 100644 --- a/internal/provider/resource_policies_compliance_ci_images_test.go +++ b/internal/provider/resource_policies_compliance_ci_images_test.go @@ -13,89 +13,68 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccPolicyComplianceCiImagesConfig(t *testing.T) { - fmt.Printf("\n\nStart TestAccPolicyComplianceCiImagesConfig") - var o policy.Policy +func TestAccPolicyComplianceCIImagesConfig(t *testing.T) { + fmt.Printf("\n\nStart TestAccPolicyComplianceCiCIImagesConfig") + var o policy.ComplianceCoderepoPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyComplianceCiImagesDestroy, + CheckDestroy: testAccPolicyComplianceCIImagesDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyComplianceCiImagesConfig(id), + Config: testAccPolicyComplianceCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiImagesExists("prismacloudcompute_policies_compliance_container.test", &o), - testAccCheckPolicyComplianceCiImagesAttributes(&o, id, "network"), - ), - }, - { - Config: testAccPolicyComplianceCiImagesConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiImagesExists("prismacloudcompute_policies_compliance_container.test", &o), - testAccCheckPolicyComplianceCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyComplianceCIImagesExists("prismacloudcompute_policies_compliance_coderepo.test", &o), + testAccCheckPolicyComplianceCIImagesAttributes(&o, "network"), ), }, }, }) } -func TestAccPolicyComplianceCiImagesNetwork(t *testing.T) { - var o policy.Policy +func TestAccPolicyComplianceCIImagesNetwork(t *testing.T) { + var o policy.ComplianceCoderepoPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyComplianceCiImagesDestroy, + CheckDestroy: testAccPolicyComplianceCIImagesDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyComplianceCiImagesConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiImagesExists("prismacloudcompute_policies_compliance_container.test", &o), - testAccCheckPolicyComplianceCiImagesAttributes(&o, id, "network"), - ), - }, - { - Config: testAccPolicyComplianceCiImagesConfig(id), + Config: testAccPolicyComplianceCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiImagesExists("prismacloudcompute_policies_compliance_container.test", &o), - testAccCheckPolicyComplianceCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyComplianceCIImagesExists("prismacloudcompute_policies_compliance_coderepo.test", &o), + testAccCheckPolicyComplianceCIImagesAttributes(&o, "network"), ), }, }, }) } -func TestAccPolicyComplianceCiImagesAuditEvent(t *testing.T) { - var o policy.Policy +func TestAccPolicyComplianceCIImagesAuditEvent(t *testing.T) { + var o policy.ComplianceCoderepoPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyComplianceCiImagesDestroy, + CheckDestroy: testAccPolicyComplianceCIImagesDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyComplianceCiImagesConfig(id), + Config: testAccPolicyComplianceCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiImagesExists("prismacloudcompute_policies_compliance_container.test", &o), - testAccCheckPolicyComplianceCiImagesAttributes(&o, id, "network"), - ), - }, - { - Config: testAccPolicyComplianceCiImagesConfig(id), - Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyComplianceCiImagesExists("prismacloudcompute_policies_compliance_container.test", &o), - testAccCheckPolicyComplianceCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyComplianceCIImagesExists("prismacloudcompute_policies_compliance_coderepo.test", &o), + testAccCheckPolicyComplianceCIImagesAttributes(&o, "network"), ), }, }, }) } -func testAccCheckPolicyComplianceCiImagesExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyComplianceCIImagesExists(n string, o *policy.ComplianceCoderepoPolicy) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,7 +88,7 @@ func testAccCheckPolicyComplianceCiImagesExists(n string, o *policy.Policy) reso } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.ComplianceCiImagesEndpoint) + lo, err := policy.GetComplianceCoderepo(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -119,28 +98,22 @@ func testAccCheckPolicyComplianceCiImagesExists(n string, o *policy.Policy) reso } } -func testAccCheckPolicyComplianceCiImagesAttributes(o *policy.Policy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyComplianceCIImagesAttributes(o *policy.ComplianceCoderepoPolicy, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) - } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - - if o.PolicyType != policyType { - return fmt.Errorf("PolicyType is %s, expected %s", o.PolicyType, policyType) + if o.Type != policyType { + return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } return nil } } -func testAccPolicyComplianceCiImagesDestroy(s *terraform.State) error { +func testAccPolicyComplianceCIImagesDestroy(s *terraform.State) error { /* client := testAccProvider.Meta().(*api.Client) for _, rs := range s.RootModule().Resources { - if rs.Type != "prismacloudcompute_policycomplianceciimages" { + if rs.Type != "prismacloudcompute_policycompliancecoderepo" { continue } @@ -156,12 +129,12 @@ func testAccPolicyComplianceCiImagesDestroy(s *terraform.State) error { return nil } -func testAccPolicyComplianceCiImagesConfig(id string) string { +func testAccPolicyComplianceCIImagesConfig(id string) string { var buf bytes.Buffer buf.Grow(500) buf.WriteString(fmt.Sprintf(` -resource "prismacloudcompute_policyComplianceCiImages" "test" { +resource "prismacloudcompute_policyComplianceCIImages" "test" { name = %q }`, id)) diff --git a/internal/provider/resource_policies_compliance_coderepo_test.go b/internal/provider/resource_policies_compliance_coderepo_test.go index 7a8f9b7c..96e95d3c 100644 --- a/internal/provider/resource_policies_compliance_coderepo_test.go +++ b/internal/provider/resource_policies_compliance_coderepo_test.go @@ -121,12 +121,6 @@ func testAccCheckPolicyComplianceCoderepoExists(n string, o *policy.ComplianceCo func testAccCheckPolicyComplianceCoderepoAttributes(o *policy.ComplianceCoderepoPolicy, id string, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.Id != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.Id, id) - } else { - fmt.Printf("\n\nName is %s", o.Id) - } - if o.Type != policyType { return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } diff --git a/internal/provider/resource_policies_compliance_container_test.go b/internal/provider/resource_policies_compliance_container_test.go index e8392270..4e943cc0 100644 --- a/internal/provider/resource_policies_compliance_container_test.go +++ b/internal/provider/resource_policies_compliance_container_test.go @@ -15,7 +15,7 @@ import ( func TestAccPolicyComplianceContainerConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccPolicyComplianceContainerConfig") - var o policy.Policy + var o policy.CompliancePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -42,7 +42,7 @@ func TestAccPolicyComplianceContainerConfig(t *testing.T) { } func TestAccPolicyComplianceContainerNetwork(t *testing.T) { - var o policy.Policy + var o policy.CompliancePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -69,7 +69,7 @@ func TestAccPolicyComplianceContainerNetwork(t *testing.T) { } func TestAccPolicyComplianceContainerAuditEvent(t *testing.T) { - var o policy.Policy + var o policy.CompliancePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -95,7 +95,7 @@ func TestAccPolicyComplianceContainerAuditEvent(t *testing.T) { }) } -func testAccCheckPolicyComplianceContainerExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyComplianceContainerExists(n string, o *policy.CompliancePolicy) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,7 +109,7 @@ func testAccCheckPolicyComplianceContainerExists(n string, o *policy.Policy) res } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.ComplianceContainerEndpoint) + lo, err := policy.GetComplianceContainer(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -119,16 +119,11 @@ func testAccCheckPolicyComplianceContainerExists(n string, o *policy.Policy) res } } -func testAccCheckPolicyComplianceContainerAttributes(o *policy.Policy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyComplianceContainerAttributes(o *policy.CompliancePolicy, id string, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) - } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - if o.PolicyType != policyType { - return fmt.Errorf("PolicyType is %s, expected %s", o.PolicyType, policyType) + if o.Type != policyType { + return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } return nil @@ -140,7 +135,7 @@ func testAccPolicyComplianceContainerDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { - if rs.Type != "prismacloudcompute_policycompliancecontainer" { + if rs.Type != "prismacloudcompute_policyComplianceContainer" { continue } diff --git a/internal/provider/resource_policies_compliance_host_test.go b/internal/provider/resource_policies_compliance_host_test.go index ae949ebc..90743aa0 100644 --- a/internal/provider/resource_policies_compliance_host_test.go +++ b/internal/provider/resource_policies_compliance_host_test.go @@ -15,7 +15,7 @@ import ( func TestAccPolicyComplianceHostConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccPolicyComplianceHostConfig") - var o policy.Policy + var o policy.CompliancePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -42,7 +42,7 @@ func TestAccPolicyComplianceHostConfig(t *testing.T) { } func TestAccPolicyComplianceHostNetwork(t *testing.T) { - var o policy.Policy + var o policy.CompliancePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -69,7 +69,7 @@ func TestAccPolicyComplianceHostNetwork(t *testing.T) { } func TestAccPolicyComplianceHostAuditEvent(t *testing.T) { - var o policy.Policy + var o policy.CompliancePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -95,7 +95,7 @@ func TestAccPolicyComplianceHostAuditEvent(t *testing.T) { }) } -func testAccCheckPolicyComplianceHostExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyComplianceHostExists(n string, o *policy.CompliancePolicy) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,7 +109,7 @@ func testAccCheckPolicyComplianceHostExists(n string, o *policy.Policy) resource } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.ComplianceHostEndpoint) + lo, err := policy.GetComplianceHost(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -119,16 +119,11 @@ func testAccCheckPolicyComplianceHostExists(n string, o *policy.Policy) resource } } -func testAccCheckPolicyComplianceHostAttributes(o *policy.Policy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyComplianceHostAttributes(o *policy.CompliancePolicy, id string, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) - } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - if o.PolicyType != policyType { - return fmt.Errorf("PolicyType is %s, expected %s", o.PolicyType, policyType) + if o.Type != policyType { + return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } return nil diff --git a/internal/provider/resource_policies_firewall_app_container.go b/internal/provider/resource_policies_firewall_app_container.go new file mode 100644 index 00000000..0929c43f --- /dev/null +++ b/internal/provider/resource_policies_firewall_app_container.go @@ -0,0 +1,1696 @@ +package provider + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +// Slices to validate some fields in the schema. +var ( + waasEffectStrings = []string{ + "ban", + "prevent", + "alert", + "allow", + "disable", + "reCAPTCHA", + } + + waasExceptionLocationStrings = []string{ + "path", + "query", + "queryValues", + "cookie", + "UserAgentHeader", + "header", + "body", + "rawBody", + "XMLPath", + "JSONPath", + } + + waasReCAPTCHATypeStrings = []string{ + "checkbox", + "invisible", + } + + waasRequestAnomalyThresholdInts = []int{ + 3, + 6, + 9, + } + + customrulesActionStrings = []string{ + "audit", + "incident", + } + + waasFileTypeStrings = []string{ + "pdf", + "officeLegacy", + "officeOoxml", + "odf", + "jpeg", + "png", + "gif", + "bmp", + "ico", + "avi", + "mp4", + "aac", + "mp3", + "wav", + "zip", + "gzip", + "rar", + "7zip", + } + + waasSameSiteStrings = []string{ + "Lax", + "Strict", + "None", + } + + waasMinTLSVersiontrings = []string{ + "1.0", + "1.1", + "1.2", + "1.3", + } + + waasParamLocationStrings = []string{ + "path", + "query", + "cookie", + "header", + "body", + "json", + "xml", + "formData", + "multipart", + } + + waasParamStyleStrings = []string{ + "simple", + "spaceDelimited", + "tabDelimited", + "pipeDelimited", + "form", + "matrix", + "label", + } + + waasParamTypeStrings = []string{ + "integer", + "number", + "string", + "boolean", + "array", + "object", + } +) + +func resourcePoliciesFirewallAppContainer() *schema.Resource { + return &schema.Resource{ + Create: createPolicyFirewallAppContainer, + Read: readPolicyFirewallAppContainer, + Update: updatePolicyFirewallAppContainer, + Delete: deletePolicyFirewallAppContainer, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Computed: true, + Description: "Unique internal ID.", + }, + "max_port": { + Type: schema.TypeInt, + Optional: true, + Default: 31000, + Description: "Maximum port number to use in the application firewall.", + }, + "min_port": { + Type: schema.TypeInt, + Optional: true, + Default: 30000, + Description: "Minimum port number to use in the application firewall.", + }, + "rules": { + Type: schema.TypeList, + Required: true, + Description: "Rules in the policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_malformed_http_header_names": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if validation of http request header names should allow non-compliant characters.", + }, + "applications": { + Type: schema.TypeList, + Optional: true, + Description: "List of application specifications in the rule.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "api": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "API specification.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "description": { + Type: schema.TypeString, + Optional: true, + Description: "Description of the app.", + }, + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect that will be used in the rule.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "endpoints": { + Type: schema.TypeList, + Optional: true, + Description: "The app's endpoints.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base_path": { + Type: schema.TypeString, + Required: true, + Default: "/", + Description: "Base path for the endpoint.", + }, + "exposed_port": { + Type: schema.TypeInt, + Optional: true, + Description: "Exposed port that the proxy is listening on.", + }, + "grpc": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the proxy supports gRPC (true) or not (false).", + }, + "host": { + Type: schema.TypeString, + Optional: true, + Default: "*", + Description: "URL address (name or IP) of the endpoint's API specification (e.g., petstore.swagger.io). The address can be prefixed with a wildcard (e.g., *.swagger.io).", + }, + "http2": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the proxy supports HTTP/2 (true) or not (false).", + }, + "internal_port": { + Type: schema.TypeInt, + Required: true, + Description: "Internal port that the application is listening on.", + }, + "tls": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the connection is secured (true) or not (false).", + }, + }, + }, + }, + "fallback_effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Fallback effect that will be used in the rule.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "paths": { + Type: schema.TypeList, + Optional: true, + Description: "Paths of the API's endpoints.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "methods": { + Type: schema.TypeList, + Required: true, + Description: "Supported operations for the path (e.g., PUT, GET, etc.).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "method": { + Type: schema.TypeString, + Required: true, + Description: "Type of HTTP request (e.g., PUT, GET, etc.).", + }, + "parameters": { + Type: schema.TypeList, + Optional: true, + Description: "Parameters that are part of the HTTP request.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_empty_value": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the proxy supports HTTP/2 (true) or not (false).", + }, + "array": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if multiple values of the specified type are allowed (true) or not (false).", + }, + "explode": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if arrays should generate separate parameters for each array item or object property.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "The location of a parameter.", + ValidateFunc: validation.StringInSlice(waasParamLocationStrings, false), + }, + "max": { + Type: schema.TypeInt, + Optional: true, + Description: "Maximum allowable value for a numeric parameter.", + }, + "min": { + Type: schema.TypeInt, + Optional: true, + Description: "Maximum allowable value for a numeric parameter.", + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the parameter.", + }, + "required": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the parameter is required (true) or not (false).", + }, + "style": { + Type: schema.TypeString, + Optional: true, + Description: "Param format style, defined by OpenAPI specification It describes how the parameter value will be serialized depending on the type of the parameter.", + ValidateFunc: validation.StringInSlice(waasParamStyleStrings, false), + }, + "type": { + Type: schema.TypeString, + Optional: true, + Description: "Type of a parameter, defined by OpenAPI specification.", + ValidateFunc: validation.StringInSlice(waasParamTypeStrings, false), + }, + }, + }, + }, + }, + }, + }, + "path": { + Type: schema.TypeString, + Required: true, + Description: "Relative path to an endpoint such as '/pet/{petId}'.", + }, + }, + }, + }, + + "query_param_effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Query param effect that will be used in the rule.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + }, + }, + }, + "app_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Datetime when the rule was last modified.", + }, + "attack_tools": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against attack tools and vulnerability scanners.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect that will be used in the rule.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + "ban_duration": { + Type: schema.TypeInt, + Optional: true, + Default: 5, + Description: "Ban duration, in minutes.", + }, + "body": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "App configuration related to HTTP body.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "inspection_limit_exceeded_effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect that will be used if body is more than inspection size.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "inspection_size": { + Type: schema.TypeInt, + Optional: true, + Default: 131072, + Description: "Max amount of data to inspect in request body.", + }, + "skip": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates that body inspection should be skipped.", + }, + }, + }, + }, + "bot_protection": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against bots.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "interstitial_page": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if an interstitial page is served (true) or not (false).", + }, + "js_inspection": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "JS inspection configuration.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if JavaScript injection is enabled (true) or not (false).", + }, + "timeout_effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect that will be used if the timeout of JS inspection is raised.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + }, + }, + }, + "known_bot_protections": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Known bot protections configuration.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "archiving": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if an archiving bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "business_analytics": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a business analytics bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "career_search": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a career search bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "content_feed_clients": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a content feed clients bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "educational": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if an educational bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "financial": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a financial bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "media_search": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a media search bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "news": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a news bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "search_engine_crawlers": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a search engine crawler bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + }, + }, + }, + "recaptcha": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "reCaptcha protections configuration.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "all_sessions": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if the reCAPTCHA page is served at the start of every new session (true) or not (false).", + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if reCAPTCHA integration is enabled (true) or not (false).", + }, + "secret_key": { + Type: schema.TypeString, + Optional: true, + Description: "Secret key to use when invoking the reCAPTCHA service.", + }, + "site_key": { + Type: schema.TypeString, + Optional: true, + Description: "Site key to use when invoking the reCAPTCHA service.", + }, + "success_expiration": { + Type: schema.TypeInt, + Optional: true, + Default: 24, + Description: "Duration (hours) for which the indication of reCAPTCHA success is kept. Maximum value is 30 days * 24 = 720 hours.", + }, + "type": { + Type: schema.TypeString, + Optional: true, + Description: "Encrypted secret key to use when invoking the reCAPTCHA service.", + ValidateFunc: validation.StringInSlice(waasReCAPTCHATypeStrings, false), + }, + }, + }, + }, + "session_validation": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if the session is not validated.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "unknown_bot_protection": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Unknown bot protection configuration.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "api_libraries": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if an API library bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "bot_impersonation": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a bot impersonation bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "browser_impersonation": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a browser impersonation bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "generic": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a generic bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "http_libraries": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a HTTP library bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "request_anomalies_effect": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if anomalies are detected in a request done by a bot crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "request_anomalies_threshold": { + Type: schema.TypeInt, + Optional: true, + Default: 9, + Description: "Score threshold for which request anomaly violation is triggered.", + ValidateFunc: validation.IntInSlice(waasRequestAnomalyThresholdInts), + }, + "web_automation_tools": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a web automation tool bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "web_scrapers": { + Type: schema.TypeString, + Optional: true, + Default: "disable", + Description: "Effect that will be used if a web scraper bot is crawling the app.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + }, + }, + }, + "user_defined_bot_protection": { + Type: schema.TypeList, + Optional: true, + Description: "Effects to perform when user-defined bots are detected.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect that will be used if the user-defined bot is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "header_name": { + Type: schema.TypeString, + Required: true, + Description: "HTTP header name to recognize the user-defined bot.", + }, + "header_values": { + Type: schema.TypeList, + Optional: true, + Description: "Header values.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the user-defined bot.", + }, + "subnets": { + Type: schema.TypeList, + Optional: true, + Description: "Subnets where the bot originates. Specify using network lists.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "certificate": { + Type: schema.TypeString, + Optional: true, + Description: "Certificate used to decrypt TLS.", + }, + "clickjackingEnabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates whether clickjacking protection is enabled (true) or not (false).", + }, + "command_injection": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against command injection.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a command injection is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + "code_injection": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against code injection.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a code injection is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + "csrf_enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates whether Cross-Site Request Forgery (CSRF) protection is enabled (true) or not (false).", + }, + "custom_block_response": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Custom block message config for a policy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "body": { + Type: schema.TypeString, + Required: true, + Description: "Custom HTML for the block response.", + }, + "code": { + Type: schema.TypeInt, + Optional: true, + Default: 403, + Description: "Custom HTTP response code for the block response.", + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the custom block response is enabled (true) or not (false).", + }, + }, + }, + }, + "custom_rules": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "List of custom runtime rules.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Required: true, + Description: "Custom rule ID.", + }, + "action": { + Type: schema.TypeString, + Required: true, + Description: "Action is the action to perform if the custom rule applies.", + ValidateFunc: validation.StringInSlice(customrulesActionStrings, false), + }, + "effect": { + Type: schema.TypeString, + Required: true, + Description: "Effect if a code injection is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + }, + }, + }, + "disabled_event_id_header": { + Type: schema.TypeBool, + Optional: true, + Default: true, + Description: "Indicates if event ID header should be attached to the response or not.", + }, + "dos_config": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protect against DOS attacks.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "alert_avg": { + Type: schema.TypeInt, + Required: true, + Description: "Average request rate (requests / second) threshold before alerting.", + }, + "alert_burst": { + Type: schema.TypeInt, + Required: true, + Description: "Burst request rate (requests / second) threshold before alerting.", + }, + "ban_avg": { + Type: schema.TypeInt, + Required: true, + Description: "Average request rate (requests / second) threshold before baning.", + }, + "ban_burst": { + Type: schema.TypeInt, + Required: true, + Description: "Burst request rate (requests / second) threshold before baning.", + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the rule is disabled or not.", + }, + "excluded_network_lists": { + Type: schema.TypeList, + Optional: true, + Description: "Network IPs to exclude from DoS tracking.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "match_conditions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "file_types": { + Type: schema.TypeList, + Optional: true, + Description: "File types for request matching.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "methods": { + Type: schema.TypeList, + Optional: true, + Description: "HTTP methods for request matching.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "response_code_ranges": { + Type: schema.TypeList, + Optional: true, + Description: "Response codes for the request's response matching.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "end": { + Type: schema.TypeInt, + Optional: true, + Description: "End of the range. Can be omitted if using a single status code.", + }, + "start": { + Type: schema.TypeList, + Required: true, + Description: "Start of the range. Can also be used for a single, non-range value.", + }, + }, + }, + }, + }, + }, + }, + "track_session": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the custom session ID generated during bot protection flow is tracked (true) or not (false).", + }, + }, + }, + }, + "headers": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration for inspecting HTTP headers.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if the flow is to be allowed (true) or blocked (false).", + }, + "effect": { + Type: schema.TypeString, + Required: true, + Default: "alert", + Description: "Effect if a header is found.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "Header name.", + }, + "required": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if the header must be present (true) or not (false).", + }, + "values": { + Type: schema.TypeList, + Optional: true, + Description: "Wildcard expressions that represent the header value.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "intel_gathering": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Configuration for intelligence gathering protections.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "info_leakage_effect": { + Type: schema.TypeString, + Required: true, + Default: "alert", + Description: "Effect if a leakage is found.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "remove_fingerprint_enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if server fingerprints should be removed (true) or not (false).", + }, + }, + }, + }, + "local_file_inclusion": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against local file inclusion.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a local file inclusion is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + "malformed_requests": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against malformed requests.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a malformed request is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + "malicious_uploads": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against malicious uploads.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allowed_extensions": { + Type: schema.TypeList, + Optional: true, + Description: "Allowed file extensions.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "allowed_file_types": { + Type: schema.TypeList, + Optional: true, + Description: "Allowed file types.", + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(waasFileTypeStrings, false), + }, + }, + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a malicious upload is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + }, + }, + }, + "network_controls": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection using access controls for IPs and countries.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "advanced_protection_effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if controlled IPs / contries are detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "countries": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Countries managed by access control.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "alert": { + Type: schema.TypeString, + Optional: true, + Description: "Alert are the denied countries for which we alert.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "allow": { + Type: schema.TypeString, + Optional: true, + Description: "Allow are the allowed countries for which we don't alert or prevent.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "allow_mode": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates allowlist (true) or denylist (false) mode.", + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Enabled indicates if access controls protection is enabled.", + }, + "fallback_effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if an access control is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "prevent": { + Type: schema.TypeList, + Optional: true, + Description: "The denied countries.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "exception_subnets": { + Type: schema.TypeList, + Optional: true, + Description: "Network lists for which requests completely bypass WAAS checks and protections.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "subnets": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Subnets managed by access control.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "alert": { + Type: schema.TypeString, + Optional: true, + Description: "Alert are the denied subnets for which we alert.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "allow": { + Type: schema.TypeString, + Optional: true, + Description: "Allow are the allowed subnets for which we don't alert or prevent.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "allow_mode": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates allowlist (true) or denylist (false) mode.", + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Enabled indicates if access controls protection is enabled.", + }, + "fallback_effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if an access control is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "prevent": { + Type: schema.TypeList, + Optional: true, + Description: "The denied subnets.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + "remote_host_forwarding": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Remote host to forward requests to.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if remote host forwarding is enabled (true) or not (false).", + }, + "target": { + Type: schema.TypeString, + Required: true, + Description: "Remote host to forward requests to.", + }, + }, + }, + }, + "response_headers": { + Type: schema.TypeList, + Optional: true, + Description: "Configuration for modifying HTTP response headers.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Header name (will be canonicalized when possible).", + }, + "override": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates whether to override existing values (true) or add to them (false).", + }, + "values": { + Type: schema.TypeList, + Required: true, + Description: "New header values.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "session_cookie_ban": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if bans in this app are made by session cookie ID (true) or false (not).", + }, + "session_cookie_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if session cookies are enabled (true) or not (false).", + }, + "session_cookie_samesite": { + Type: schema.TypeString, + Optional: true, + Description: "SameSite allows a server to define a cookie attribute making it impossible for the browser to send this cookie along with cross-site requests. The main goal is to mitigate the risk of cross-origin information leakage, and provide some protection against cross-site request forgery attacks.", + ValidateFunc: validation.StringInSlice(waasSameSiteStrings, false), + }, + "session_cookie_secure": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates the Secure attribute of the session cookie.", + }, + "shellshock": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against shellshock requests.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a shellshock request is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + "sql_injection": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against SQL injection requests.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a SQL injection request is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + "tls_config": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "The user TLS configuration and the certificate data.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "hsts_config": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "The HTTP Strict Transport Security configuration in order to enforce HSTS header.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Enabled indicates if HSTS enforcement is enabled.", + }, + "include_subdomains": { + Type: schema.TypeString, + Optional: true, + Default: false, + Description: "Indicates if this rule applies to all of the site's subdomains as well.", + }, + "max_age": { + Type: schema.TypeInt, + Optional: true, + Default: 31536000, + Description: "The time (in seconds) that the browser should remember that a site is only be accessed using HTTPS.", + }, + "preload": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Indicates if it should support preload.", + }, + }, + }, + }, + "metadata": { + Type: schema.TypeList, + MaxItems: 1, + Computed: true, + Description: "The user TLS configuration and the certificate data.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "issuer_name": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate issuer common name.", + }, + "not_after": { + Type: schema.TypeString, + Computed: true, + Description: "The time the certificate is not valid (expiry time).", + }, + "subject_name": { + Type: schema.TypeString, + Computed: true, + Description: "The certificate subject common name.", + }, + }, + }, + }, + "min_tls_version": { + Type: schema.TypeString, + Optional: true, + Default: "1.2", + Description: "MinTLSVersion is the list of acceptable TLS versions.", + ValidateFunc: validation.StringInSlice(waasMinTLSVersiontrings, false), + }, + }, + }, + }, + "cross_site_scripting": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Protection against Cross Site Scripting (XSS) requests.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "effect": { + Type: schema.TypeString, + Optional: true, + Default: "alert", + Description: "Effect if a Cross Site Scripting (XSS) request is detected.", + ValidateFunc: validation.StringInSlice(waasEffectStrings, false), + }, + "exceptions": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + Description: "Field in HTTP request.", + }, + "location": { + Type: schema.TypeString, + Required: true, + Description: "Exception HTTP field location.", + ValidateFunc: validation.StringInSlice(waasExceptionLocationStrings, false), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "auto_protect_ports": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if http ports should be automatically detected and protected.", + }, + "collections": { + Type: schema.TypeList, + Required: true, + Description: "List of collections. Used to scope the rule.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "account_ids": { + Type: schema.TypeList, + Optional: true, + Description: "List of account IDs.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "app_ids": { + Type: schema.TypeList, + Optional: true, + Description: "List of application IDs.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "clusters": { + Type: schema.TypeList, + Optional: true, + Description: "List of Kubernetes cluster names.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "color": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Hexadecimal representation of color code value.", + }, + "containers": { + Type: schema.TypeList, + Optional: true, + Description: "List of containers.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "description": { + Type: schema.TypeList, + Optional: true, + Description: "Free-form text..", + }, + "functions": { + Type: schema.TypeList, + Optional: true, + Description: "List of functions.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "hosts": { + Type: schema.TypeList, + Optional: true, + Description: "List of hosts.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "images": { + Type: schema.TypeList, + Optional: true, + Description: "List of images.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "labels": { + Type: schema.TypeList, + Optional: true, + Description: "List of labels.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "modified": { + Type: schema.TypeString, + Computed: true, + Description: "Datetime when the collection was last modified.", + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "Collection name. Must be unique.", + }, + "namespaces": { + Type: schema.TypeList, + Optional: true, + Description: "List of Kubernetes namespaces.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "owner": { + Type: schema.TypeString, + Computed: true, + Description: "User who created or last modified the collection.", + }, + "prisma": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this collection originates from Prisma Cloud.", + }, + "system": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether this collection was created by the system (i.e., a non user) (true) or a real user (false).", + }, + }, + }, + }, + "disabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if the rule is disabled or not.", + }, + "modified": { + Type: schema.TypeString, + Computed: true, + Description: "Datetime when the rule was last modified.", + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the rule.", + }, + "notes": { + Type: schema.TypeString, + Optional: true, + Description: "Free-form text.", + }, + "owmer": { + Type: schema.TypeString, + Computed: true, + Description: "User who created or last modified the rule.", + }, + "previous_name": { + Type: schema.TypeString, + Optional: true, + Description: "Previous name of the rule. Required for rule renaming.", + }, + "read_timeout": { + Type: schema.TypeInt, + Optional: true, + Default: 5, + Description: "Timeout of request reads in seconds, when no value is specified (0) the timeout is 5 seconds.", + }, + "skip_api_learning": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if API discovery is to be skipped (true) or not (false).", + }, + "traffic_mirroring_enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates if if traffic mirroring is enabled.", + }, + "windows": { + Type: schema.TypeBool, + Optional: true, + Description: "Indicates whether the operating system of the app is windows, default is Linux.", + }, + }, + }, + }, + }, + } +} + +func createPolicyFirewallAppContainer(d *schema.ResourceData, meta interface{}) error { + /* + TODO + */ + return readPolicyFirewallAppContainer(d, meta) +} + +func readPolicyFirewallAppContainer(d *schema.ResourceData, meta interface{}) error { + /* + TODO + */ + return nil +} + +func updatePolicyFirewallAppContainer(d *schema.ResourceData, meta interface{}) error { + /* + TODO + */ + return readPolicyFirewallAppContainer(d, meta) +} + +func deletePolicyFirewallAppContainer(d *schema.ResourceData, meta interface{}) error { + return nil + /* + TODO + */ +} diff --git a/internal/provider/resource_policies_runtime_container_test.go b/internal/provider/resource_policies_runtime_container_test.go index 8785bc2a..cf890056 100644 --- a/internal/provider/resource_policies_runtime_container_test.go +++ b/internal/provider/resource_policies_runtime_container_test.go @@ -13,89 +13,89 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccPolicyConfig(t *testing.T) { +func TestAccPolicyRuntimeContainerConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccPolicyConfig") - var o policy.Policy + var o policy.RuntimeContainerPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyDestroy, + CheckDestroy: testAccPolicyRuntimeContainerDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeContainerConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeContainerExists("prismacloudcompute_policies_runtime_Container.test", &o), + testAccCheckPolicyRuntimeContainerAttributes(&o), ), }, { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeContainerConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeContainerExists("prismacloudcompute_policies_runtime_Container.test", &o), + testAccCheckPolicyRuntimeContainerAttributes(&o), ), }, }, }) } -func TestAccPolicyNetwork(t *testing.T) { - var o policy.Policy +func TestAccPolicyRuntimeContainerNetwork(t *testing.T) { + var o policy.RuntimeContainerPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyDestroy, + CheckDestroy: testAccPolicyRuntimeContainerDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeContainerConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeContainerExists("prismacloudcompute_policies_runtime_Container.test", &o), + testAccCheckPolicyRuntimeContainerAttributes(&o), ), }, { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeContainerConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeContainerExists("prismacloudcompute_policies_runtime_Container.test", &o), + testAccCheckPolicyRuntimeContainerAttributes(&o), ), }, }, }) } -func TestAccPolicyAuditEvent(t *testing.T) { - var o policy.Policy +func TestAccPolicyRuntimeContainerAuditEvent(t *testing.T) { + var o policy.RuntimeContainerPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyDestroy, + CheckDestroy: testAccPolicyRuntimeContainerDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeContainerConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeContainerExists("prismacloudcompute_policies_runtime_Container.test", &o), + testAccCheckPolicyRuntimeContainerAttributes(&o), ), }, { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeContainerConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeContainerExists("prismacloudcompute_policies_runtime_Container.test", &o), + testAccCheckPolicyRuntimeContainerAttributes(&o), ), }, }, }) } -func testAccCheckPolicyExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyRuntimeContainerExists(n string, o *policy.RuntimeContainerPolicy) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,7 +109,7 @@ func testAccCheckPolicyExists(n string, o *policy.Policy) resource.TestCheckFunc } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.RuntimeContainerEndpoint) + lo, err := policy.GetRuntimeContainer(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -119,28 +119,18 @@ func testAccCheckPolicyExists(n string, o *policy.Policy) resource.TestCheckFunc } } -func testAccCheckPolicyAttributes(o *policy.Policy, id string, learningDisabled bool) resource.TestCheckFunc { +func testAccCheckPolicyRuntimeContainerAttributes(o *policy.RuntimeContainerPolicy) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) - } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - - if o.LearningDisabled != learningDisabled { - return fmt.Errorf("LearningDisabled is %t, expected %t", o.LearningDisabled, learningDisabled) - } - return nil } } -func testAccPolicyDestroy(s *terraform.State) error { +func testAccPolicyRuntimeContainerDestroy(s *terraform.State) error { /* client := testAccProvider.Meta().(*api.Client) for _, rs := range s.RootModule().Resources { - if rs.Type != "prismacloudcompute_policyruntimecontainer" { + if rs.Type != "prismacloudcompute_policyruntimeContainer" { continue } @@ -156,7 +146,7 @@ func testAccPolicyDestroy(s *terraform.State) error { return nil } -func testAccPolicyConfig(id string) string { +func testAccPolicyRuntimeContainerConfig(id string) string { var buf bytes.Buffer buf.Grow(500) diff --git a/internal/provider/resource_policies_runtime_host_test.go b/internal/provider/resource_policies_runtime_host_test.go index d1be62d7..a77db4b8 100644 --- a/internal/provider/resource_policies_runtime_host_test.go +++ b/internal/provider/resource_policies_runtime_host_test.go @@ -1,165 +1,159 @@ package provider import ( + "bytes" "fmt" "testing" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/policy" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestPolicyRuntimeHostConfig(t *testing.T) { +func TestAccPolicyRuntimeHostConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccPolicyConfig") - var o policy.Policy + var o policy.RuntimeHostPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyDestroy, + CheckDestroy: testAccPolicyRuntimeHostDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeHostConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeHostExists("prismacloudcompute_policies_runtime_Host.test", &o), + testAccCheckPolicyRuntimeHostAttributes(&o), ), }, { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeHostConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeHostExists("prismacloudcompute_policies_runtime_Host.test", &o), + testAccCheckPolicyRuntimeHostAttributes(&o), ), }, }, }) } -func TestPolicyRuntimeHostNetwork(t *testing.T) { - var o policy.Policy +func TestAccPolicyRuntimeHostNetwork(t *testing.T) { + var o policy.RuntimeHostPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyDestroy, + CheckDestroy: testAccPolicyRuntimeHostDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeHostConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeHostExists("prismacloudcompute_policies_runtime_Host.test", &o), + testAccCheckPolicyRuntimeHostAttributes(&o), ), }, { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeHostConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeHostExists("prismacloudcompute_policies_runtime_Host.test", &o), + testAccCheckPolicyRuntimeHostAttributes(&o), ), }, }, }) } -func TestPolicyRuntimeHostAuditEvent(t *testing.T) { - var o policy.Policy +func TestAccPolicyRuntimeHostAuditEvent(t *testing.T) { + var o policy.RuntimeHostPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyDestroy, + CheckDestroy: testAccPolicyRuntimeHostDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeHostConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeHostExists("prismacloudcompute_policies_runtime_Host.test", &o), + testAccCheckPolicyRuntimeHostAttributes(&o), ), }, { - Config: testAccPolicyConfig(id), + Config: testAccPolicyRuntimeHostConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyExists("prismacloudcompute_policies_runtime_container.test", &o), - testAccCheckPolicyAttributes(&o, id, true), + testAccCheckPolicyRuntimeHostExists("prismacloudcompute_policies_runtime_Host.test", &o), + testAccCheckPolicyRuntimeHostAttributes(&o), ), }, }, }) } -// func testPolicyRuntimeHostExists(n string, o *policy.Policy) resource.TestCheckFunc { -// return func(s *terraform.State) error { -// // return fmt.Errorf("What is the name: %s", o.PolicyId) - -// rs, ok := s.RootModule().Resources[n] -// if !ok { -// return fmt.Errorf("Resource not found: %s", n) -// } - -// if rs.Primary.ID == "" { -// return fmt.Errorf("Object label Id is not set") -// } - -// client := testAccProvider.Meta().(*api.Client) -// lo, err := policy.Get(*client, policy.RuntimeHostEndpoint) -// if err != nil { -// return fmt.Errorf("Error in get: %s", err) -// } -// *o = lo - -// return nil -// } -// } - -// func testPolicyRuntimeHostAttributes(o *policy.Policy, id string, learningDisabled bool) resource.TestCheckFunc { -// return func(s *terraform.State) error { -// if o.PolicyId != id { -// return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) -// } else { -// fmt.Printf("\n\nName is %s", o.PolicyId) -// } - -// if o.LearningDisabled != learningDisabled { -// return fmt.Errorf("LearningDisabled is %t, expected %t", o.LearningDisabled, learningDisabled) -// } - -// return nil -// } -// } - -// func testPolicyRuntimeHostDestroy(s *terraform.State) error { -// /* client := testAccProvider.Meta().(*api.Client) - -// for _, rs := range s.RootModule().Resources { - -// if rs.Type != "prismacloudcompute_policyruntimehost" { -// continue -// } - -// if rs.Primary.ID != "" { -// name := rs.Primary.ID -// if err := policy.Delete(client, name); err == nil { -// return fmt.Errorf("Object %q still exists", name) -// } -// } -// return nil -// } -// */ -// return nil -// } - -// func testPolicyRuntimeHostConfig(id string) string { -// var buf bytes.Buffer -// buf.Grow(500) - -// buf.WriteString(fmt.Sprintf(` -// resource "prismacloudcompute_policyRuntimeHost" "test" { -// name = %q -// }`, id)) - -// return buf.String() -// } +func testAccCheckPolicyRuntimeHostExists(n string, o *policy.RuntimeHostPolicy) resource.TestCheckFunc { + return func(s *terraform.State) error { + // return fmt.Errorf("What is the name: %s", o.PolicyId) + + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Resource not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Object label Id is not set") + } + + client := testAccProvider.Meta().(*api.Client) + lo, err := policy.GetRuntimeHost(*client) + if err != nil { + return fmt.Errorf("Error in get: %s", err) + } + *o = lo + + return nil + } +} + +func testAccCheckPolicyRuntimeHostAttributes(o *policy.RuntimeHostPolicy) resource.TestCheckFunc { + return func(s *terraform.State) error { + return nil + } +} + +func testAccPolicyRuntimeHostDestroy(s *terraform.State) error { + /* client := testAccProvider.Meta().(*api.Client) + + for _, rs := range s.RootModule().Resources { + + if rs.Type != "prismacloudcompute_policyruntimeHost" { + continue + } + + if rs.Primary.ID != "" { + name := rs.Primary.ID + if err := policy.Delete(client, name); err == nil { + return fmt.Errorf("Object %q still exists", name) + } + } + return nil + } + */ + return nil +} + +func testAccPolicyRuntimeHostConfig(id string) string { + var buf bytes.Buffer + buf.Grow(500) + + buf.WriteString(fmt.Sprintf(` +resource "prismacloudcompute_policyRuntimeHost" "test" { + name = %q +}`, id)) + + return buf.String() +} diff --git a/internal/provider/resource_policies_vulnerability_ci_coderepo_test.go b/internal/provider/resource_policies_vulnerability_ci_coderepo_test.go index 2b983b7a..fd15d967 100644 --- a/internal/provider/resource_policies_vulnerability_ci_coderepo_test.go +++ b/internal/provider/resource_policies_vulnerability_ci_coderepo_test.go @@ -13,89 +13,89 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccPolicyVulnerabilityCiCoderepoConfig(t *testing.T) { - fmt.Printf("\n\nStart TestAccPolicyVulnerabilityCiCoderepoConfig") - var o policy.Policy +func TestAccPolicyVulnerabilityCICoderepoConfig(t *testing.T) { + fmt.Printf("\n\nStart TestAccPolicyVulnerabilityCICoderepoConfig") + var o policy.VulnerabilityCoderepoPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyVulnerabilityCiCoderepoDestroy, + CheckDestroy: testAccPolicyVulnerabilityCICoderepoDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyVulnerabilityCiCoderepoConfig(id), + Config: testAccPolicyVulnerabilityCICoderepoConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCICoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), + testAccCheckPolicyVulnerabilityCICoderepoAttributes(&o, "network"), ), }, { - Config: testAccPolicyVulnerabilityCiCoderepoConfig(id), + Config: testAccPolicyVulnerabilityCICoderepoConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCICoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), + testAccCheckPolicyVulnerabilityCICoderepoAttributes(&o, "network"), ), }, }, }) } -func TestAccPolicyVulnerabilityCiCoderepoNetwork(t *testing.T) { - var o policy.Policy +func TestAccPolicyVulnerabilityCICoderepoNetwork(t *testing.T) { + var o policy.VulnerabilityCoderepoPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyVulnerabilityCiCoderepoDestroy, + CheckDestroy: testAccPolicyVulnerabilityCICoderepoDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyVulnerabilityCiCoderepoConfig(id), + Config: testAccPolicyVulnerabilityCICoderepoConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCICoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), + testAccCheckPolicyVulnerabilityCICoderepoAttributes(&o, "network"), ), }, { - Config: testAccPolicyVulnerabilityCiCoderepoConfig(id), + Config: testAccPolicyVulnerabilityCICoderepoConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCICoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), + testAccCheckPolicyVulnerabilityCICoderepoAttributes(&o, "network"), ), }, }, }) } -func TestAccPolicyVulnerabilityCiCoderepoAuditEvent(t *testing.T) { - var o policy.Policy +func TestAccPolicyVulnerabilityCICoderepoAuditEvent(t *testing.T) { + var o policy.VulnerabilityCoderepoPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyVulnerabilityCiCoderepoDestroy, + CheckDestroy: testAccPolicyVulnerabilityCICoderepoDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyVulnerabilityCiCoderepoConfig(id), + Config: testAccPolicyVulnerabilityCICoderepoConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCICoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), + testAccCheckPolicyVulnerabilityCICoderepoAttributes(&o, "network"), ), }, { - Config: testAccPolicyVulnerabilityCiCoderepoConfig(id), + Config: testAccPolicyVulnerabilityCICoderepoConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCiCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCICoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), + testAccCheckPolicyVulnerabilityCICoderepoAttributes(&o, "network"), ), }, }, }) } -func testAccCheckPolicyVulnerabilityCiCoderepoExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityCICoderepoExists(n string, o *policy.VulnerabilityCoderepoPolicy) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,7 +109,7 @@ func testAccCheckPolicyVulnerabilityCiCoderepoExists(n string, o *policy.Policy) } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.VulnerabilityCiCodereposEndpoint) + lo, err := policy.GetVulnerabilityCoderepo(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -119,28 +119,22 @@ func testAccCheckPolicyVulnerabilityCiCoderepoExists(n string, o *policy.Policy) } } -func testAccCheckPolicyVulnerabilityCiCoderepoAttributes(o *policy.Policy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityCICoderepoAttributes(o *policy.VulnerabilityCoderepoPolicy, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) - } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - - if o.PolicyType != policyType { - return fmt.Errorf("PolicyType is %s, expected %s", o.PolicyType, policyType) + if o.Type != policyType { + return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } return nil } } -func testAccPolicyVulnerabilityCiCoderepoDestroy(s *terraform.State) error { +func testAccPolicyVulnerabilityCICoderepoDestroy(s *terraform.State) error { /* client := testAccProvider.Meta().(*api.Client) for _, rs := range s.RootModule().Resources { - if rs.Type != "prismacloudcompute_policyvulnerabilitycicodrepo" { + if rs.Type != "prismacloudcompute_policyVulnerabilityCICoderepo" { continue } @@ -156,12 +150,12 @@ func testAccPolicyVulnerabilityCiCoderepoDestroy(s *terraform.State) error { return nil } -func testAccPolicyVulnerabilityCiCoderepoConfig(id string) string { +func testAccPolicyVulnerabilityCICoderepoConfig(id string) string { var buf bytes.Buffer buf.Grow(500) buf.WriteString(fmt.Sprintf(` -resource "prismacloudcompute_policyVulnerabilityCiCoderepo" "test" { +resource "prismacloudcompute_policyVulnerabilityCICoderepo" "test" { name = %q }`, id)) diff --git a/internal/provider/resource_policies_vulnerability_ci_images_test.go b/internal/provider/resource_policies_vulnerability_ci_images_test.go index 45f575a2..b54f11a1 100644 --- a/internal/provider/resource_policies_vulnerability_ci_images_test.go +++ b/internal/provider/resource_policies_vulnerability_ci_images_test.go @@ -13,89 +13,89 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccPolicyVulnerabilityCiImagesConfig(t *testing.T) { - fmt.Printf("\n\nStart TestAccPolicyVulnerabilityCiImagesConfig") - var o policy.Policy +func TestAccPolicyVulnerabilityCIImagesConfig(t *testing.T) { + fmt.Printf("\n\nStart TestAccPolicyVulnerabilityCIImagesConfig") + var o policy.VulnerabilityImagePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyVulnerabilityCiImagesDestroy, + CheckDestroy: testAccPolicyVulnerabilityCIImagesDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyVulnerabilityCiImagesConfig(id), + Config: testAccPolicyVulnerabilityCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCIImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), + testAccCheckPolicyVulnerabilityCIImagesAttributes(&o, "network"), ), }, { - Config: testAccPolicyVulnerabilityCiImagesConfig(id), + Config: testAccPolicyVulnerabilityCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCIImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), + testAccCheckPolicyVulnerabilityCIImagesAttributes(&o, "network"), ), }, }, }) } -func TestAccPolicyVulnerabilityCiImagesNetwork(t *testing.T) { - var o policy.Policy +func TestAccPolicyVulnerabilityCIImagesNetwork(t *testing.T) { + var o policy.VulnerabilityImagePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyVulnerabilityCiImagesDestroy, + CheckDestroy: testAccPolicyVulnerabilityCIImagesDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyVulnerabilityCiImagesConfig(id), + Config: testAccPolicyVulnerabilityCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCIImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), + testAccCheckPolicyVulnerabilityCIImagesAttributes(&o, "network"), ), }, { - Config: testAccPolicyVulnerabilityCiImagesConfig(id), + Config: testAccPolicyVulnerabilityCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCIImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), + testAccCheckPolicyVulnerabilityCIImagesAttributes(&o, "network"), ), }, }, }) } -func TestAccPolicyVulnerabilityCiImagesAuditEvent(t *testing.T) { - var o policy.Policy +func TestAccPolicyVulnerabilityCIImagesAuditEvent(t *testing.T) { + var o policy.VulnerabilityImagePolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccPolicyVulnerabilityCiImagesDestroy, + CheckDestroy: testAccPolicyVulnerabilityCIImagesDestroy, Steps: []resource.TestStep{ { - Config: testAccPolicyVulnerabilityCiImagesConfig(id), + Config: testAccPolicyVulnerabilityCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCIImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), + testAccCheckPolicyVulnerabilityCIImagesAttributes(&o, "network"), ), }, { - Config: testAccPolicyVulnerabilityCiImagesConfig(id), + Config: testAccPolicyVulnerabilityCIImagesConfig(id), Check: resource.ComposeTestCheckFunc( - testAccCheckPolicyVulnerabilityCiImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityCiImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCIImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), + testAccCheckPolicyVulnerabilityCIImagesAttributes(&o, "network"), ), }, }, }) } -func testAccCheckPolicyVulnerabilityCiImagesExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityCIImagesExists(n string, o *policy.VulnerabilityImagePolicy) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,7 +109,7 @@ func testAccCheckPolicyVulnerabilityCiImagesExists(n string, o *policy.Policy) r } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.VulnerabilityCiImagesEndpoint) + lo, err := policy.GetVulnerabilityImage(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -119,49 +119,42 @@ func testAccCheckPolicyVulnerabilityCiImagesExists(n string, o *policy.Policy) r } } -func testAccCheckPolicyVulnerabilityCiImagesAttributes(o *policy.Policy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityCIImagesAttributes(o *policy.VulnerabilityImagePolicy, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) - } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - - if o.PolicyType != policyType { - return fmt.Errorf("PolicyType is %s, expected %s", o.PolicyType, policyType) + if o.Type != policyType { + return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } return nil } } -func testAccPolicyVulnerabilityCiImagesDestroy(s *terraform.State) error { - /* client := testAccProvider.Meta().(*api.Client) +func testAccPolicyVulnerabilityCIImagesDestroy(s *terraform.State) error { + // client := testAccProvider.Meta().(*api.Client) - for _, rs := range s.RootModule().Resources { + // for _, rs := range s.RootModule().Resources { - if rs.Type != "prismacloudcompute_policyvulnerabilityciimages" { - continue - } + // if rs.Type != "prismacloudcompute_policyVulnerabilityCIImages" { + // continue + // } - if rs.Primary.ID != "" { - name := rs.Primary.ID - if err := policy.Delete(client, name); err == nil { - return fmt.Errorf("Object %q still exists", name) - } - } - return nil - } - */ + // if rs.Primary.ID != "" { + // name := rs.Primary.ID + // if err := policy.(client, name); err == nil { + // return fmt.Errorf("Object %q still exists", name) + // } + // } + // return nil + // } return nil } -func testAccPolicyVulnerabilityCiImagesConfig(id string) string { +func testAccPolicyVulnerabilityCIImagesConfig(id string) string { var buf bytes.Buffer buf.Grow(500) buf.WriteString(fmt.Sprintf(` -resource "prismacloudcompute_policyVulnerabilityCiImages" "test" { +resource "prismacloudcompute_policyVulnerabilityCIImages" "test" { name = %q }`, id)) diff --git a/internal/provider/resource_policies_vulnerability_coderepo_test.go b/internal/provider/resource_policies_vulnerability_coderepo_test.go index 1612d54e..98a2ef51 100644 --- a/internal/provider/resource_policies_vulnerability_coderepo_test.go +++ b/internal/provider/resource_policies_vulnerability_coderepo_test.go @@ -27,14 +27,14 @@ func TestAccPolicyVulnerabilityCoderepoConfig(t *testing.T) { Config: testAccPolicyVulnerabilityCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, "network"), ), }, }, @@ -54,14 +54,14 @@ func TestAccPolicyVulnerabilityCoderepoNetwork(t *testing.T) { Config: testAccPolicyVulnerabilityCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, "network"), ), }, }, @@ -81,14 +81,14 @@ func TestAccPolicyVulnerabilityCoderepoAuditEvent(t *testing.T) { Config: testAccPolicyVulnerabilityCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityCoderepoConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityCoderepoExists("prismacloudcompute_policies_vulnerability_coderepo.test", &o), - testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityCoderepoAttributes(&o, "network"), ), }, }, @@ -119,14 +119,8 @@ func testAccCheckPolicyVulnerabilityCoderepoExists(n string, o *policy.Vulnerabi } } -func testAccCheckPolicyVulnerabilityCoderepoAttributes(o *policy.VulnerabilityCoderepoPolicy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityCoderepoAttributes(o *policy.VulnerabilityCoderepoPolicy, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.Id != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.Id, id) - } else { - fmt.Printf("\n\nName is %s", o.Id) - } - if o.Type != policyType { return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } diff --git a/internal/provider/resource_policies_vulnerability_host_test.go b/internal/provider/resource_policies_vulnerability_host_test.go index b13e966a..e977b898 100644 --- a/internal/provider/resource_policies_vulnerability_host_test.go +++ b/internal/provider/resource_policies_vulnerability_host_test.go @@ -15,7 +15,7 @@ import ( func TestAccPolicyVulnerabilityHostConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccPolicyVulnerabilityHostConfig") - var o policy.Policy + var o policy.VulnerabilityHostPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -27,14 +27,14 @@ func TestAccPolicyVulnerabilityHostConfig(t *testing.T) { Config: testAccPolicyVulnerabilityHostConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityHostExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityHostAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityHostAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityHostConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityHostExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityHostAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityHostAttributes(&o, "network"), ), }, }, @@ -42,7 +42,7 @@ func TestAccPolicyVulnerabilityHostConfig(t *testing.T) { } func TestAccPolicyVulnerabilityHostNetwork(t *testing.T) { - var o policy.Policy + var o policy.VulnerabilityHostPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -54,14 +54,14 @@ func TestAccPolicyVulnerabilityHostNetwork(t *testing.T) { Config: testAccPolicyVulnerabilityHostConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityHostExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityHostAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityHostAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityHostConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityHostExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityHostAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityHostAttributes(&o, "network"), ), }, }, @@ -69,7 +69,7 @@ func TestAccPolicyVulnerabilityHostNetwork(t *testing.T) { } func TestAccPolicyVulnerabilityHostAuditEvent(t *testing.T) { - var o policy.Policy + var o policy.VulnerabilityHostPolicy id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -81,21 +81,21 @@ func TestAccPolicyVulnerabilityHostAuditEvent(t *testing.T) { Config: testAccPolicyVulnerabilityHostConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityHostExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityHostAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityHostAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityHostConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityHostExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityHostAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityHostAttributes(&o, "network"), ), }, }, }) } -func testAccCheckPolicyVulnerabilityHostExists(n string, o *policy.Policy) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityHostExists(n string, o *policy.VulnerabilityHostPolicy) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.PolicyId) @@ -109,7 +109,7 @@ func testAccCheckPolicyVulnerabilityHostExists(n string, o *policy.Policy) resou } client := testAccProvider.Meta().(*api.Client) - lo, err := policy.Get(*client, policy.VulnerabilityHostEndpoint) + lo, err := policy.GetVulnerabilityHost(*client) if err != nil { return fmt.Errorf("Error in get: %s", err) } @@ -119,16 +119,10 @@ func testAccCheckPolicyVulnerabilityHostExists(n string, o *policy.Policy) resou } } -func testAccCheckPolicyVulnerabilityHostAttributes(o *policy.Policy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityHostAttributes(o *policy.VulnerabilityHostPolicy, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.PolicyId != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.PolicyId, id) - } else { - fmt.Printf("\n\nName is %s", o.PolicyId) - } - - if o.PolicyType != policyType { - return fmt.Errorf("PolicyType is %s, expected %s", o.PolicyType, policyType) + if o.Type != policyType { + return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } return nil diff --git a/internal/provider/resource_policies_vulnerability_images_test.go b/internal/provider/resource_policies_vulnerability_images_test.go index cf38f6b5..b0e5461e 100644 --- a/internal/provider/resource_policies_vulnerability_images_test.go +++ b/internal/provider/resource_policies_vulnerability_images_test.go @@ -27,14 +27,14 @@ func TestAccPolicyVulnerabilityImagesConfig(t *testing.T) { Config: testAccPolicyVulnerabilityImagesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityImagesAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityImagesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityImagesAttributes(&o, "network"), ), }, }, @@ -54,14 +54,14 @@ func TestAccPolicyVulnerabilityImagesNetwork(t *testing.T) { Config: testAccPolicyVulnerabilityImagesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityImagesAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityImagesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityImagesAttributes(&o, "network"), ), }, }, @@ -81,14 +81,14 @@ func TestAccPolicyVulnerabilityImagesAuditEvent(t *testing.T) { Config: testAccPolicyVulnerabilityImagesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityImagesAttributes(&o, "network"), ), }, { Config: testAccPolicyVulnerabilityImagesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckPolicyVulnerabilityImagesExists("prismacloudcompute_policies_vulnerability_images.test", &o), - testAccCheckPolicyVulnerabilityImagesAttributes(&o, id, "network"), + testAccCheckPolicyVulnerabilityImagesAttributes(&o, "network"), ), }, }, @@ -119,14 +119,8 @@ func testAccCheckPolicyVulnerabilityImagesExists(n string, o *policy.Vulnerabili } } -func testAccCheckPolicyVulnerabilityImagesAttributes(o *policy.VulnerabilityImagePolicy, id string, policyType string) resource.TestCheckFunc { +func testAccCheckPolicyVulnerabilityImagesAttributes(o *policy.VulnerabilityImagePolicy, policyType string) resource.TestCheckFunc { return func(s *terraform.State) error { - if o.Id != id { - return fmt.Errorf("\n\nPolicyId is %s, expected %s", o.Id, id) - } else { - fmt.Printf("\n\nName is %s", o.Id) - } - if o.Type != policyType { return fmt.Errorf("PolicyType is %s, expected %s", o.Type, policyType) } @@ -136,23 +130,22 @@ func testAccCheckPolicyVulnerabilityImagesAttributes(o *policy.VulnerabilityImag } func testAccPolicyVulnerabilityImagesDestroy(s *terraform.State) error { - /* client := testAccProvider.Meta().(*api.Client) - - for _, rs := range s.RootModule().Resources { - - if rs.Type != "prismacloudcompute_policyvulnerabilityimages" { - continue - } - - if rs.Primary.ID != "" { - name := rs.Primary.ID - if err := policy.Delete(client, name); err == nil { - return fmt.Errorf("Object %q still exists", name) - } - } - return nil - } - */ + // client := testAccProvider.Meta().(*api.Client) + + // for _, rs := range s.RootModule().Resources { + + // if rs.Type != "prismacloudcompute_policyvulnerabilityimages" { + // continue + // } + + // if rs.Primary.ID != "" { + // name := rs.Primary.ID + // if err := policy.(client, name); err == nil { + // return fmt.Errorf("Object %q still exists", name) + // } + // } + // return nil + // } return nil } diff --git a/internal/provider/resource_rbac_roles_test.go b/internal/provider/resource_rbac_roles_test.go index 991f8c67..01cddb4c 100644 --- a/internal/provider/resource_rbac_roles_test.go +++ b/internal/provider/resource_rbac_roles_test.go @@ -1,10 +1,12 @@ package provider import ( + "bytes" "fmt" "testing" "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/auth" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -12,7 +14,7 @@ import ( func TestRbacRolesConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccRbacRolesConfig") - var o group.Group + var o auth.Role id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -24,14 +26,14 @@ func TestRbacRolesConfig(t *testing.T) { Config: testAccRbacRolesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckRbacRolesExists("prismacloudcompute_rbac_roles.test", &o), - testAccCheckRbacRolesAttributes(&o, id, true), + testAccCheckRbacRolesAttributes(&o, id, "plop"), ), }, { Config: testAccRbacRolesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckRbacRolesExists("prismacloudcompute_rbac_roles.test", &o), - testAccCheckRbacRolesAttributes(&o, id, true), + testAccCheckRbacRolesAttributes(&o, id, "plop"), ), }, }, @@ -39,7 +41,7 @@ func TestRbacRolesConfig(t *testing.T) { } func TestRbacRolesNetwork(t *testing.T) { - var o group.Group + var o auth.Role id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -51,14 +53,14 @@ func TestRbacRolesNetwork(t *testing.T) { Config: testAccRbacRolesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckRbacRolesExists("prismacloudcompute_rbac_roles.test", &o), - testAccCheckRbacRolesAttributes(&o, id, true), + testAccCheckRbacRolesAttributes(&o, id, "plop"), ), }, { Config: testAccRbacRolesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckRbacRolesExists("prismacloudcompute_rbac_roles.test", &o), - testAccCheckRbacRolesAttributes(&o, id, true), + testAccCheckRbacRolesAttributes(&o, id, "plop"), ), }, }, @@ -66,7 +68,7 @@ func TestRbacRolesNetwork(t *testing.T) { } func TestRbacRolesAuditEvent(t *testing.T) { - var o group.Group + var o auth.Role id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -78,21 +80,21 @@ func TestRbacRolesAuditEvent(t *testing.T) { Config: testAccRbacRolesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckRbacRolesExists("prismacloudcompute_rbac_roles.test", &o), - testAccCheckRbacRolesAttributes(&o, id, true), + testAccCheckRbacRolesAttributes(&o, id, "plop"), ), }, { Config: testAccRbacRolesConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckRbacRolesExists("prismacloudcompute_rbac_roles.test", &o), - testAccCheckRbacRolesAttributes(&o, id, true), + testAccCheckRbacRolesAttributes(&o, id, "plop"), ), }, }, }) } -func testRbacRolesExists(n string, o *group.Group) resource.TestCheckFunc { +func testAccCheckRbacRolesExists(n string, o *auth.Role) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.GroupId) @@ -106,61 +108,61 @@ func testRbacRolesExists(n string, o *group.Group) resource.TestCheckFunc { } client := testAccProvider.Meta().(*api.Client) - lo, err := RbacRoles.Get(*client) + id := rs.Primary.ID + lo, err := auth.GetRole(*client, id) if err != nil { return fmt.Errorf("Error in get: %s", err) } - *o = lo + o = lo return nil } } -// func testRbacRolesAttributes(o *group.Group, id string, learningDisabled bool) resource.TestCheckFunc { -// return func(s *terraform.State) error { -// if o.GroupId != id { -// return fmt.Errorf("\n\nGroupId is %s, expected %s", o.GroupId, id) -// } else { -// fmt.Printf("\n\nName is %s", o.GroupId) -// } - -// if o.LearningDisabled != learningDisabled { -// return fmt.Errorf("LearningDisabled is %t, expected %t", o.LearningDisabled, learningDisabled) -// } - -// return nil -// } -// } - -// func testRbacRolesDestroy(s *terraform.State) error { -// /* client := testAccProvider.Meta().(*api.Client) - -// for _, rs := range s.RootModule().Resources { - -// if rs.Type != "prismacloudcompute_rbac_roles" { -// continue -// } - -// if rs.Primary.ID != "" { -// name := rs.Primary.ID -// if err := group.Delete(client, name); err == nil { -// return fmt.Errorf("Object %q still exists", name) -// } -// } -// return nil -// } -// */ -// return nil -// } - -// func testRbacRolesConfig(id string) string { -// var buf bytes.Buffer -// buf.Grow(500) - -// buf.WriteString(fmt.Sprintf(` -// resource "prismacloudcompute_rbac_roles" "test" { -// name = %q -// }`, id)) - -// return buf.String() -// } +func testAccCheckRbacRolesAttributes(o *auth.Role, name, description string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if o.Name != name { + return fmt.Errorf("\n\nRole name is %s, expected %s", o.Name, name) + } else { + fmt.Printf("\n\nName is %s", o.Name) + } + + if o.Description != description { + return fmt.Errorf("Description is %s, expected %s", o.Description, description) + } + + return nil + } +} + +func testAccRbacRolesDestroy(s *terraform.State) error { + client := testAccProvider.Meta().(*api.Client) + + for _, rs := range s.RootModule().Resources { + + if rs.Type != "prismacloudcompute_rbac_roles" { + continue + } + + if rs.Primary.ID != "" { + name := rs.Primary.ID + if err := auth.DeleteRole(*client, name); err == nil { + return fmt.Errorf("Object %q still exists", name) + } + } + return nil + } + return nil +} + +func testAccRbacRolesConfig(id string) string { + var buf bytes.Buffer + buf.Grow(500) + + buf.WriteString(fmt.Sprintf(` +resource "prismacloudcompute_rbac_roles" "test" { + name = %q +}`, id)) + + return buf.String() +} diff --git a/internal/provider/resource_users_test.go b/internal/provider/resource_users_test.go index da78dab7..5d50033d 100644 --- a/internal/provider/resource_users_test.go +++ b/internal/provider/resource_users_test.go @@ -1,11 +1,12 @@ package provider import ( + "bytes" "fmt" - "os/user" "testing" "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api" + "github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/internal/api/auth" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -13,7 +14,7 @@ import ( func TestUsersConfig(t *testing.T) { fmt.Printf("\n\nStart TestAccUserConfig") - var o user.User + var o auth.User id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -25,14 +26,14 @@ func TestUsersConfig(t *testing.T) { Config: testAccUserConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckUserExists("prismacloudcompute_users.test", &o), - testAccCheckUserAttributes(&o, id, true), + testAccCheckUserAttributes(&o, id, "sysadmin"), ), }, { Config: testAccUserConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckUserExists("prismacloudcompute_users.test", &o), - testAccCheckUserAttributes(&o, id, true), + testAccCheckUserAttributes(&o, id, "sysadmin"), ), }, }, @@ -40,7 +41,7 @@ func TestUsersConfig(t *testing.T) { } func TestUsersNetwork(t *testing.T) { - var o user.User + var o auth.User id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -52,14 +53,14 @@ func TestUsersNetwork(t *testing.T) { Config: testAccUserConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckUserExists("prismacloudcompute_users.test", &o), - testAccCheckUserAttributes(&o, id, true), + testAccCheckUserAttributes(&o, id, "sysadmin"), ), }, { Config: testAccUserConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckUserExists("prismacloudcompute_users.test", &o), - testAccCheckUserAttributes(&o, id, true), + testAccCheckUserAttributes(&o, id, "sysadmin"), ), }, }, @@ -67,7 +68,7 @@ func TestUsersNetwork(t *testing.T) { } func TestUsersAuditEvent(t *testing.T) { - var o user.User + var o auth.User id := fmt.Sprintf("tf%s", acctest.RandString(6)) resource.Test(t, resource.TestCase{ @@ -79,21 +80,21 @@ func TestUsersAuditEvent(t *testing.T) { Config: testAccUserConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckUserExists("prismacloudcompute_users.test", &o), - testAccCheckUserAttributes(&o, id, true), + testAccCheckUserAttributes(&o, id, "sysadmin"), ), }, { Config: testAccUserConfig(id), Check: resource.ComposeTestCheckFunc( testAccCheckUserExists("prismacloudcompute_users.test", &o), - testAccCheckUserAttributes(&o, id, true), + testAccCheckUserAttributes(&o, id, "sysadmin"), ), }, }, }) } -func testUsersExists(n string, o *user.User) resource.TestCheckFunc { +func testAccCheckUserExists(n string, o *auth.User) resource.TestCheckFunc { return func(s *terraform.State) error { // return fmt.Errorf("What is the name: %s", o.UserId) @@ -107,61 +108,62 @@ func testUsersExists(n string, o *user.User) resource.TestCheckFunc { } client := testAccProvider.Meta().(*api.Client) - lo, err := users.Get(*client) + id := rs.Primary.ID + lo, err := auth.GetUser(*client, id) if err != nil { return fmt.Errorf("Error in get: %s", err) } - *o = lo + o = lo return nil } } -// func testUsersAttributes(o *user.User, id string, learningDisabled bool) resource.TestCheckFunc { -// return func(s *terraform.State) error { -// if o.UserId != id { -// return fmt.Errorf("\n\nUserId is %s, expected %s", o.UserId, id) -// } else { -// fmt.Printf("\n\nName is %s", o.UserId) -// } - -// if o.LearningDisabled != learningDisabled { -// return fmt.Errorf("LearningDisabled is %t, expected %t", o.LearningDisabled, learningDisabled) -// } - -// return nil -// } -// } - -// func testUsersDestroy(s *terraform.State) error { -// /* client := testAccProvider.Meta().(*api.Client) - -// for _, rs := range s.RootModule().Resources { - -// if rs.Type != "prismacloudcompute_users" { -// continue -// } - -// if rs.Primary.ID != "" { -// name := rs.Primary.ID -// if err := user.Delete(client, name); err == nil { -// return fmt.Errorf("Object %q still exists", name) -// } -// } -// return nil -// } -// */ -// return nil -// } - -// func testUsersConfig(id string) string { -// var buf bytes.Buffer -// buf.Grow(500) - -// buf.WriteString(fmt.Sprintf(` -// resource "prismacloudcompute_users" "test" { -// name = %q -// }`, id)) - -// return buf.String() -// } +func testAccCheckUserAttributes(o *auth.User, name, role string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if o.Username != name { + return fmt.Errorf("\n\nUsername is %s, expected %s", o.Username, name) + } else { + fmt.Printf("\n\nName is %s", o.Username) + } + + if o.Role != role { + return fmt.Errorf("Role is %s, expected %s", o.Role, role) + } + + return nil + } +} + +func testAccUserDestroy(s *terraform.State) error { + client := testAccProvider.Meta().(*api.Client) + + for _, rs := range s.RootModule().Resources { + + if rs.Type != "prismacloudcompute_users" { + continue + } + + if rs.Primary.ID != "" { + name := rs.Primary.ID + if err := auth.DeleteUser(*client, name); err == nil { + return fmt.Errorf("Object %q still exists", name) + } + } + return nil + } + return nil +} + +func testAccUserConfig(id string) string { + var buf bytes.Buffer + buf.Grow(500) + + buf.WriteString(fmt.Sprintf(` +resource "prismacloudcompute_users" "test" { + Username = %q + +}`, id)) + + return buf.String() +}