From fe490dfda9393bb54bb58130be6d7d13fa0f790c Mon Sep 17 00:00:00 2001 From: idimov-keeper <78815270+idimov-keeper@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:33:07 -0500 Subject: [PATCH 1/3] KSM-522 Fixed error when shortcuts present (#26) --- secretsmanager/provider.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/secretsmanager/provider.go b/secretsmanager/provider.go index ff8a233..3544edf 100644 --- a/secretsmanager/provider.go +++ b/secretsmanager/provider.go @@ -708,7 +708,7 @@ func getRecord(path string, title string, client core.SecretsManager) (secret *c return nil, fmt.Errorf("record not found - title: %s", title) } return secret, nil - } else { + } else { // find by UID secrets, err := client.GetSecrets([]string{path}) if err != nil { return nil, err @@ -717,7 +717,18 @@ func getRecord(path string, title string, client core.SecretsManager) (secret *c return nil, fmt.Errorf("record not found - UID: %s", path) } if len(secrets) > 1 { - return nil, fmt.Errorf("expected 1 record - found %d records for UID: %s", len(secrets), path) + // linked records a.k.a. shortcuts: + // vault does not allow duplicate UIDs but we can get an UID multiple times + // if the record is linked across multiple shared folders all shared to the same KSM App + dupes := 0 + for i := range secrets { + if secrets[0].Uid == secrets[i].Uid { + dupes++ + } + } + if len(secrets) != dupes { + return nil, fmt.Errorf("expected 1 record - found %d records for UID: %s", len(secrets), path) + } } return secrets[0], nil } From 1f699f191cc886c2fc8318a1f736777232bee5fa Mon Sep 17 00:00:00 2001 From: idimov-keeper <78815270+idimov-keeper@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:52:39 -0500 Subject: [PATCH 2/3] KSM-523 Updated dependencies (#28) --- go.mod | 68 +++++++------- go.sum | 277 +++++++++++++++++++++++++-------------------------------- 2 files changed, 158 insertions(+), 187 deletions(-) diff --git a/go.mod b/go.mod index 39d464f..8e3ca9e 100644 --- a/go.mod +++ b/go.mod @@ -1,40 +1,43 @@ module github.com/keeper-security/terraform-provider-secretsmanager -go 1.18 +go 1.21 + +toolchain go1.22.1 require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 - github.com/keeper-security/secrets-manager-go/core v1.4.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 + github.com/keeper-security/secrets-manager-go/core v1.6.3 ) require ( + github.com/ProtonMail/go-crypto v1.1.0-alpha.3-proton // indirect github.com/agext/levenshtein v1.2.3 // indirect - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/cloudflare/circl v1.3.9 // indirect + github.com/fatih/color v1.17.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/go-cmp v0.6.0 // 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-hclog v1.4.0 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.8 // indirect + github.com/hashicorp/go-plugin v1.6.1 // 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.4.0 // indirect - github.com/hashicorp/hcl/v2 v2.15.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/hashicorp/hc-install v0.7.0 // indirect + github.com/hashicorp/hcl/v2 v2.21.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.17.3 // indirect - github.com/hashicorp/terraform-json v0.14.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.14.2 // indirect - github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect - github.com/hashicorp/terraform-registry-address v0.1.0 // indirect - github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/terraform-exec v0.21.0 // indirect + github.com/hashicorp/terraform-json v0.22.1 // indirect + github.com/hashicorp/terraform-plugin-go v0.23.0 // indirect + github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect + github.com/hashicorp/terraform-registry-address v0.2.3 // indirect + github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect @@ -42,15 +45,18 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect - github.com/vmihailenco/tagparser v0.1.2 // indirect - github.com/zclconf/go-cty v1.12.1 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.3 // indirect - google.golang.org/protobuf v1.30.0 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/zclconf/go-cty v1.14.4 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.22.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/go.sum b/go.sum index 8ef8eac..a3f37c6 100644 --- a/go.sum +++ b/go.sum @@ -1,131 +1,114 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -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= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -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= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/ProtonMail/go-crypto v1.1.0-alpha.3-proton h1:0RXAi0EJFs81j+MMsqvHNuAUGWzeVfCO9LnHAfoQ8NA= +github.com/ProtonMail/go-crypto v1.1.0-alpha.3-proton/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= 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-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= 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-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE= +github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= 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/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= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -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/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= +github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= 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/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/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-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= -github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-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.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= -github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI= +github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 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.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.4.0 h1:cZkRFr1WVa0Ty6x5fTvL1TuO1flul231rWkGH92oYYk= -github.com/hashicorp/hc-install v0.4.0/go.mod h1:5d155H8EC5ewegao9A4PUTMNPZaq+TbOzkJJZ4vrXeI= -github.com/hashicorp/hcl/v2 v2.15.0 h1:CPDXO6+uORPjKflkWCCwoWc9uRp+zSIPcCQ+BrxV7m8= -github.com/hashicorp/hcl/v2 v2.15.0/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC1659aBk= +github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= +github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= +github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= 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.17.3 h1:MX14Kvnka/oWGmIkyuyvL6POx25ZmKrjlaclkx3eErU= -github.com/hashicorp/terraform-exec v0.17.3/go.mod h1:+NELG0EqQekJzhvikkeQsOAZpsw0cv/03rbeQJqscAI= -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.14.2 h1:rhsVEOGCnY04msNymSvbUsXfRLKh9znXZmHlf5e8mhE= -github.com/hashicorp/terraform-plugin-go v0.14.2/go.mod h1:Q12UjumPNGiFsZffxOsA40Tlz1WVXt2Evh865Zj0+UA= -github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs= -github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/UnQVg7FhRCbj1i5b7vM= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1/go.mod h1:+tNlb0wkfdsDJ7JEiERLz4HzM19HyiuIoGzTsM7rPpw= -github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U= -github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A= -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/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= +github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= +github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= +github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= +github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/125t+AAurhqphJ2Co= +github.com/hashicorp/terraform-plugin-go v0.23.0/go.mod h1:1E3Cr9h2vMlahWMbsSEcNrOCxovCZhOOIXjFHbjc/lQ= +github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= +github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0/go.mod h1:sl/UoabMc37HA6ICVMmGO+/0wofkVIRxf+BMb/dnoIg= +github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= +github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= +github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= +github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/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= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -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/keeper-security/secrets-manager-go/core v1.4.0 h1:6x65lMBPwHNirQRXwGByCHrzJx7LDWt06uBUKCLs92w= -github.com/keeper-security/secrets-manager-go/core v1.4.0/go.mod h1:dtlaeeds9+SZsbDAZnQRsDSqEAK9a62SYtqhNql+VgQ= -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/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/keeper-security/secrets-manager-go/core v1.6.3 h1:XEHZ8fQ2DFBISK80jWdHmzT56PFqEkXSkakqZxTD8zI= +github.com/keeper-security/secrets-manager-go/core v1.6.3/go.mod h1:dtlaeeds9+SZsbDAZnQRsDSqEAK9a62SYtqhNql+VgQ= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/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.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 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 v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= @@ -134,114 +117,96 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua 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/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/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= 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/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= +github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= +github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= +github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/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.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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/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.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY= -github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= +github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -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.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/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-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-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/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-20201119102817-f84b799fce68/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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-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.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/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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.6.5/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-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d h1:k3zyW3BYYR30e8v3x0bTDdE9vpYFjZHK+HcyqkrppWk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= 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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 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/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.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -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= From c865e23ef5ca4e9ae4d906e8b470ed3b09931c66 Mon Sep 17 00:00:00 2001 From: idimov-keeper <78815270+idimov-keeper@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:53:42 -0500 Subject: [PATCH 3/3] KSM-525 Allow resources to work with subfolders (#29) --- docs/resources/address.md | 2 +- docs/resources/bank_account.md | 2 +- docs/resources/bank_card.md | 2 +- docs/resources/birth_certificate.md | 2 +- docs/resources/contact.md | 2 +- docs/resources/database_credentials.md | 2 +- docs/resources/driver_license.md | 2 +- docs/resources/encrypted_notes.md | 2 +- docs/resources/file.md | 2 +- docs/resources/health_insurance.md | 2 +- docs/resources/login.md | 2 +- docs/resources/membership.md | 2 +- docs/resources/passport.md | 2 +- docs/resources/photo.md | 2 +- docs/resources/server_credentials.md | 2 +- docs/resources/software_license.md | 2 +- docs/resources/ssh_keys.md | 2 +- docs/resources/ssn_card.md | 2 +- secretsmanager/provider.go | 90 ++++++++++++++++++- secretsmanager/resource_address.go | 12 ++- secretsmanager/resource_bank_account.go | 12 ++- secretsmanager/resource_bank_card.go | 12 ++- secretsmanager/resource_birth_certificate.go | 12 ++- secretsmanager/resource_contact.go | 12 ++- .../resource_database_credentials.go | 12 ++- secretsmanager/resource_driver_license.go | 12 ++- secretsmanager/resource_encrypted_notes.go | 12 ++- secretsmanager/resource_file.go | 12 ++- secretsmanager/resource_health_insurance.go | 12 ++- secretsmanager/resource_login.go | 12 ++- secretsmanager/resource_membership.go | 12 ++- secretsmanager/resource_passport.go | 12 ++- secretsmanager/resource_photo.go | 12 ++- secretsmanager/resource_server_credentials.go | 12 ++- secretsmanager/resource_software_license.go | 12 ++- secretsmanager/resource_ssh_keys.go | 12 ++- secretsmanager/resource_ssn_card.go | 12 ++- 37 files changed, 269 insertions(+), 73 deletions(-) diff --git a/docs/resources/address.md b/docs/resources/address.md index ae054f4..cfccbdd 100644 --- a/docs/resources/address.md +++ b/docs/resources/address.md @@ -8,7 +8,7 @@ Use this resource to access secrets of type `address` stored in Keeper Vault - **address** (Block List, Max: 1) Address field data. (see [below for nested schema](#nestedblock--address)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **notes** (String) The secret notes. - **title** (String) The secret title. - **uid** (String) The UID of the new secret (using RFC4648 URL and Filename Safe Alphabet). diff --git a/docs/resources/bank_account.md b/docs/resources/bank_account.md index 3e02e9c..d298c73 100644 --- a/docs/resources/bank_account.md +++ b/docs/resources/bank_account.md @@ -9,7 +9,7 @@ Use this resource to access secrets of type `bankAccount` stored in Keeper Vault - **bank_account** (Block List, Max: 1) Bank account field data. (see [below for nested schema](#nestedblock--bank_account)) - **card_ref** (Block List, Max: 1) CardRef field data. (see [below for nested schema](#nestedblock--card_ref)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **login** (Block List, Max: 1) Login field data. (see [below for nested schema](#nestedblock--login)) - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) diff --git a/docs/resources/bank_card.md b/docs/resources/bank_card.md index 8bb77af..ae6c5bd 100644 --- a/docs/resources/bank_card.md +++ b/docs/resources/bank_card.md @@ -9,7 +9,7 @@ Use this resource to access secrets of type `bankCard` stored in Keeper Vault - **address_ref** (Block List, Max: 1) AddressRef field data. (see [below for nested schema](#nestedblock--address_ref)) - **cardholder_name** (Block List, Max: 1) Text field data. (see [below for nested schema](#nestedblock--cardholder_name)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **notes** (String) The secret notes. - **payment_card** (Block List, Max: 1) Payment card field data. (see [below for nested schema](#nestedblock--payment_card)) diff --git a/docs/resources/birth_certificate.md b/docs/resources/birth_certificate.md index 49007c0..e28028e 100644 --- a/docs/resources/birth_certificate.md +++ b/docs/resources/birth_certificate.md @@ -8,7 +8,7 @@ Use this resource to access secrets of type `birthCertificate` stored in Keeper - **birth_date** (Block List, Max: 1) Birth date field data. (see [below for nested schema](#nestedblock--birth_date)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) - **notes** (String) The secret notes. diff --git a/docs/resources/contact.md b/docs/resources/contact.md index df9b571..8b81c42 100644 --- a/docs/resources/contact.md +++ b/docs/resources/contact.md @@ -10,7 +10,7 @@ Use this resource to access secrets of type `contact` stored in Keeper Vault - **company** (Block List, Max: 1) Text field data. (see [below for nested schema](#nestedblock--company)) - **email** (Block List, Max: 1) Email field data. (see [below for nested schema](#nestedblock--email)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) - **notes** (String) The secret notes. diff --git a/docs/resources/database_credentials.md b/docs/resources/database_credentials.md index fe6895f..b2dba28 100644 --- a/docs/resources/database_credentials.md +++ b/docs/resources/database_credentials.md @@ -8,7 +8,7 @@ Use this resource to access secrets of type `databaseCredentials` stored in Keep - **db_type** (Block List, Max: 1) Text field data. (see [below for nested schema](#nestedblock--db_type)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **host** (Block List, Max: 1) Host field data. (see [below for nested schema](#nestedblock--host)) - **id** (String) The ID of this resource. - **login** (Block List, Max: 1) Login field data. (see [below for nested schema](#nestedblock--login)) diff --git a/docs/resources/driver_license.md b/docs/resources/driver_license.md index 891901a..7ab184b 100644 --- a/docs/resources/driver_license.md +++ b/docs/resources/driver_license.md @@ -11,7 +11,7 @@ Use this resource to access secrets of type `driverLicense` stored in Keeper Vau - **driver_license_number** (Block List, Max: 1) Account number field data. (see [below for nested schema](#nestedblock--driver_license_number)) - **expiration_date** (Block List, Max: 1) Expiration date field data. (see [below for nested schema](#nestedblock--expiration_date)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) - **notes** (String) The secret notes. diff --git a/docs/resources/encrypted_notes.md b/docs/resources/encrypted_notes.md index 0e47481..4e7ea0d 100644 --- a/docs/resources/encrypted_notes.md +++ b/docs/resources/encrypted_notes.md @@ -8,7 +8,7 @@ Use this resource to access secrets of type `encryptedNotes` stored in Keeper Va - **date** (Block List, Max: 1) Date field data. (see [below for nested schema](#nestedblock--date)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **note** (Block List, Max: 1) Secure note field data. (see [below for nested schema](#nestedblock--note)) - **notes** (String) The secret notes. diff --git a/docs/resources/file.md b/docs/resources/file.md index 660c51f..5b77ac5 100644 --- a/docs/resources/file.md +++ b/docs/resources/file.md @@ -7,7 +7,7 @@ Use this resource to access secrets of type `file` stored in Keeper Vault ### Optional - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **notes** (String) The secret notes. - **title** (String) The secret title. diff --git a/docs/resources/health_insurance.md b/docs/resources/health_insurance.md index 480c797..f9f769e 100644 --- a/docs/resources/health_insurance.md +++ b/docs/resources/health_insurance.md @@ -8,7 +8,7 @@ Use this resource to access secrets of type `healthInsurance` stored in Keeper V - **account_number** (Block List, Max: 1) Account number field data. (see [below for nested schema](#nestedblock--account_number)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **login** (Block List, Max: 1) Login field data. (see [below for nested schema](#nestedblock--login)) - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) diff --git a/docs/resources/login.md b/docs/resources/login.md index ddc6780..5d088f3 100644 --- a/docs/resources/login.md +++ b/docs/resources/login.md @@ -7,7 +7,7 @@ Use this resource to access secrets of type `login` stored in Keeper Vault ### Optional - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **login** (Block List, Max: 1) Login field data. (see [below for nested schema](#nestedblock--login)) - **notes** (String) The secret notes. diff --git a/docs/resources/membership.md b/docs/resources/membership.md index de5ac23..285d479 100644 --- a/docs/resources/membership.md +++ b/docs/resources/membership.md @@ -8,7 +8,7 @@ Use this resource to access secrets of type `membership` stored in Keeper Vault - **account_number** (Block List, Max: 1) Account number field data. (see [below for nested schema](#nestedblock--account_number)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) - **notes** (String) The secret notes. diff --git a/docs/resources/passport.md b/docs/resources/passport.md index 4221eca..bfd8343 100644 --- a/docs/resources/passport.md +++ b/docs/resources/passport.md @@ -11,7 +11,7 @@ Use this resource to access secrets of type `passport` stored in Keeper Vault - **date_issued** (Block List, Max: 1) Date field data. (see [below for nested schema](#nestedblock--date_issued)) - **expiration_date** (Block List, Max: 1) Expiration date field data. (see [below for nested schema](#nestedblock--expiration_date)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) - **notes** (String) The secret notes. diff --git a/docs/resources/photo.md b/docs/resources/photo.md index a3f526c..affbd0f 100644 --- a/docs/resources/photo.md +++ b/docs/resources/photo.md @@ -7,7 +7,7 @@ Use this resource to access secrets of type `photo` stored in Keeper Vault ### Optional - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **notes** (String) The secret notes. - **title** (String) The secret title. diff --git a/docs/resources/server_credentials.md b/docs/resources/server_credentials.md index 0312acf..23f0a38 100644 --- a/docs/resources/server_credentials.md +++ b/docs/resources/server_credentials.md @@ -7,7 +7,7 @@ Use this resource to access secrets of type `serverCredentials` stored in Keeper ### Optional - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **host** (Block List, Max: 1) Host field data. (see [below for nested schema](#nestedblock--host)) - **id** (String) The ID of this resource. - **login** (Block List, Max: 1) Login field data. (see [below for nested schema](#nestedblock--login)) diff --git a/docs/resources/software_license.md b/docs/resources/software_license.md index 518fc44..3b17621 100644 --- a/docs/resources/software_license.md +++ b/docs/resources/software_license.md @@ -9,7 +9,7 @@ Use this resource to access secrets of type `softwareLicense` stored in Keeper V - **activation_date** (Block List, Max: 1) Date field data. (see [below for nested schema](#nestedblock--activation_date)) - **expiration_date** (Block List, Max: 1) Expiration date field data. (see [below for nested schema](#nestedblock--expiration_date)) - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **license_number** (Block List, Max: 1) License number field data. (see [below for nested schema](#nestedblock--license_number)) - **notes** (String) The secret notes. diff --git a/docs/resources/ssh_keys.md b/docs/resources/ssh_keys.md index 4aa31bb..685e6f1 100644 --- a/docs/resources/ssh_keys.md +++ b/docs/resources/ssh_keys.md @@ -7,7 +7,7 @@ Use this resource to access secrets of type `sshKeys` stored in Keeper Vault ### Optional - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **host** (Block List, Max: 1) Host field data. (see [below for nested schema](#nestedblock--host)) - **id** (String) The ID of this resource. - **key_pair** (Block List, Max: 1) Key pair field data. (see [below for nested schema](#nestedblock--key_pair)) diff --git a/docs/resources/ssn_card.md b/docs/resources/ssn_card.md index 6c8030e..e4ad478 100644 --- a/docs/resources/ssn_card.md +++ b/docs/resources/ssn_card.md @@ -7,7 +7,7 @@ Use this resource to access secrets of type `ssnCard` stored in Keeper Vault ### Optional - **file_ref** (Block List, Max: 1) FileRef field data. (see [below for nested schema](#nestedblock--file_ref)) -- **folder_uid** (String) The folder UID where the secret is stored. The shared folder must be non empty. +- **folder_uid** (String) The folder UID where the secret is stored. The parent shared folder must be non empty. - **id** (String) The ID of this resource. - **identity_number** (Block List, Max: 1) Account number field data. (see [below for nested schema](#nestedblock--identity_number)) - **name** (Block List, Max: 1) Name field data. (see [below for nested schema](#nestedblock--name)) diff --git a/secretsmanager/provider.go b/secretsmanager/provider.go index 3544edf..2ae4bb1 100644 --- a/secretsmanager/provider.go +++ b/secretsmanager/provider.go @@ -748,7 +748,11 @@ func createRecord(recordUid string, folderUid string, record *core.RecordCreate, } }() - ruid, err := client.CreateSecretWithRecordData(recordUid, folderUid, record) + co, err := buildCreateOptions(folderUid, client, nil) + if err != nil { + return "", err + } + ruid, err := client.CreateSecretWithRecordDataUidAndOptions(recordUid, co, record, nil) return ruid, err } @@ -898,6 +902,90 @@ func getTemplateFolder(folderUid string, client core.SecretsManager) (fuid strin return fuid, e } +// getSharedFolder tries to find closest parent shared folder +func getSharedFolder(folderUid string, client core.SecretsManager, folders []*core.KeeperFolder) (fuid string, e error) { + defer func() { + if r := recover(); r != nil { + fuid = "" + switch x := r.(type) { + case string: + e = errors.New(x) + case error: + e = x + default: + e = fmt.Errorf("error in provider - getSharedFolder: %v", r) + } + } + }() + + folderUid = strings.TrimSpace(folderUid) + if len(folders) == 0 { + if folders, e = client.GetFolders(); e != nil { + return "", e + } + } + + fldr := struct { + ParentUid string + FolderUid string + }{ + ParentUid: "", + FolderUid: "", + } + // initial lookup + for _, f := range folders { + if f.FolderUid == folderUid { + fldr.ParentUid = f.ParentUid + fldr.FolderUid = f.FolderUid + break + } + } + if fldr.FolderUid == "" { + return "", fmt.Errorf("folder not found: %v", folderUid) + } else if fldr.ParentUid == "" { + return fldr.FolderUid, nil + } + //main lookup + for { + tmpf := fldr.FolderUid + for _, f := range folders { + if f.FolderUid == fldr.ParentUid { + fldr.ParentUid = f.ParentUid + fldr.FolderUid = f.FolderUid + break + } + } + if fldr.ParentUid == "" || tmpf == fldr.FolderUid { + break + } + } + if fldr.ParentUid == "" { + return fldr.FolderUid, nil + } else { + return "", fmt.Errorf("unable to find parent folder for: %v, lookup stopped at: %v", folderUid, fldr.ParentUid) + } +} + +// buildCreateOptions finds parent shared folder and returns CreateOptions +func buildCreateOptions(folderUid string, client core.SecretsManager, folders []*core.KeeperFolder) (co *core.CreateOptions, e error) { + if len(folders) == 0 { + if folders, e = client.GetFolders(); e != nil { + return nil, e + } + } + + fuid, err := getSharedFolder(folderUid, client, folders) + if err != nil { + return nil, err + } + + copt := core.CreateOptions{FolderUid: fuid, SubFolderUid: folderUid} + if fuid == folderUid { + copt.SubFolderUid = "" + } + return &copt, nil +} + // getStringListData splits a string into list using the separator and skipping empty parts func GetStringListData(data string, separator string) []interface{} { if data == "" { diff --git a/secretsmanager/resource_address.go b/secretsmanager/resource_address.go index 65ad827..3532366 100644 --- a/secretsmanager/resource_address.go +++ b/secretsmanager/resource_address.go @@ -26,7 +26,7 @@ func resourceAddress() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -165,9 +165,15 @@ func resourceAddressRead(ctx context.Context, d *schema.ResourceData, m interfac return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_bank_account.go b/secretsmanager/resource_bank_account.go index ec44795..ddfdfa6 100644 --- a/secretsmanager/resource_bank_account.go +++ b/secretsmanager/resource_bank_account.go @@ -26,7 +26,7 @@ func resourceBankAccount() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -238,9 +238,15 @@ func resourceBankAccountRead(ctx context.Context, d *schema.ResourceData, m inte return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_bank_card.go b/secretsmanager/resource_bank_card.go index 973e6af..b1c355a 100644 --- a/secretsmanager/resource_bank_card.go +++ b/secretsmanager/resource_bank_card.go @@ -26,7 +26,7 @@ func resourceBankCard() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -198,9 +198,15 @@ func resourceBankCardRead(ctx context.Context, d *schema.ResourceData, m interfa return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_birth_certificate.go b/secretsmanager/resource_birth_certificate.go index 455276c..d7bbe2c 100644 --- a/secretsmanager/resource_birth_certificate.go +++ b/secretsmanager/resource_birth_certificate.go @@ -26,7 +26,7 @@ func resourceBirthCertificate() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -176,9 +176,15 @@ func resourceBirthCertificateRead(ctx context.Context, d *schema.ResourceData, m return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_contact.go b/secretsmanager/resource_contact.go index eee6d4d..5c5dc84 100644 --- a/secretsmanager/resource_contact.go +++ b/secretsmanager/resource_contact.go @@ -26,7 +26,7 @@ func resourceContact() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -209,9 +209,15 @@ func resourceContactRead(ctx context.Context, d *schema.ResourceData, m interfac return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_database_credentials.go b/secretsmanager/resource_database_credentials.go index da16dcd..cd2bea6 100644 --- a/secretsmanager/resource_database_credentials.go +++ b/secretsmanager/resource_database_credentials.go @@ -26,7 +26,7 @@ func resourceDatabaseCredentials() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -205,9 +205,15 @@ func resourceDatabaseCredentialsRead(ctx context.Context, d *schema.ResourceData return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_driver_license.go b/secretsmanager/resource_driver_license.go index f975081..cdcd8a7 100644 --- a/secretsmanager/resource_driver_license.go +++ b/secretsmanager/resource_driver_license.go @@ -26,7 +26,7 @@ func resourceDriverLicense() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -209,9 +209,15 @@ func resourceDriverLicenseRead(ctx context.Context, d *schema.ResourceData, m in return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_encrypted_notes.go b/secretsmanager/resource_encrypted_notes.go index 37b5c43..cb535ea 100644 --- a/secretsmanager/resource_encrypted_notes.go +++ b/secretsmanager/resource_encrypted_notes.go @@ -26,7 +26,7 @@ func resourceEncryptedNotes() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -176,9 +176,15 @@ func resourceEncryptedNotesRead(ctx context.Context, d *schema.ResourceData, m i return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_file.go b/secretsmanager/resource_file.go index 6bfe6c5..c0d1496 100644 --- a/secretsmanager/resource_file.go +++ b/secretsmanager/resource_file.go @@ -26,7 +26,7 @@ func resourceFile() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -153,9 +153,15 @@ func resourceFileRead(ctx context.Context, d *schema.ResourceData, m interface{} return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_health_insurance.go b/secretsmanager/resource_health_insurance.go index 368057c..96b2392 100644 --- a/secretsmanager/resource_health_insurance.go +++ b/secretsmanager/resource_health_insurance.go @@ -26,7 +26,7 @@ func resourceHealthInsurance() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -216,9 +216,15 @@ func resourceHealthInsuranceRead(ctx context.Context, d *schema.ResourceData, m return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_login.go b/secretsmanager/resource_login.go index 84e7555..00c8631 100644 --- a/secretsmanager/resource_login.go +++ b/secretsmanager/resource_login.go @@ -26,7 +26,7 @@ func resourceLogin() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -205,9 +205,15 @@ func resourceLoginRead(ctx context.Context, d *schema.ResourceData, m interface{ return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_membership.go b/secretsmanager/resource_membership.go index 5690b34..e103d38 100644 --- a/secretsmanager/resource_membership.go +++ b/secretsmanager/resource_membership.go @@ -26,7 +26,7 @@ func resourceMembership() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -194,9 +194,15 @@ func resourceMembershipRead(ctx context.Context, d *schema.ResourceData, m inter return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_passport.go b/secretsmanager/resource_passport.go index 3e4e9c2..8780639 100644 --- a/secretsmanager/resource_passport.go +++ b/secretsmanager/resource_passport.go @@ -26,7 +26,7 @@ func resourcePassport() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -238,9 +238,15 @@ func resourcePassportRead(ctx context.Context, d *schema.ResourceData, m interfa return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_photo.go b/secretsmanager/resource_photo.go index 152a7a6..53e07b0 100644 --- a/secretsmanager/resource_photo.go +++ b/secretsmanager/resource_photo.go @@ -26,7 +26,7 @@ func resourcePhoto() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -153,9 +153,15 @@ func resourcePhotoRead(ctx context.Context, d *schema.ResourceData, m interface{ return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_server_credentials.go b/secretsmanager/resource_server_credentials.go index 75bd818..98afeae 100644 --- a/secretsmanager/resource_server_credentials.go +++ b/secretsmanager/resource_server_credentials.go @@ -26,7 +26,7 @@ func resourceServerCredentials() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -194,9 +194,15 @@ func resourceServerCredentialsRead(ctx context.Context, d *schema.ResourceData, return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_software_license.go b/secretsmanager/resource_software_license.go index 6ab6312..a3f8e8f 100644 --- a/secretsmanager/resource_software_license.go +++ b/secretsmanager/resource_software_license.go @@ -26,7 +26,7 @@ func resourceSoftwareLicense() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -187,9 +187,15 @@ func resourceSoftwareLicenseRead(ctx context.Context, d *schema.ResourceData, m return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_ssh_keys.go b/secretsmanager/resource_ssh_keys.go index 5b3f4ca..11bea5a 100644 --- a/secretsmanager/resource_ssh_keys.go +++ b/secretsmanager/resource_ssh_keys.go @@ -26,7 +26,7 @@ func resourceSshKeys() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -205,9 +205,15 @@ func resourceSshKeysRead(ctx context.Context, d *schema.ResourceData, m interfac return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) } diff --git a/secretsmanager/resource_ssn_card.go b/secretsmanager/resource_ssn_card.go index 227c32c..59da5f7 100644 --- a/secretsmanager/resource_ssn_card.go +++ b/secretsmanager/resource_ssn_card.go @@ -26,7 +26,7 @@ func resourceSsnCard() *schema.Resource { Computed: true, Optional: true, AtLeastOneOf: []string{"folder_uid", "uid"}, - Description: "The folder UID where the secret is stored. The shared folder must be non empty.", + Description: "The folder UID where the secret is stored. The parent shared folder must be non empty.", }, "uid": { Type: schema.TypeString, @@ -176,9 +176,15 @@ func resourceSsnCardRead(ctx context.Context, d *schema.ResourceData, m interfac return diag.FromErr(err) } } - if err = d.Set("folder_uid", secret.FolderUid()); err != nil { - return diag.FromErr(err) + fuid := secret.InnerFolderUid() // in subfolder + if fuid == "" { // directly in shared folder + fuid = secret.FolderUid() } + if fuid != "" { + if err = d.Set("folder_uid", fuid); err != nil { + return diag.FromErr(err) + } + } // else - directly shared to the KSM App (not through shared folder) if err = d.Set("type", recordType); err != nil { return diag.FromErr(err) }