From 4ef44c1ffc7e8f27ea0af620bc3aa20b91c006fb Mon Sep 17 00:00:00 2001 From: Emond Papegaaij Date: Tue, 7 Nov 2023 13:29:22 +0100 Subject: [PATCH] Update documentation, add namespace support --- .copywrite.hcl | 21 --- .github/CODEOWNERS | 1 - .github/CODE_OF_CONDUCT.md | 5 - CHANGELOG.md | 7 +- README.md | 137 ++++++++++-------- docs/data-sources/group.md | 9 +- docs/index.md | 20 ++- docs/resources/group.md | 17 ++- examples/README.md | 9 -- .../keyhubpreview_group/data-source.tf | 4 + .../scaffolding_example/data-source.tf | 3 - examples/provider/provider.tf | 20 ++- .../resources/keyhubpreview_group/resource.tf | 12 ++ .../resources/scaffolding_example/resource.tf | 3 - go.mod | 13 +- go.sum | 27 ++-- internal/provider/full-data-struct-ds.go | 25 +++- internal/provider/full-data-struct-rs.go | 24 ++- internal/provider/full-object-attrs-ds.go | 14 +- internal/provider/full-object-attrs-rs.go | 13 +- internal/provider/full-schema-ds.go | 55 ++++++- internal/provider/full-schema-rs.go | 57 +++++++- .../provider/full-tf-to-data-struct-ds.go | 12 +- .../provider/full-tf-to-data-struct-rs.go | 11 +- internal/provider/full-tf-to-tkh-ds.go | 47 +++++- internal/provider/full-tf-to-tkh-rs.go | 42 +++++- internal/provider/full-tkh-to-tf-ds.go | 53 ++++++- internal/provider/full-tkh-to-tf-rs.go | 32 +++- main.go | 36 ++--- 29 files changed, 531 insertions(+), 198 deletions(-) delete mode 100644 .copywrite.hcl delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 examples/README.md create mode 100644 examples/data-sources/keyhubpreview_group/data-source.tf delete mode 100644 examples/data-sources/scaffolding_example/data-source.tf create mode 100644 examples/resources/keyhubpreview_group/resource.tf delete mode 100644 examples/resources/scaffolding_example/resource.tf diff --git a/.copywrite.hcl b/.copywrite.hcl deleted file mode 100644 index bdf3892..0000000 --- a/.copywrite.hcl +++ /dev/null @@ -1,21 +0,0 @@ -# NOTE: This file is for HashiCorp specific licensing automation and can be deleted after creating a new repo with this template. -schema_version = 1 - -project { - license = "MPL-2.0" - copyright_year = 2021 - - header_ignore = [ - # examples used within documentation (prose) - "examples/**", - - # GitHub issue template configuration - ".github/ISSUE_TEMPLATE/*.yml", - - # golangci-lint tooling configuration - ".golangci.yml", - - # GoReleaser tooling configuration - ".goreleaser.yml", - ] -} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 922ee27..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @hashicorp/terraform-devex diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 0c8b092..0000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,5 +0,0 @@ -# Code of Conduct - -HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code. - -Please read the full text at https://www.hashicorp.com/community-guidelines diff --git a/CHANGELOG.md b/CHANGELOG.md index b76e247..be3f3f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ -## 0.1.0 (Unreleased) +## 0.0.2 +* Add support for provisioned namespaces +* Updated documentation + +## 0.0.1 (Initial release) FEATURES: +* First implementation of a new Topicus KeyHub Terraform provider diff --git a/README.md b/README.md index 7be3761..e83f155 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,75 @@ -# Terraform Provider Scaffolding (Terraform Plugin Framework) - -_This template repository is built on the [Terraform Plugin Framework](https://github.com/hashicorp/terraform-plugin-framework). The template repository built on the [Terraform Plugin SDK](https://github.com/hashicorp/terraform-plugin-sdk) can be found at [terraform-provider-scaffolding](https://github.com/hashicorp/terraform-provider-scaffolding). See [Which SDK Should I Use?](https://www.terraform.io/docs/plugin/which-sdk.html) in the Terraform documentation for additional information._ - -This repository is a *template* for a [Terraform](https://www.terraform.io) provider. It is intended as a starting point for creating Terraform providers, containing: - -- A resource and a data source (`internal/provider/`), -- Examples (`examples/`) and generated documentation (`docs/`), -- Miscellaneous meta files. - -These files contain boilerplate code that you will need to edit to create your own Terraform provider. Tutorials for creating Terraform providers can be found on the [HashiCorp Learn](https://learn.hashicorp.com/collections/terraform/providers-plugin-framework) platform. _Terraform Plugin Framework specific guides are titled accordingly._ - -Please see the [GitHub template repository documentation](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template) for how to create a new repository from this template on GitHub. - -Once you've written your provider, you'll want to [publish it on the Terraform Registry](https://www.terraform.io/docs/registry/providers/publishing.html) so that others can use it. - -## Requirements - -- [Terraform](https://www.terraform.io/downloads.html) >= 1.0 -- [Go](https://golang.org/doc/install) >= 1.19 - -## Building The Provider - -1. Clone the repository -1. Enter the repository directory -1. Build the provider using the Go `install` command: - -```shell -go install -``` - -## Adding Dependencies - -This provider uses [Go modules](https://github.com/golang/go/wiki/Modules). -Please see the Go documentation for the most up to date information about using Go modules. - -To add a new dependency `github.com/author/dependency` to your Terraform provider: - -```shell -go get github.com/author/dependency -go mod tidy -``` - -Then commit the changes to `go.mod` and `go.sum`. - -## Using the provider - -Fill this in for each provider - -## Developing the Provider - -If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above). - -To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory. - -To generate or update documentation, run `go generate`. - -In order to run the full suite of Acceptance tests, run `make testacc`. - -*Note:* Acceptance tests create real resources, and often cost money to run. - -```shell -make testacc +# Terraform Provider for Topicus KeyHub + +_This provider is currently in preview. It requires a current nightly version of Topicus KeyHub._ + +The Terraform Provider for Topicus KeyHub allows managing resources within a Topicus KeyHub appliance. +It requires at least Terraform 1.0 and the most recent version of Terraform is recommended. + +For more information see: +* [Terraform Website](https://www.terraform.io) +* [Topicus KeyHub Provider Documentation](https://registry.terraform.io/providers/topicuskeyhub/keyhubpreview/latest/docs) + +The used provider version must match your Topicus KeyHub release. +For example, use the provider version 0.30.0 for Topicus KeyHub 30. +An older version of the provider may work on a newer version of Topicus KeyHub. +A newer version of the provder will fail on an older version of Topicus KeyHub. + +## Usage example + +```hcl +# 1. Specify the version of the Topicus KeyHub Provider to use +terraform { + required_providers { + keyhubpreview = { + source = "registry.terraform.io/hashicorp/keyhubpreview" + version = "=0.0.2" + } + } +} + +# 2. Configure the Topicus KeyHub provider +variable "keyhub_secret" { + type = string + description = "Client secret on KeyHub" +} + +provider "keyhubpreview" { + issuer = "https://keyhub.example.com" + clientid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d" + clientsecret = var.keyhub_secret +} + +# 3. Create a group in Topicus KeyHub +resource "keyhubpreview_group" "group_in_keyhub" { + name = "Terraform" + accounts = [{ + uuid = "7ea6622b-f9d2-4e52-a799-217b26f88376" + rights = "MANAGER" + }] + client_permissions = [{ + client_uuid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d" + value = "GROUP_FULL_VAULT_ACCESS" + }] +} + +# 4. Create a vault record in the newly created group +resource "keyhubpreview_group_vaultrecord" "vaultrecord_in_keyhub" { + name = "Terraform Record" + group_uuid = resource.keyhubpreview_group.group_in_keyhub.uuid + secret = { + password = "test3" + } +} + +# 5. Setup provisioning for the group +resource "keyhubpreview_grouponsystem" "provisioning" { + provisioned_system_uuid = "47923975-b1af-47c8-bd7a-e52ebb4b9b84" + owner_uuid = resource.keyhubpreview_group.group_in_keyhub.uuid + name_in_system = "cn=terraform,ou=groups,dc=demo,dc=topicus-keyhub,dc=com" + type = "GROUP" + provgroups = [{ + activation_required = "false" + group_uuid = "c6c98d08-2cbf-45e9-937a-c5c0427348e2" + }] +} ``` diff --git a/docs/data-sources/group.md b/docs/data-sources/group.md index 8edfe7f..703d545 100644 --- a/docs/data-sources/group.md +++ b/docs/data-sources/group.md @@ -10,7 +10,14 @@ description: |- - +## Example Usage + +```terraform +data "keyhubpreview_group" "group_from_keyhub" { + uuid = "0449c302-3701-44cf-a09f-9a6d903a763b" + additional = ["accounts", "audit", "nestedGroups"] +} +``` ## Schema diff --git a/docs/index.md b/docs/index.md index f0c9a53..090c5ec 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,8 +13,24 @@ description: |- ## Example Usage ```terraform -provider "scaffolding" { - # example configuration here +terraform { + required_providers { + keyhubpreview = { + source = "registry.terraform.io/hashicorp/keyhubpreview" + version = "=0.30.0" + } + } +} + +variable "keyhub_secret" { + type = string + description = "Client secret on KeyHub" +} + +provider "keyhubpreview" { + issuer = "https://keyhub.example.com" + clientid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d" + clientsecret = var.keyhub_secret } ``` diff --git a/docs/resources/group.md b/docs/resources/group.md index d380cda..299eedc 100644 --- a/docs/resources/group.md +++ b/docs/resources/group.md @@ -10,7 +10,22 @@ description: |- - +## Example Usage + +```terraform +resource "keyhubpreview_group" "terra" { + name = "Terraform" + application_administration = "true" + accounts = [{ + uuid = "7ea6622b-f9d2-4e52-a799-217b26f88376" + rights = "MANAGER" + }] + client_permissions = [{ + client_uuid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d" + value = "GROUP_FULL_VAULT_ACCESS" + }] +} +``` ## Schema diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 026c42c..0000000 --- a/examples/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Examples - -This directory contains examples that are mostly used for documentation, but can also be run/tested manually via the Terraform CLI. - -The document generation tool looks for files in the following locations by default. All other *.tf files besides the ones mentioned below are ignored by the documentation tool. This is useful for creating examples that can run and/or ar testable even if some parts are not relevant for the documentation. - -* **provider/provider.tf** example file for the provider index page -* **data-sources/`full data source name`/data-source.tf** example file for the named data source page -* **resources/`full resource name`/resource.tf** example file for the named data source page diff --git a/examples/data-sources/keyhubpreview_group/data-source.tf b/examples/data-sources/keyhubpreview_group/data-source.tf new file mode 100644 index 0000000..0b5516f --- /dev/null +++ b/examples/data-sources/keyhubpreview_group/data-source.tf @@ -0,0 +1,4 @@ +data "keyhubpreview_group" "group_from_keyhub" { + uuid = "0449c302-3701-44cf-a09f-9a6d903a763b" + additional = ["accounts", "audit", "nestedGroups"] +} diff --git a/examples/data-sources/scaffolding_example/data-source.tf b/examples/data-sources/scaffolding_example/data-source.tf deleted file mode 100644 index a852489..0000000 --- a/examples/data-sources/scaffolding_example/data-source.tf +++ /dev/null @@ -1,3 +0,0 @@ -data "scaffolding_example" "example" { - configurable_attribute = "some-value" -} diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 942db45..2f9ef98 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,3 +1,19 @@ -provider "scaffolding" { - # example configuration here +terraform { + required_providers { + keyhubpreview = { + source = "registry.terraform.io/hashicorp/keyhubpreview" + version = "=0.30.0" + } + } +} + +variable "keyhub_secret" { + type = string + description = "Client secret on KeyHub" +} + +provider "keyhubpreview" { + issuer = "https://keyhub.example.com" + clientid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d" + clientsecret = var.keyhub_secret } diff --git a/examples/resources/keyhubpreview_group/resource.tf b/examples/resources/keyhubpreview_group/resource.tf new file mode 100644 index 0000000..bcd93b2 --- /dev/null +++ b/examples/resources/keyhubpreview_group/resource.tf @@ -0,0 +1,12 @@ +resource "keyhubpreview_group" "terra" { + name = "Terraform" + application_administration = "true" + accounts = [{ + uuid = "7ea6622b-f9d2-4e52-a799-217b26f88376" + rights = "MANAGER" + }] + client_permissions = [{ + client_uuid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d" + value = "GROUP_FULL_VAULT_ACCESS" + }] +} \ No newline at end of file diff --git a/examples/resources/scaffolding_example/resource.tf b/examples/resources/scaffolding_example/resource.tf deleted file mode 100644 index 9ae3f57..0000000 --- a/examples/resources/scaffolding_example/resource.tf +++ /dev/null @@ -1,3 +0,0 @@ -resource "scaffolding_example" "example" { - configurable_attribute = "some-value" -} diff --git a/go.mod b/go.mod index 91fc726..c4ec54e 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/hashicorp/terraform-plugin-framework v1.4.2 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/microsoft/kiota-abstractions-go v1.3.1 - github.com/topicuskeyhub/sdk-go v0.29.1-0.20231031163120-580c3f972b4d + github.com/microsoft/kiota-abstractions-go v1.4.0 + github.com/topicuskeyhub/sdk-go v0.29.1-0.20231107100645-f5ba1db322e2 golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) @@ -24,7 +24,7 @@ require ( github.com/cjlapao/common-go v0.0.39 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/coreos/go-oidc v2.2.1+incompatible // indirect - github.com/fatih/color v1.15.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -56,7 +56,6 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/posener/complete v1.2.3 // indirect github.com/pquerna/cachecontrol v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday v1.6.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.1 // indirect @@ -71,10 +70,10 @@ require ( golang.org/x/mod v0.13.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/go.sum b/go.sum index 7b6a993..6064d56 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= @@ -122,8 +122,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k 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/microsoft/kiota-abstractions-go v1.3.1 h1:lZ4hLvU/HpnAkvjqIt/mL1ooZ0b/2RKuM2K65fl2/mY= -github.com/microsoft/kiota-abstractions-go v1.3.1/go.mod h1:NRJnAFg8qqOoX/VQWTe3ZYmcIbLa20LNC+eTqO2j60U= +github.com/microsoft/kiota-abstractions-go v1.4.0 h1:i9+LZ1wQ90xpq/gR2umCA5DgHvgBr3ibzsEdexZGnVY= +github.com/microsoft/kiota-abstractions-go v1.4.0/go.mod h1:NRJnAFg8qqOoX/VQWTe3ZYmcIbLa20LNC+eTqO2j60U= github.com/microsoft/kiota-http-go v1.1.0 h1:L5I93EiNtlP/X6YzeTlhjWt7Q1DxzC9CmWSVtX3b0tE= github.com/microsoft/kiota-http-go v1.1.0/go.mod h1:zESUM6ovki9LEupqziCbxJ+FAYoF0dFDYZVpOkAfSLc= github.com/microsoft/kiota-serialization-json-go v1.0.4 h1:5TaISWwd2Me8clrK7SqNATo0tv9seOq59y4I5953egQ= @@ -148,8 +148,7 @@ github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXq github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/pquerna/cachecontrol v0.2.0 h1:vBXSNuE5MYP9IJ5kjsdo8uq+w41jSPgvba2DEnkRx9k= github.com/pquerna/cachecontrol v0.2.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -169,8 +168,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/topicuskeyhub/sdk-go v0.29.1-0.20231031163120-580c3f972b4d h1:QUcCSysZOnwe7rr0Oyu4ikkRKWmuenJvnooCbR2ud/Y= -github.com/topicuskeyhub/sdk-go v0.29.1-0.20231031163120-580c3f972b4d/go.mod h1:s8qOQieJ+9cm/2s0uxPySRH9YNFbln3Nb9J8/XNaWbM= +github.com/topicuskeyhub/sdk-go v0.29.1-0.20231107100645-f5ba1db322e2 h1:1PmioacBckd88AckWiFaQMpHJCiUW/aVRD03C9IXSHQ= +github.com/topicuskeyhub/sdk-go v0.29.1-0.20231107100645-f5ba1db322e2/go.mod h1:5ObmQAgqq9oNpQ58Tj9aNrjGBFjJG6kvCG6GOymOrAo= 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= @@ -230,8 +229,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/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.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.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/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -244,8 +243,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 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= @@ -255,8 +254,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= diff --git a/internal/provider/full-data-struct-ds.go b/internal/provider/full-data-struct-ds.go index f159e75..9281aee 100644 --- a/internal/provider/full-data-struct-ds.go +++ b/internal/provider/full-data-struct-ds.go @@ -494,6 +494,7 @@ type groupAccountGroupDataDS struct { Permissions types.List `tfsdk:"permissions"` Admin types.Bool `tfsdk:"admin"` Name types.String `tfsdk:"name"` + OrganizationalUnit types.Object `tfsdk:"organizational_unit"` UUID types.String `tfsdk:"uuid"` Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` @@ -537,6 +538,7 @@ type groupGroupDataDS struct { Permissions types.List `tfsdk:"permissions"` Admin types.Bool `tfsdk:"admin"` Name types.String `tfsdk:"name"` + OrganizationalUnit types.Object `tfsdk:"organizational_unit"` UUID types.String `tfsdk:"uuid"` Additional types.List `tfsdk:"additional"` Accounts types.List `tfsdk:"accounts" tkhao:"accounts"` @@ -580,7 +582,6 @@ type groupGroupDataDS struct { ExtendedAccess types.String `tfsdk:"extended_access"` HideAuditTrail types.Bool `tfsdk:"hide_audit_trail"` NestedUnder types.Object `tfsdk:"nested_under"` - OrganizationalUnit types.Object `tfsdk:"organizational_unit"` PrivateGroup types.Bool `tfsdk:"private_group"` RecordTrail types.Bool `tfsdk:"record_trail"` RotatingPasswordRequired types.Bool `tfsdk:"rotating_password_required"` @@ -825,11 +826,12 @@ var groupGroupPrimerAttrTypesDS = objectAttrsTypeDSGroupGroupPrimer(false) var groupGroupPrimerAttrTypesDSRecurse = objectAttrsTypeDSGroupGroupPrimer(true) type groupGroupPrimerDataDS struct { - Links types.List `tfsdk:"links"` - Permissions types.List `tfsdk:"permissions"` - Admin types.Bool `tfsdk:"admin"` - Name types.String `tfsdk:"name"` - UUID types.String `tfsdk:"uuid"` + Links types.List `tfsdk:"links"` + Permissions types.List `tfsdk:"permissions"` + Admin types.Bool `tfsdk:"admin"` + Name types.String `tfsdk:"name"` + OrganizationalUnit types.Object `tfsdk:"organizational_unit"` + UUID types.String `tfsdk:"uuid"` } var groupGroupPrimerLinkableWrapperAttrTypesDS = objectAttrsTypeDSGroupGroupPrimerLinkableWrapper(false) @@ -1164,6 +1166,15 @@ type provisioningProvisionedLDAPDirectoryDataDS struct { GroupDN types.String `tfsdk:"group_dn"` } +var provisioningProvisionedNamespaceAttrTypesDS = objectAttrsTypeDSProvisioningProvisionedNamespace(false) +var provisioningProvisionedNamespaceAttrTypesDSRecurse = objectAttrsTypeDSProvisioningProvisionedNamespace(true) + +type provisioningProvisionedNamespaceDataDS struct { + BaseSystem types.Object `tfsdk:"base_system"` + GroupDN types.String `tfsdk:"group_dn"` + ServiceAccountDN types.String `tfsdk:"service_account_dn"` +} + var provisioningProvisionedSystemAttrTypesDS = objectAttrsTypeDSProvisioningProvisionedSystem(false) var provisioningProvisionedSystemAttrTypesDSRecurse = objectAttrsTypeDSProvisioningProvisionedSystem(true) @@ -1190,6 +1201,7 @@ type provisioningProvisionedSystemDataDS struct { Owner types.Object `tfsdk:"owner"` SelfServiceExistingGroups types.Bool `tfsdk:"self_service_existing_groups"` SelfServiceNewGroups types.Bool `tfsdk:"self_service_new_groups"` + SelfServiceNewNamespaces types.Bool `tfsdk:"self_service_new_namespaces"` SelfServiceServiceAccounts types.Bool `tfsdk:"self_service_service_accounts"` ShouldDestroyUnknownAccounts types.Bool `tfsdk:"should_destroy_unknown_accounts"` TechnicalAdministrator types.Object `tfsdk:"technical_administrator"` @@ -1202,6 +1214,7 @@ type provisioningProvisionedSystemDataDS struct { ProvisionedInternalLDAP types.Object `tfsdk:"provisioned_internal_ldap"` ProvisionedLDAP types.Object `tfsdk:"provisioned_ldap"` ProvisionedLDAPDirectory types.Object `tfsdk:"provisioned_ldap_directory"` + ProvisionedNamespace types.Object `tfsdk:"provisioned_namespace"` } var provisioningProvisionedSystemLinkableWrapperAttrTypesDS = objectAttrsTypeDSProvisioningProvisionedSystemLinkableWrapper(false) diff --git a/internal/provider/full-data-struct-rs.go b/internal/provider/full-data-struct-rs.go index 8986d17..169897a 100644 --- a/internal/provider/full-data-struct-rs.go +++ b/internal/provider/full-data-struct-rs.go @@ -409,6 +409,7 @@ type groupGroupDataRS struct { Permissions types.List `tfsdk:"permissions"` Admin types.Bool `tfsdk:"admin"` Name types.String `tfsdk:"name"` + OrganizationalUnitUUID types.String `tfsdk:"organizational_unit_uuid"` UUID types.String `tfsdk:"uuid"` Accounts types.List `tfsdk:"accounts" tkhao:"accounts"` AdministeredClients types.List `tfsdk:"administered_clients" tkhao:"administeredClients"` @@ -451,7 +452,6 @@ type groupGroupDataRS struct { ExtendedAccess types.String `tfsdk:"extended_access"` HideAuditTrail types.Bool `tfsdk:"hide_audit_trail"` NestedUnderUUID types.String `tfsdk:"nested_under_uuid"` - OrganizationalUnitUUID types.String `tfsdk:"organizational_unit_uuid"` PrivateGroup types.Bool `tfsdk:"private_group"` RecordTrail types.Bool `tfsdk:"record_trail"` RotatingPasswordRequired types.Bool `tfsdk:"rotating_password_required"` @@ -629,11 +629,12 @@ var groupGroupPrimerAttrTypesRS = objectAttrsTypeRSGroupGroupPrimer(false) var groupGroupPrimerAttrTypesRSRecurse = objectAttrsTypeRSGroupGroupPrimer(true) type groupGroupPrimerDataRS struct { - Links types.List `tfsdk:"links"` - Permissions types.List `tfsdk:"permissions"` - Admin types.Bool `tfsdk:"admin"` - Name types.String `tfsdk:"name"` - UUID types.String `tfsdk:"uuid"` + Links types.List `tfsdk:"links"` + Permissions types.List `tfsdk:"permissions"` + Admin types.Bool `tfsdk:"admin"` + Name types.String `tfsdk:"name"` + OrganizationalUnitUUID types.String `tfsdk:"organizational_unit_uuid"` + UUID types.String `tfsdk:"uuid"` } var groupGroupPrimerLinkableWrapperAttrTypesRS = objectAttrsTypeRSGroupGroupPrimerLinkableWrapper(false) @@ -1012,6 +1013,15 @@ type provisioningProvisionedLDAPDirectoryDataRS struct { GroupDN types.String `tfsdk:"group_dn"` } +var provisioningProvisionedNamespaceAttrTypesRS = objectAttrsTypeRSProvisioningProvisionedNamespace(false) +var provisioningProvisionedNamespaceAttrTypesRSRecurse = objectAttrsTypeRSProvisioningProvisionedNamespace(true) + +type provisioningProvisionedNamespaceDataRS struct { + BaseSystemUUID types.String `tfsdk:"base_system_uuid"` + GroupDN types.String `tfsdk:"group_dn"` + ServiceAccountDN types.String `tfsdk:"service_account_dn"` +} + var provisioningProvisionedSystemAttrTypesRS = objectAttrsTypeRSProvisioningProvisionedSystem(false) var provisioningProvisionedSystemAttrTypesRSRecurse = objectAttrsTypeRSProvisioningProvisionedSystem(true) @@ -1037,6 +1047,7 @@ type provisioningProvisionedSystemDataRS struct { OwnerUUID types.String `tfsdk:"owner_uuid"` SelfServiceExistingGroups types.Bool `tfsdk:"self_service_existing_groups"` SelfServiceNewGroups types.Bool `tfsdk:"self_service_new_groups"` + SelfServiceNewNamespaces types.Bool `tfsdk:"self_service_new_namespaces"` SelfServiceServiceAccounts types.Bool `tfsdk:"self_service_service_accounts"` ShouldDestroyUnknownAccounts types.Bool `tfsdk:"should_destroy_unknown_accounts"` TechnicalAdministratorUUID types.String `tfsdk:"technical_administrator_uuid"` @@ -1049,6 +1060,7 @@ type provisioningProvisionedSystemDataRS struct { ProvisionedInternalLDAP types.Object `tfsdk:"provisioned_internal_ldap"` ProvisionedLDAP types.Object `tfsdk:"provisioned_ldap"` ProvisionedLDAPDirectory types.Object `tfsdk:"provisioned_ldap_directory"` + ProvisionedNamespace types.Object `tfsdk:"provisioned_namespace"` } var provisioningProvisionedSystemLinkableWrapperAttrTypesRS = objectAttrsTypeRSProvisioningProvisionedSystemLinkableWrapper(false) diff --git a/internal/provider/full-object-attrs-ds.go b/internal/provider/full-object-attrs-ds.go index e0188d2..c6e1905 100644 --- a/internal/provider/full-object-attrs-ds.go +++ b/internal/provider/full-object-attrs-ds.go @@ -471,6 +471,7 @@ func objectAttrsTypeDSGroupAccountGroup(recurse bool) map[string]attr.Type { objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeDSAuthPermission(recurse)}} objectAttrs["admin"] = types.BoolType objectAttrs["name"] = types.StringType + objectAttrs["organizational_unit"] = types.ObjectType{AttrTypes: objectAttrsTypeDSOrganizationOrganizationalUnitPrimer(recurse)} objectAttrs["uuid"] = types.StringType objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["end_date"] = types.StringType @@ -537,6 +538,7 @@ func objectAttrsTypeDSGroupGroup(recurse bool) map[string]attr.Type { objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeDSAuthPermission(recurse)}} objectAttrs["admin"] = types.BoolType objectAttrs["name"] = types.StringType + objectAttrs["organizational_unit"] = types.ObjectType{AttrTypes: objectAttrsTypeDSOrganizationOrganizationalUnitPrimer(recurse)} objectAttrs["uuid"] = types.StringType objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["application_administration"] = types.BoolType @@ -553,7 +555,6 @@ func objectAttrsTypeDSGroupGroup(recurse bool) map[string]attr.Type { objectAttrs["extended_access"] = types.StringType objectAttrs["hide_audit_trail"] = types.BoolType objectAttrs["nested_under"] = types.ObjectType{AttrTypes: objectAttrsTypeDSGroupGroupPrimer(false)} - objectAttrs["organizational_unit"] = types.ObjectType{AttrTypes: objectAttrsTypeDSOrganizationOrganizationalUnitPrimer(false)} objectAttrs["private_group"] = types.BoolType objectAttrs["record_trail"] = types.BoolType objectAttrs["rotating_password_required"] = types.BoolType @@ -791,6 +792,7 @@ func objectAttrsTypeDSGroupGroupPrimer(recurse bool) map[string]attr.Type { objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeDSAuthPermission(recurse)}} objectAttrs["admin"] = types.BoolType objectAttrs["name"] = types.StringType + objectAttrs["organizational_unit"] = types.ObjectType{AttrTypes: objectAttrsTypeDSOrganizationOrganizationalUnitPrimer(recurse)} objectAttrs["uuid"] = types.StringType return objectAttrs } @@ -1105,6 +1107,14 @@ func objectAttrsTypeDSProvisioningProvisionedLDAPDirectory(recurse bool) map[str return objectAttrs } +func objectAttrsTypeDSProvisioningProvisionedNamespace(recurse bool) map[string]attr.Type { + objectAttrs := make(map[string]attr.Type) + objectAttrs["base_system"] = types.ObjectType{AttrTypes: objectAttrsTypeDSProvisioningProvisionedSystemPrimer(recurse)} + objectAttrs["group_dn"] = types.StringType + objectAttrs["service_account_dn"] = types.StringType + return objectAttrs +} + func objectAttrsTypeDSProvisioningProvisionedSystem(recurse bool) map[string]attr.Type { objectAttrs := make(map[string]attr.Type) if recurse { @@ -1131,6 +1141,7 @@ func objectAttrsTypeDSProvisioningProvisionedSystem(recurse bool) map[string]att objectAttrs["owner"] = types.ObjectType{AttrTypes: objectAttrsTypeDSGroupGroupPrimer(false)} objectAttrs["self_service_existing_groups"] = types.BoolType objectAttrs["self_service_new_groups"] = types.BoolType + objectAttrs["self_service_new_namespaces"] = types.BoolType objectAttrs["self_service_service_accounts"] = types.BoolType objectAttrs["should_destroy_unknown_accounts"] = types.BoolType objectAttrs["technical_administrator"] = types.ObjectType{AttrTypes: objectAttrsTypeDSGroupGroupPrimer(false)} @@ -1143,6 +1154,7 @@ func objectAttrsTypeDSProvisioningProvisionedSystem(recurse bool) map[string]att objectAttrs["provisioned_internal_ldap"] = types.ObjectType{AttrTypes: objectAttrsTypeDSProvisioningProvisionedInternalLDAP(false)} objectAttrs["provisioned_ldap"] = types.ObjectType{AttrTypes: objectAttrsTypeDSProvisioningProvisionedLDAP(false)} objectAttrs["provisioned_ldap_directory"] = types.ObjectType{AttrTypes: objectAttrsTypeDSProvisioningProvisionedLDAPDirectory(false)} + objectAttrs["provisioned_namespace"] = types.ObjectType{AttrTypes: objectAttrsTypeDSProvisioningProvisionedNamespace(false)} return objectAttrs } diff --git a/internal/provider/full-object-attrs-rs.go b/internal/provider/full-object-attrs-rs.go index d6728c9..9b82103 100644 --- a/internal/provider/full-object-attrs-rs.go +++ b/internal/provider/full-object-attrs-rs.go @@ -415,6 +415,7 @@ func objectAttrsTypeRSGroupGroup(recurse bool) map[string]attr.Type { objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} objectAttrs["admin"] = types.BoolType objectAttrs["name"] = types.StringType + objectAttrs["organizational_unit_uuid"] = types.StringType objectAttrs["uuid"] = types.StringType objectAttrs["application_administration"] = types.BoolType objectAttrs["audit_config"] = types.ObjectType{AttrTypes: objectAttrsTypeRSGroupGroupAuditConfig(false)} @@ -430,7 +431,6 @@ func objectAttrsTypeRSGroupGroup(recurse bool) map[string]attr.Type { objectAttrs["extended_access"] = types.StringType objectAttrs["hide_audit_trail"] = types.BoolType objectAttrs["nested_under_uuid"] = types.StringType - objectAttrs["organizational_unit_uuid"] = types.StringType objectAttrs["private_group"] = types.BoolType objectAttrs["record_trail"] = types.BoolType objectAttrs["rotating_password_required"] = types.BoolType @@ -602,6 +602,7 @@ func objectAttrsTypeRSGroupGroupPrimer(recurse bool) map[string]attr.Type { objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} objectAttrs["admin"] = types.BoolType objectAttrs["name"] = types.StringType + objectAttrs["organizational_unit_uuid"] = types.StringType objectAttrs["uuid"] = types.StringType return objectAttrs } @@ -961,6 +962,14 @@ func objectAttrsTypeRSProvisioningProvisionedLDAPDirectory(recurse bool) map[str return objectAttrs } +func objectAttrsTypeRSProvisioningProvisionedNamespace(recurse bool) map[string]attr.Type { + objectAttrs := make(map[string]attr.Type) + objectAttrs["base_system_uuid"] = types.StringType + objectAttrs["group_dn"] = types.StringType + objectAttrs["service_account_dn"] = types.StringType + return objectAttrs +} + func objectAttrsTypeRSProvisioningProvisionedSystem(recurse bool) map[string]attr.Type { objectAttrs := make(map[string]attr.Type) if recurse { @@ -986,6 +995,7 @@ func objectAttrsTypeRSProvisioningProvisionedSystem(recurse bool) map[string]att objectAttrs["owner_uuid"] = types.StringType objectAttrs["self_service_existing_groups"] = types.BoolType objectAttrs["self_service_new_groups"] = types.BoolType + objectAttrs["self_service_new_namespaces"] = types.BoolType objectAttrs["self_service_service_accounts"] = types.BoolType objectAttrs["should_destroy_unknown_accounts"] = types.BoolType objectAttrs["technical_administrator_uuid"] = types.StringType @@ -998,6 +1008,7 @@ func objectAttrsTypeRSProvisioningProvisionedSystem(recurse bool) map[string]att objectAttrs["provisioned_internal_ldap"] = types.ObjectType{AttrTypes: objectAttrsTypeRSProvisioningProvisionedInternalLDAP(false)} objectAttrs["provisioned_ldap"] = types.ObjectType{AttrTypes: objectAttrsTypeRSProvisioningProvisionedLDAP(false)} objectAttrs["provisioned_ldap_directory"] = types.ObjectType{AttrTypes: objectAttrsTypeRSProvisioningProvisionedLDAPDirectory(false)} + objectAttrs["provisioned_namespace"] = types.ObjectType{AttrTypes: objectAttrsTypeRSProvisioningProvisionedNamespace(false)} return objectAttrs } diff --git a/internal/provider/full-schema-ds.go b/internal/provider/full-schema-ds.go index 3677be2..63241ad 100644 --- a/internal/provider/full-schema-ds.go +++ b/internal/provider/full-schema-ds.go @@ -1241,6 +1241,13 @@ func dataSourceSchemaAttrsGroupAccountGroup(recurse bool) map[string]dsschema.At schemaAttrs["name"] = dsschema.StringAttribute{ Computed: true, } + { + attr := dsschema.SingleNestedAttribute{ + Attributes: dataSourceSchemaAttrsOrganizationOrganizationalUnitPrimer(recurse), + } + attr.Computed = true + schemaAttrs["organizational_unit"] = attr + } schemaAttrs["uuid"] = dsschema.StringAttribute{ Required: recurse, Computed: !recurse, @@ -1346,6 +1353,13 @@ func dataSourceSchemaAttrsGroupGroup(recurse bool) map[string]dsschema.Attribute schemaAttrs["name"] = dsschema.StringAttribute{ Computed: true, } + { + attr := dsschema.SingleNestedAttribute{ + Attributes: dataSourceSchemaAttrsOrganizationOrganizationalUnitPrimer(recurse), + } + attr.Computed = true + schemaAttrs["organizational_unit"] = attr + } schemaAttrs["uuid"] = dsschema.StringAttribute{ Required: recurse, Computed: !recurse, @@ -1434,13 +1448,6 @@ func dataSourceSchemaAttrsGroupGroup(recurse bool) map[string]dsschema.Attribute attr.Computed = true schemaAttrs["nested_under"] = attr } - { - attr := dsschema.SingleNestedAttribute{ - Attributes: dataSourceSchemaAttrsOrganizationOrganizationalUnitPrimer(false), - } - attr.Computed = true - schemaAttrs["organizational_unit"] = attr - } schemaAttrs["private_group"] = dsschema.BoolAttribute{ Computed: true, } @@ -2047,6 +2054,13 @@ func dataSourceSchemaAttrsGroupGroupPrimer(recurse bool) map[string]dsschema.Att schemaAttrs["name"] = dsschema.StringAttribute{ Computed: true, } + { + attr := dsschema.SingleNestedAttribute{ + Attributes: dataSourceSchemaAttrsOrganizationOrganizationalUnitPrimer(recurse), + } + attr.Computed = true + schemaAttrs["organizational_unit"] = attr + } schemaAttrs["uuid"] = dsschema.StringAttribute{ Required: recurse, Computed: !recurse, @@ -2852,6 +2866,23 @@ func dataSourceSchemaAttrsProvisioningProvisionedLDAPDirectory(recurse bool) map } return schemaAttrs } +func dataSourceSchemaAttrsProvisioningProvisionedNamespace(recurse bool) map[string]dsschema.Attribute { + schemaAttrs := make(map[string]dsschema.Attribute) + { + attr := dsschema.SingleNestedAttribute{ + Attributes: dataSourceSchemaAttrsProvisioningProvisionedSystemPrimer(recurse), + } + attr.Computed = true + schemaAttrs["base_system"] = attr + } + schemaAttrs["group_dn"] = dsschema.StringAttribute{ + Computed: true, + } + schemaAttrs["service_account_dn"] = dsschema.StringAttribute{ + Computed: true, + } + return schemaAttrs +} func dataSourceSchemaAttrsProvisioningProvisionedSystem(recurse bool) map[string]dsschema.Attribute { schemaAttrs := make(map[string]dsschema.Attribute) if recurse { @@ -2928,6 +2959,9 @@ func dataSourceSchemaAttrsProvisioningProvisionedSystem(recurse bool) map[string schemaAttrs["self_service_new_groups"] = dsschema.BoolAttribute{ Computed: true, } + schemaAttrs["self_service_new_namespaces"] = dsschema.BoolAttribute{ + Computed: true, + } schemaAttrs["self_service_service_accounts"] = dsschema.BoolAttribute{ Computed: true, } @@ -3000,6 +3034,13 @@ func dataSourceSchemaAttrsProvisioningProvisionedSystem(recurse bool) map[string attr.Computed = true schemaAttrs["provisioned_ldap_directory"] = attr } + { + attr := dsschema.SingleNestedAttribute{ + Attributes: dataSourceSchemaAttrsProvisioningProvisionedNamespace(false), + } + attr.Computed = true + schemaAttrs["provisioned_namespace"] = attr + } return schemaAttrs } func dataSourceSchemaAttrsProvisioningProvisionedSystemLinkableWrapper(recurse bool) map[string]dsschema.Attribute { diff --git a/internal/provider/full-schema-rs.go b/internal/provider/full-schema-rs.go index 459d803..a7bd478 100644 --- a/internal/provider/full-schema-rs.go +++ b/internal/provider/full-schema-rs.go @@ -1167,6 +1167,13 @@ func resourceSchemaAttrsGroupGroup(recurse bool) map[string]rsschema.Attribute { stringvalidator.UTF8LengthBetween(0, 255), }, } + schemaAttrs["organizational_unit_uuid"] = rsschema.StringAttribute{ + Computed: true, + Optional: true, + Validators: []validator.String{ + stringvalidator.RegexMatches(regexp.MustCompile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"), "The value must be a valid UUID"), + }, + } schemaAttrs["uuid"] = rsschema.StringAttribute{ Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, @@ -1249,13 +1256,6 @@ func resourceSchemaAttrsGroupGroup(recurse bool) map[string]rsschema.Attribute { stringvalidator.RegexMatches(regexp.MustCompile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"), "The value must be a valid UUID"), }, } - schemaAttrs["organizational_unit_uuid"] = rsschema.StringAttribute{ - Computed: true, - Optional: true, - Validators: []validator.String{ - stringvalidator.RegexMatches(regexp.MustCompile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"), "The value must be a valid UUID"), - }, - } schemaAttrs["private_group"] = rsschema.BoolAttribute{ Computed: true, Optional: true, @@ -1730,6 +1730,13 @@ func resourceSchemaAttrsGroupGroupPrimer(recurse bool) map[string]rsschema.Attri stringvalidator.UTF8LengthBetween(0, 255), }, } + schemaAttrs["organizational_unit_uuid"] = rsschema.StringAttribute{ + Computed: true, + Optional: true, + Validators: []validator.String{ + stringvalidator.RegexMatches(regexp.MustCompile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"), "The value must be a valid UUID"), + }, + } schemaAttrs["uuid"] = rsschema.StringAttribute{ Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, @@ -2725,6 +2732,28 @@ func resourceSchemaAttrsProvisioningProvisionedLDAPDirectory(recurse bool) map[s } return schemaAttrs } +func resourceSchemaAttrsProvisioningProvisionedNamespace(recurse bool) map[string]rsschema.Attribute { + schemaAttrs := make(map[string]rsschema.Attribute) + schemaAttrs["base_system_uuid"] = rsschema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.RegexMatches(regexp.MustCompile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"), "The value must be a valid UUID"), + }, + } + schemaAttrs["group_dn"] = rsschema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.UTF8LengthBetween(0, 255), + }, + } + schemaAttrs["service_account_dn"] = rsschema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.UTF8LengthBetween(0, 255), + }, + } + return schemaAttrs +} func resourceSchemaAttrsProvisioningProvisionedSystem(recurse bool) map[string]rsschema.Attribute { schemaAttrs := make(map[string]rsschema.Attribute) if recurse { @@ -2797,6 +2826,11 @@ func resourceSchemaAttrsProvisioningProvisionedSystem(recurse bool) map[string]r Optional: true, Default: booldefault.StaticBool(true), } + schemaAttrs["self_service_new_namespaces"] = rsschema.BoolAttribute{ + Computed: true, + Optional: true, + Default: booldefault.StaticBool(true), + } schemaAttrs["self_service_service_accounts"] = rsschema.BoolAttribute{ Computed: true, Optional: true, @@ -2875,6 +2909,13 @@ func resourceSchemaAttrsProvisioningProvisionedSystem(recurse bool) map[string]r attr.Optional = true schemaAttrs["provisioned_ldap_directory"] = attr } + { + attr := rsschema.SingleNestedAttribute{ + Attributes: resourceSchemaAttrsProvisioningProvisionedNamespace(false), + } + attr.Optional = true + schemaAttrs["provisioned_namespace"] = attr + } return schemaAttrs } func resourceSchemaAttrsProvisioningProvisionedSystemLinkableWrapper(recurse bool) map[string]rsschema.Attribute { @@ -3687,7 +3728,7 @@ func resourceSchemaAttrsWebhookWebhook(recurse bool) map[string]rsschema.Attribu Validators: []validator.List{ listvalidator.ValueStringsAre( stringvalidator.OneOf( - "ACCOUNT_2FA_DISABLED", "ACCOUNT_2FA_ENABLED", "ACCOUNT_ADDED_TO_GROUP", "ACCOUNT_ADDED_TO_ORGANIZATIONAL_UNIT", "ACCOUNT_CREATED", "ACCOUNT_DEPROVISIONED", "ACCOUNT_DISABLED", "ACCOUNT_ENABLED", "ACCOUNT_GROUP_ACTIVATED", "ACCOUNT_GROUP_ACTIVATION_REASON", "ACCOUNT_GROUP_DEPROVISIONED", "ACCOUNT_GROUP_PROVISIONED", "ACCOUNT_LOGIN", "ACCOUNT_LOGIN_FAILED", "ACCOUNT_MODIFIED_FOR_GROUP", "ACCOUNT_PASSWORD_CHANGED", "ACCOUNT_PROVISIONED", "ACCOUNT_PROVISIONING_DESTROYED", "ACCOUNT_PROVISIONING_INITED", "ACCOUNT_PROVISIONING_SETUP", "ACCOUNT_REMOVED", "ACCOUNT_REMOVED_FROM_GROUP", "ACCOUNT_REMOVED_FROM_ORGANIZATIONAL_UNIT", "ACCOUNT_REREGISTERED", "ACCOUNT_SSH_PUBLIC_KEY_MODIFIED", "ACCOUNT_TOKEN_SIGNED", "ACCOUNT_TOTP_OFFSET_CHANGED", "ACCOUNT_VAULT_UNLOCKED", "ADD_GROUP_ADMIN_ACCEPTED", "ADD_GROUP_ADMIN_DECLINED", "ADD_GROUP_ADMIN_REQUESTED", "AUDITOR_EXPORT_GENERATED", "CERTIFICATE_CREATED", "CERTIFICATE_MODIFIED", "CERTIFICATE_REMOVED", "CLIENT_ADDED_TO_GROUP", "CLIENT_CREATED", "CLIENT_MODIFIED", "CLIENT_MODIFIED_FOR_GROUP", "CLIENT_PERMISSION_GRANTED", "CLIENT_PERMISSION_REVOKED", "CLIENT_REMOVED", "CLIENT_REMOVED_FROM_GROUP", "CLIENT_SECRET_ROTATED", "CREATE_GROUP_ACCEPTED", "CREATE_GROUP_DECLINED", "CREATE_GROUP_REQUESTED", "CREATE_GROUP_ON_SYSTEM_ACCEPTED", "CREATE_GROUP_ON_SYSTEM_DECLINED", "CREATE_GROUP_ON_SYSTEM_REQUESTED", "CREATE_SERVICE_ACCOUNT_ACCEPTED", "CREATE_SERVICE_ACCOUNT_DECLINED", "CREATE_SERVICE_ACCOUNT_REQUESTED", "DIRECTORY_CREATED", "DIRECTORY_HELPDESK_MODIFIED", "DIRECTORY_MODIFIED", "DIRECTORY_REMOVED", "DISABLE_2FA_ACCEPTED", "DISABLE_2FA_DECLINED", "DISABLE_2FA_REQUESTED", "ENABLE_TECHNICAL_ADMINISTRATION_ACCEPTED", "ENABLE_TECHNICAL_ADMINISTRATION_DECLINED", "ENABLE_TECHNICAL_ADMINISTRATION_REQUESTED", "EXTENDED_ACCESS_ACCEPTED", "EXTENDED_ACCESS_DECLINED", "EXTENDED_ACCESS_REQUESTED", "GRANT_ACCESS_ACCEPTED", "GRANT_ACCESS_DECLINED", "GRANT_ACCESS_REQUESTED", "GRANT_APPLICATION_ACCEPTED", "GRANT_APPLICATION_DECLINED", "GRANT_APPLICATION_REQUESTED", "GRANT_CLIENT_PERMISSION_ACCEPTED", "GRANT_CLIENT_PERMISSION_DECLINED", "GRANT_CLIENT_PERMISSION_REQUESTED", "GRANT_GROUP_ON_SYSTEM_ACCEPTED", "GRANT_GROUP_ON_SYSTEM_DECLINED", "GRANT_GROUP_ON_SYSTEM_REQUESTED", "GRANT_GROUP_ON_SYSTEM_REQUEST_ACCEPTED", "GRANT_GROUP_ON_SYSTEM_REQUEST_DECLINED", "GRANT_GROUP_ON_SYSTEM_REQUEST_REQUESTED", "GRANT_SERVICE_ACCOUNT_GROUP_ACCEPTED", "GRANT_SERVICE_ACCOUNT_GROUP_DECLINED", "GRANT_SERVICE_ACCOUNT_GROUP_REQUESTED", "GROUP_AUDIT_CREATED", "GROUP_AUDIT_REQUESTED", "GROUP_AUTHORIZATION_CONNECTED", "GROUP_AUTHORIZATION_DISCONNECTED", "GROUP_CLASSIFICATION_ASSIGNED", "GROUP_CLASSIFICATION_CREATED", "GROUP_CLASSIFICATION_MODIFIED", "GROUP_CLASSIFICATION_REMOVED", "GROUP_CREATED", "GROUP_MODIFIED", "GROUP_NESTING_CONNECTED", "GROUP_NESTING_DISCONNECTED", "GROUP_ON_SYSTEM_CREATED", "GROUP_ON_SYSTEM_DEPROVISIONED", "GROUP_ON_SYSTEM_PROVISIONED", "GROUP_ON_SYSTEM_REMOVED", "GROUP_REMOVED", "INTERNAL_ACCOUNT_ACTIVATED", "INTERNAL_ACCOUNT_CREATED", "INTERNAL_ACCOUNT_MODIFIED", "INTERNAL_ACCOUNT_REMOVED", "INVALID_SIGNATURE_DETECTED", "JOIN_GROUP_ACCEPTED", "JOIN_GROUP_DECLINED", "JOIN_GROUP_REQUESTED", "JOIN_VAULT_ACCEPTED", "JOIN_VAULT_DECLINED", "JOIN_VAULT_REQUESTED", "LICENSE_KEY_UPLOADED", "ORGANIZATIONAL_UNIT_CREATED", "ORGANIZATIONAL_UNIT_MODIFIED", "ORGANIZATIONAL_UNIT_REMOVED", "PROVISIONED_SYSTEM_ADDED_TO_GROUP", "PROVISIONED_SYSTEM_CREATED", "PROVISIONED_SYSTEM_MODIFIED", "PROVISIONED_SYSTEM_MODIFIED_FOR_GROUP", "PROVISIONED_SYSTEM_REMOVED", "PROVISIONED_SYSTEM_REMOVED_FROM_GROUP", "PROVISIONED_SYSTEM_UNKNOWN_ACCOUNT_DESTROYED", "REMOVE_GROUP_ACCEPTED", "REMOVE_GROUP_DECLINED", "REMOVE_GROUP_REQUESTED", "REMOVE_ORGANIZATIONAL_UNIT_ACCEPTED", "REMOVE_ORGANIZATIONAL_UNIT_DECLINED", "REMOVE_ORGANIZATIONAL_UNIT_REQUESTED", "REMOVE_PROVISIONED_SYSTEM_ACCEPTED", "REMOVE_PROVISIONED_SYSTEM_DECLINED", "REMOVE_PROVISIONED_SYSTEM_REQUESTED", "RESET_PASSWORD_ACCEPTED", "RESET_PASSWORD_DECLINED", "RESET_PASSWORD_FINISHED", "RESET_PASSWORD_REQUESTED", "REVIEW_AUDIT_ACCEPTED", "REVIEW_AUDIT_DECLINED", "REVIEW_AUDIT_REQUESTED", "REVOKE_ADMIN_ACCEPTED", "REVOKE_ADMIN_DECLINED", "REVOKE_ADMIN_REQUESTED", "SERVICE_ACCOUNT_ADDED_TO_GROUP", "SERVICE_ACCOUNT_CREATED", "SERVICE_ACCOUNT_GROUP_DEPROVISIONED", "SERVICE_ACCOUNT_GROUP_PROVISIONED", "SERVICE_ACCOUNT_MODIFIED", "SERVICE_ACCOUNT_PASSWORD_ROTATED", "SERVICE_ACCOUNT_PROVISIONING_DESTROYED", "SERVICE_ACCOUNT_PROVISIONING_INITED", "SERVICE_ACCOUNT_REMOVED", "SERVICE_ACCOUNT_REMOVED_FROM_GROUP", "SETUP_AUTHORIZING_GROUP_CONNECT_ACCEPTED", "SETUP_AUTHORIZING_GROUP_CONNECT_DECLINED", "SETUP_AUTHORIZING_GROUP_CONNECT_REQUESTED", "SETUP_AUTHORIZING_GROUP_DISCONNECT_ACCEPTED", "SETUP_AUTHORIZING_GROUP_DISCONNECT_DECLINED", "SETUP_AUTHORIZING_GROUP_DISCONNECT_REQUESTED", "SETUP_NESTED_GROUP_CONNECT_ACCEPTED", "SETUP_NESTED_GROUP_CONNECT_DECLINED", "SETUP_NESTED_GROUP_CONNECT_REQUESTED", "SETUP_NESTED_GROUP_DISCONNECT_ACCEPTED", "SETUP_NESTED_GROUP_DISCONNECT_DECLINED", "SETUP_NESTED_GROUP_DISCONNECT_REQUESTED", "TRANSFER_APPLICATION_ADMINISTRATION_ACCEPTED", "TRANSFER_APPLICATION_ADMINISTRATION_DECLINED", "TRANSFER_APPLICATION_ADMINISTRATION_REQUESTED", "TRANSFER_APPLICATION_OWNERSHIP_ACCEPTED", "TRANSFER_APPLICATION_OWNERSHIP_DECLINED", "TRANSFER_APPLICATION_OWNERSHIP_REQUESTED", "TRANSFER_GROUP_ON_SYSTEM_OWNERSHIP_ACCEPTED", "TRANSFER_GROUP_ON_SYSTEM_OWNERSHIP_DECLINED", "TRANSFER_GROUP_ON_SYSTEM_OWNERSHIP_REQUESTED", "TRANSFER_ORGANIZATIONAL_UNIT_OWNERSHIP_ACCEPTED", "TRANSFER_ORGANIZATIONAL_UNIT_OWNERSHIP_DECLINED", "TRANSFER_ORGANIZATIONAL_UNIT_OWNERSHIP_REQUESTED", "TRANSFER_PROVISIONED_SYSTEM_ADMINISTRATION_ACCEPTED", "TRANSFER_PROVISIONED_SYSTEM_ADMINISTRATION_DECLINED", "TRANSFER_PROVISIONED_SYSTEM_ADMINISTRATION_REQUESTED", "TRANSFER_PROVISIONED_SYSTEM_CONTENT_ADMINISTRATION_ACCEPTED", "TRANSFER_PROVISIONED_SYSTEM_CONTENT_ADMINISTRATION_DECLINED", "TRANSFER_PROVISIONED_SYSTEM_CONTENT_ADMINISTRATION_REQUESTED", "TRANSFER_PROVISIONED_SYSTEM_OWNERSHIP_ACCEPTED", "TRANSFER_PROVISIONED_SYSTEM_OWNERSHIP_DECLINED", "TRANSFER_PROVISIONED_SYSTEM_OWNERSHIP_REQUESTED", "TRANSFER_SERVICE_ACCOUNT_ADMINISTRATION_ACCEPTED", "TRANSFER_SERVICE_ACCOUNT_ADMINISTRATION_DECLINED", "TRANSFER_SERVICE_ACCOUNT_ADMINISTRATION_REQUESTED", "TRANSFER_AUDITOR_GROUP_ACCEPTED", "TRANSFER_AUDITOR_GROUP_DECLINED", "TRANSFER_AUDITOR_GROUP_REQUESTED", "UPDATE_GROUP_MEMBERSHIP_ACCEPTED", "UPDATE_GROUP_MEMBERSHIP_DECLINED", "UPDATE_GROUP_MEMBERSHIP_REQUESTED", "VAULT_ACCESS_RESTORED", "VAULT_EXPORTED", "VAULT_PERSONAL_RESET", "VAULT_PERSONAL_SETUP", "VAULT_RECORD_CREATED", "VAULT_RECORD_MODIFIED", "VAULT_RECORD_MOVED_COPIED_SHARED", "VAULT_RECORD_READ", "VAULT_RECORD_REMOVED", "VAULT_RECOVERED", "VERIFY_INTERNAL_ACCOUNT_ACCEPTED", "VERIFY_INTERNAL_ACCOUNT_DECLINED", "VERIFY_INTERNAL_ACCOUNT_REQUESTED", "WEBHOOK_CREATED", "WEBHOOK_MODIFIED", "WEBHOOK_REMOVED", + "ACCOUNT_2FA_DISABLED", "ACCOUNT_2FA_ENABLED", "ACCOUNT_ADDED_TO_GROUP", "ACCOUNT_ADDED_TO_ORGANIZATIONAL_UNIT", "ACCOUNT_CREATED", "ACCOUNT_DEPROVISIONED", "ACCOUNT_DISABLED", "ACCOUNT_ENABLED", "ACCOUNT_GROUP_ACTIVATED", "ACCOUNT_GROUP_ACTIVATION_REASON", "ACCOUNT_GROUP_DEPROVISIONED", "ACCOUNT_GROUP_PROVISIONED", "ACCOUNT_LOGIN", "ACCOUNT_LOGIN_FAILED", "ACCOUNT_MODIFIED_FOR_GROUP", "ACCOUNT_PASSWORD_CHANGED", "ACCOUNT_PROVISIONED", "ACCOUNT_PROVISIONING_DESTROYED", "ACCOUNT_PROVISIONING_INITED", "ACCOUNT_PROVISIONING_SETUP", "ACCOUNT_REMOVED", "ACCOUNT_REMOVED_FROM_GROUP", "ACCOUNT_REMOVED_FROM_ORGANIZATIONAL_UNIT", "ACCOUNT_REREGISTERED", "ACCOUNT_SSH_PUBLIC_KEY_MODIFIED", "ACCOUNT_TOKEN_SIGNED", "ACCOUNT_TOTP_OFFSET_CHANGED", "ACCOUNT_VAULT_UNLOCKED", "ADD_GROUP_ADMIN_ACCEPTED", "ADD_GROUP_ADMIN_DECLINED", "ADD_GROUP_ADMIN_REQUESTED", "AUDITOR_EXPORT_GENERATED", "CERTIFICATE_CREATED", "CERTIFICATE_MODIFIED", "CERTIFICATE_REMOVED", "CLIENT_ADDED_TO_GROUP", "CLIENT_CREATED", "CLIENT_MODIFIED", "CLIENT_MODIFIED_FOR_GROUP", "CLIENT_PERMISSION_GRANTED", "CLIENT_PERMISSION_REVOKED", "CLIENT_REMOVED", "CLIENT_REMOVED_FROM_GROUP", "CLIENT_SECRET_ROTATED", "CREATE_GROUP_ACCEPTED", "CREATE_GROUP_DECLINED", "CREATE_GROUP_REQUESTED", "CREATE_GROUP_ON_SYSTEM_ACCEPTED", "CREATE_GROUP_ON_SYSTEM_DECLINED", "CREATE_GROUP_ON_SYSTEM_REQUESTED", "CREATE_PROVISIONED_NAMESPACE_ACCEPTED", "CREATE_PROVISIONED_NAMESPACE_DECLINED", "CREATE_PROVISIONED_NAMESPACE_REQUESTED", "CREATE_SERVICE_ACCOUNT_ACCEPTED", "CREATE_SERVICE_ACCOUNT_DECLINED", "CREATE_SERVICE_ACCOUNT_REQUESTED", "DIRECTORY_CREATED", "DIRECTORY_HELPDESK_MODIFIED", "DIRECTORY_MODIFIED", "DIRECTORY_REMOVED", "DISABLE_2FA_ACCEPTED", "DISABLE_2FA_DECLINED", "DISABLE_2FA_REQUESTED", "ENABLE_TECHNICAL_ADMINISTRATION_ACCEPTED", "ENABLE_TECHNICAL_ADMINISTRATION_DECLINED", "ENABLE_TECHNICAL_ADMINISTRATION_REQUESTED", "EXTENDED_ACCESS_ACCEPTED", "EXTENDED_ACCESS_DECLINED", "EXTENDED_ACCESS_REQUESTED", "GRANT_ACCESS_ACCEPTED", "GRANT_ACCESS_DECLINED", "GRANT_ACCESS_REQUESTED", "GRANT_APPLICATION_ACCEPTED", "GRANT_APPLICATION_DECLINED", "GRANT_APPLICATION_REQUESTED", "GRANT_CLIENT_PERMISSION_ACCEPTED", "GRANT_CLIENT_PERMISSION_DECLINED", "GRANT_CLIENT_PERMISSION_REQUESTED", "GRANT_GROUP_ON_SYSTEM_ACCEPTED", "GRANT_GROUP_ON_SYSTEM_DECLINED", "GRANT_GROUP_ON_SYSTEM_REQUESTED", "GRANT_GROUP_ON_SYSTEM_REQUEST_ACCEPTED", "GRANT_GROUP_ON_SYSTEM_REQUEST_DECLINED", "GRANT_GROUP_ON_SYSTEM_REQUEST_REQUESTED", "GRANT_SERVICE_ACCOUNT_GROUP_ACCEPTED", "GRANT_SERVICE_ACCOUNT_GROUP_DECLINED", "GRANT_SERVICE_ACCOUNT_GROUP_REQUESTED", "GROUP_AUDIT_CREATED", "GROUP_AUDIT_REQUESTED", "GROUP_AUTHORIZATION_CONNECTED", "GROUP_AUTHORIZATION_DISCONNECTED", "GROUP_CLASSIFICATION_ASSIGNED", "GROUP_CLASSIFICATION_CREATED", "GROUP_CLASSIFICATION_MODIFIED", "GROUP_CLASSIFICATION_REMOVED", "GROUP_CREATED", "GROUP_MODIFIED", "GROUP_NESTING_CONNECTED", "GROUP_NESTING_DISCONNECTED", "GROUP_ON_SYSTEM_CREATED", "GROUP_ON_SYSTEM_DEPROVISIONED", "GROUP_ON_SYSTEM_PROVISIONED", "GROUP_ON_SYSTEM_REMOVED", "GROUP_REMOVED", "INTERNAL_ACCOUNT_ACTIVATED", "INTERNAL_ACCOUNT_CREATED", "INTERNAL_ACCOUNT_MODIFIED", "INTERNAL_ACCOUNT_REMOVED", "INVALID_SIGNATURE_DETECTED", "JOIN_GROUP_ACCEPTED", "JOIN_GROUP_DECLINED", "JOIN_GROUP_REQUESTED", "JOIN_VAULT_ACCEPTED", "JOIN_VAULT_DECLINED", "JOIN_VAULT_REQUESTED", "LICENSE_KEY_UPLOADED", "ORGANIZATIONAL_UNIT_CREATED", "ORGANIZATIONAL_UNIT_MODIFIED", "ORGANIZATIONAL_UNIT_REMOVED", "PROVISIONED_SYSTEM_ADDED_TO_GROUP", "PROVISIONED_SYSTEM_CREATED", "PROVISIONED_SYSTEM_MODIFIED", "PROVISIONED_SYSTEM_MODIFIED_FOR_GROUP", "PROVISIONED_SYSTEM_REMOVED", "PROVISIONED_SYSTEM_REMOVED_FROM_GROUP", "PROVISIONED_SYSTEM_UNKNOWN_ACCOUNT_DESTROYED", "REMOVE_GROUP_ACCEPTED", "REMOVE_GROUP_DECLINED", "REMOVE_GROUP_REQUESTED", "REMOVE_ORGANIZATIONAL_UNIT_ACCEPTED", "REMOVE_ORGANIZATIONAL_UNIT_DECLINED", "REMOVE_ORGANIZATIONAL_UNIT_REQUESTED", "REMOVE_PROVISIONED_SYSTEM_ACCEPTED", "REMOVE_PROVISIONED_SYSTEM_DECLINED", "REMOVE_PROVISIONED_SYSTEM_REQUESTED", "RESET_PASSWORD_ACCEPTED", "RESET_PASSWORD_DECLINED", "RESET_PASSWORD_FINISHED", "RESET_PASSWORD_REQUESTED", "REVIEW_AUDIT_ACCEPTED", "REVIEW_AUDIT_DECLINED", "REVIEW_AUDIT_REQUESTED", "REVOKE_ADMIN_ACCEPTED", "REVOKE_ADMIN_DECLINED", "REVOKE_ADMIN_REQUESTED", "SERVICE_ACCOUNT_ADDED_TO_GROUP", "SERVICE_ACCOUNT_CREATED", "SERVICE_ACCOUNT_GROUP_DEPROVISIONED", "SERVICE_ACCOUNT_GROUP_PROVISIONED", "SERVICE_ACCOUNT_MODIFIED", "SERVICE_ACCOUNT_PASSWORD_ROTATED", "SERVICE_ACCOUNT_PROVISIONING_DESTROYED", "SERVICE_ACCOUNT_PROVISIONING_INITED", "SERVICE_ACCOUNT_REMOVED", "SERVICE_ACCOUNT_REMOVED_FROM_GROUP", "SETUP_AUTHORIZING_GROUP_CONNECT_ACCEPTED", "SETUP_AUTHORIZING_GROUP_CONNECT_DECLINED", "SETUP_AUTHORIZING_GROUP_CONNECT_REQUESTED", "SETUP_AUTHORIZING_GROUP_DISCONNECT_ACCEPTED", "SETUP_AUTHORIZING_GROUP_DISCONNECT_DECLINED", "SETUP_AUTHORIZING_GROUP_DISCONNECT_REQUESTED", "SETUP_NESTED_GROUP_CONNECT_ACCEPTED", "SETUP_NESTED_GROUP_CONNECT_DECLINED", "SETUP_NESTED_GROUP_CONNECT_REQUESTED", "SETUP_NESTED_GROUP_DISCONNECT_ACCEPTED", "SETUP_NESTED_GROUP_DISCONNECT_DECLINED", "SETUP_NESTED_GROUP_DISCONNECT_REQUESTED", "TRANSFER_APPLICATION_ADMINISTRATION_ACCEPTED", "TRANSFER_APPLICATION_ADMINISTRATION_DECLINED", "TRANSFER_APPLICATION_ADMINISTRATION_REQUESTED", "TRANSFER_APPLICATION_OWNERSHIP_ACCEPTED", "TRANSFER_APPLICATION_OWNERSHIP_DECLINED", "TRANSFER_APPLICATION_OWNERSHIP_REQUESTED", "TRANSFER_GROUP_ON_SYSTEM_OWNERSHIP_ACCEPTED", "TRANSFER_GROUP_ON_SYSTEM_OWNERSHIP_DECLINED", "TRANSFER_GROUP_ON_SYSTEM_OWNERSHIP_REQUESTED", "TRANSFER_ORGANIZATIONAL_UNIT_OWNERSHIP_ACCEPTED", "TRANSFER_ORGANIZATIONAL_UNIT_OWNERSHIP_DECLINED", "TRANSFER_ORGANIZATIONAL_UNIT_OWNERSHIP_REQUESTED", "TRANSFER_PROVISIONED_SYSTEM_ADMINISTRATION_ACCEPTED", "TRANSFER_PROVISIONED_SYSTEM_ADMINISTRATION_DECLINED", "TRANSFER_PROVISIONED_SYSTEM_ADMINISTRATION_REQUESTED", "TRANSFER_PROVISIONED_SYSTEM_CONTENT_ADMINISTRATION_ACCEPTED", "TRANSFER_PROVISIONED_SYSTEM_CONTENT_ADMINISTRATION_DECLINED", "TRANSFER_PROVISIONED_SYSTEM_CONTENT_ADMINISTRATION_REQUESTED", "TRANSFER_PROVISIONED_SYSTEM_OWNERSHIP_ACCEPTED", "TRANSFER_PROVISIONED_SYSTEM_OWNERSHIP_DECLINED", "TRANSFER_PROVISIONED_SYSTEM_OWNERSHIP_REQUESTED", "TRANSFER_SERVICE_ACCOUNT_ADMINISTRATION_ACCEPTED", "TRANSFER_SERVICE_ACCOUNT_ADMINISTRATION_DECLINED", "TRANSFER_SERVICE_ACCOUNT_ADMINISTRATION_REQUESTED", "TRANSFER_AUDITOR_GROUP_ACCEPTED", "TRANSFER_AUDITOR_GROUP_DECLINED", "TRANSFER_AUDITOR_GROUP_REQUESTED", "UPDATE_GROUP_MEMBERSHIP_ACCEPTED", "UPDATE_GROUP_MEMBERSHIP_DECLINED", "UPDATE_GROUP_MEMBERSHIP_REQUESTED", "VAULT_ACCESS_RESTORED", "VAULT_EXPORTED", "VAULT_PERSONAL_RESET", "VAULT_PERSONAL_SETUP", "VAULT_RECORD_CREATED", "VAULT_RECORD_MODIFIED", "VAULT_RECORD_MOVED_COPIED_SHARED", "VAULT_RECORD_READ", "VAULT_RECORD_REMOVED", "VAULT_RECOVERED", "VERIFY_INTERNAL_ACCOUNT_ACCEPTED", "VERIFY_INTERNAL_ACCOUNT_DECLINED", "VERIFY_INTERNAL_ACCOUNT_REQUESTED", "WEBHOOK_CREATED", "WEBHOOK_MODIFIED", "WEBHOOK_REMOVED", ), ), }, diff --git a/internal/provider/full-tf-to-data-struct-ds.go b/internal/provider/full-tf-to-data-struct-ds.go index d399c5e..1e3d9b3 100644 --- a/internal/provider/full-tf-to-data-struct-ds.go +++ b/internal/provider/full-tf-to-data-struct-ds.go @@ -378,6 +378,7 @@ func fillDataStructFromTFObjectDSGroupAccountGroup(data *groupAccountGroupDataDS data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) data.Admin = obj.Attributes()["admin"].(basetypes.BoolValue) data.Name = obj.Attributes()["name"].(basetypes.StringValue) + data.OrganizationalUnit = obj.Attributes()["organizational_unit"].(basetypes.ObjectValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) @@ -409,6 +410,7 @@ func fillDataStructFromTFObjectDSGroupGroup(data *groupGroupDataDS, obj types.Ob data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) data.Admin = obj.Attributes()["admin"].(basetypes.BoolValue) data.Name = obj.Attributes()["name"].(basetypes.StringValue) + data.OrganizationalUnit = obj.Attributes()["organizational_unit"].(basetypes.ObjectValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Accounts = obj.Attributes()["accounts"].(basetypes.ListValue) @@ -452,7 +454,6 @@ func fillDataStructFromTFObjectDSGroupGroup(data *groupGroupDataDS, obj types.Ob data.ExtendedAccess = obj.Attributes()["extended_access"].(basetypes.StringValue) data.HideAuditTrail = obj.Attributes()["hide_audit_trail"].(basetypes.BoolValue) data.NestedUnder = obj.Attributes()["nested_under"].(basetypes.ObjectValue) - data.OrganizationalUnit = obj.Attributes()["organizational_unit"].(basetypes.ObjectValue) data.PrivateGroup = obj.Attributes()["private_group"].(basetypes.BoolValue) data.RecordTrail = obj.Attributes()["record_trail"].(basetypes.BoolValue) data.RotatingPasswordRequired = obj.Attributes()["rotating_password_required"].(basetypes.BoolValue) @@ -638,6 +639,7 @@ func fillDataStructFromTFObjectDSGroupGroupPrimer(data *groupGroupPrimerDataDS, data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) data.Admin = obj.Attributes()["admin"].(basetypes.BoolValue) data.Name = obj.Attributes()["name"].(basetypes.StringValue) + data.OrganizationalUnit = obj.Attributes()["organizational_unit"].(basetypes.ObjectValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) } @@ -877,6 +879,12 @@ func fillDataStructFromTFObjectDSProvisioningProvisionedLDAPDirectory(data *prov data.GroupDN = obj.Attributes()["group_dn"].(basetypes.StringValue) } +func fillDataStructFromTFObjectDSProvisioningProvisionedNamespace(data *provisioningProvisionedNamespaceDataDS, obj types.Object) { + data.BaseSystem = obj.Attributes()["base_system"].(basetypes.ObjectValue) + data.GroupDN = obj.Attributes()["group_dn"].(basetypes.StringValue) + data.ServiceAccountDN = obj.Attributes()["service_account_dn"].(basetypes.StringValue) +} + func fillDataStructFromTFObjectDSProvisioningProvisionedSystem(data *provisioningProvisionedSystemDataDS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) @@ -900,6 +908,7 @@ func fillDataStructFromTFObjectDSProvisioningProvisionedSystem(data *provisionin data.Owner = obj.Attributes()["owner"].(basetypes.ObjectValue) data.SelfServiceExistingGroups = obj.Attributes()["self_service_existing_groups"].(basetypes.BoolValue) data.SelfServiceNewGroups = obj.Attributes()["self_service_new_groups"].(basetypes.BoolValue) + data.SelfServiceNewNamespaces = obj.Attributes()["self_service_new_namespaces"].(basetypes.BoolValue) data.SelfServiceServiceAccounts = obj.Attributes()["self_service_service_accounts"].(basetypes.BoolValue) data.ShouldDestroyUnknownAccounts = obj.Attributes()["should_destroy_unknown_accounts"].(basetypes.BoolValue) data.TechnicalAdministrator = obj.Attributes()["technical_administrator"].(basetypes.ObjectValue) @@ -912,6 +921,7 @@ func fillDataStructFromTFObjectDSProvisioningProvisionedSystem(data *provisionin data.ProvisionedInternalLDAP = obj.Attributes()["provisioned_internal_ldap"].(basetypes.ObjectValue) data.ProvisionedLDAP = obj.Attributes()["provisioned_ldap"].(basetypes.ObjectValue) data.ProvisionedLDAPDirectory = obj.Attributes()["provisioned_ldap_directory"].(basetypes.ObjectValue) + data.ProvisionedNamespace = obj.Attributes()["provisioned_namespace"].(basetypes.ObjectValue) } func fillDataStructFromTFObjectDSProvisioningProvisionedSystemLinkableWrapper(data *provisioningProvisionedSystemLinkableWrapperDataDS, obj types.Object) { diff --git a/internal/provider/full-tf-to-data-struct-rs.go b/internal/provider/full-tf-to-data-struct-rs.go index 1b3fc4d..7461d1d 100644 --- a/internal/provider/full-tf-to-data-struct-rs.go +++ b/internal/provider/full-tf-to-data-struct-rs.go @@ -311,6 +311,7 @@ func fillDataStructFromTFObjectRSGroupGroup(data *groupGroupDataRS, obj types.Ob data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) data.Admin = obj.Attributes()["admin"].(basetypes.BoolValue) data.Name = obj.Attributes()["name"].(basetypes.StringValue) + data.OrganizationalUnitUUID = obj.Attributes()["organizational_unit_uuid"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) data.Accounts = obj.Attributes()["accounts"].(basetypes.ListValue) data.AdministeredClients = obj.Attributes()["administered_clients"].(basetypes.ListValue) @@ -353,7 +354,6 @@ func fillDataStructFromTFObjectRSGroupGroup(data *groupGroupDataRS, obj types.Ob data.ExtendedAccess = obj.Attributes()["extended_access"].(basetypes.StringValue) data.HideAuditTrail = obj.Attributes()["hide_audit_trail"].(basetypes.BoolValue) data.NestedUnderUUID = obj.Attributes()["nested_under_uuid"].(basetypes.StringValue) - data.OrganizationalUnitUUID = obj.Attributes()["organizational_unit_uuid"].(basetypes.StringValue) data.PrivateGroup = obj.Attributes()["private_group"].(basetypes.BoolValue) data.RecordTrail = obj.Attributes()["record_trail"].(basetypes.BoolValue) data.RotatingPasswordRequired = obj.Attributes()["rotating_password_required"].(basetypes.BoolValue) @@ -487,6 +487,7 @@ func fillDataStructFromTFObjectRSGroupGroupPrimer(data *groupGroupPrimerDataRS, data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) data.Admin = obj.Attributes()["admin"].(basetypes.BoolValue) data.Name = obj.Attributes()["name"].(basetypes.StringValue) + data.OrganizationalUnitUUID = obj.Attributes()["organizational_unit_uuid"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) } @@ -761,6 +762,12 @@ func fillDataStructFromTFObjectRSProvisioningProvisionedLDAPDirectory(data *prov data.GroupDN = obj.Attributes()["group_dn"].(basetypes.StringValue) } +func fillDataStructFromTFObjectRSProvisioningProvisionedNamespace(data *provisioningProvisionedNamespaceDataRS, obj types.Object) { + data.BaseSystemUUID = obj.Attributes()["base_system_uuid"].(basetypes.StringValue) + data.GroupDN = obj.Attributes()["group_dn"].(basetypes.StringValue) + data.ServiceAccountDN = obj.Attributes()["service_account_dn"].(basetypes.StringValue) +} + func fillDataStructFromTFObjectRSProvisioningProvisionedSystem(data *provisioningProvisionedSystemDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) @@ -783,6 +790,7 @@ func fillDataStructFromTFObjectRSProvisioningProvisionedSystem(data *provisionin data.OwnerUUID = obj.Attributes()["owner_uuid"].(basetypes.StringValue) data.SelfServiceExistingGroups = obj.Attributes()["self_service_existing_groups"].(basetypes.BoolValue) data.SelfServiceNewGroups = obj.Attributes()["self_service_new_groups"].(basetypes.BoolValue) + data.SelfServiceNewNamespaces = obj.Attributes()["self_service_new_namespaces"].(basetypes.BoolValue) data.SelfServiceServiceAccounts = obj.Attributes()["self_service_service_accounts"].(basetypes.BoolValue) data.ShouldDestroyUnknownAccounts = obj.Attributes()["should_destroy_unknown_accounts"].(basetypes.BoolValue) data.TechnicalAdministratorUUID = obj.Attributes()["technical_administrator_uuid"].(basetypes.StringValue) @@ -795,6 +803,7 @@ func fillDataStructFromTFObjectRSProvisioningProvisionedSystem(data *provisionin data.ProvisionedInternalLDAP = obj.Attributes()["provisioned_internal_ldap"].(basetypes.ObjectValue) data.ProvisionedLDAP = obj.Attributes()["provisioned_ldap"].(basetypes.ObjectValue) data.ProvisionedLDAPDirectory = obj.Attributes()["provisioned_ldap_directory"].(basetypes.ObjectValue) + data.ProvisionedNamespace = obj.Attributes()["provisioned_namespace"].(basetypes.ObjectValue) } func fillDataStructFromTFObjectRSProvisioningProvisionedSystemLinkableWrapper(data *provisioningProvisionedSystemLinkableWrapperDataRS, obj types.Object) { diff --git a/internal/provider/full-tf-to-tkh-ds.go b/internal/provider/full-tf-to-tkh-ds.go index 9cd01a9..668d0d4 100644 --- a/internal/provider/full-tf-to-tkh-ds.go +++ b/internal/provider/full-tf-to-tkh-ds.go @@ -1389,6 +1389,11 @@ func tfObjectToTKHDSGroupAccountGroup(ctx context.Context, recurse bool, objVal } tkh.SetAdmin(objAttrs["admin"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetName(objAttrs["name"].(basetypes.StringValue).ValueStringPointer()) + { + val, d := tfObjectToTKHDSOrganizationOrganizationalUnitPrimer(ctx, recurse, objAttrs["organizational_unit"].(basetypes.ObjectValue)) + diags.Append(d...) + tkh.SetOrganizationalUnit(val) + } tkh.SetUuid(objAttrs["uuid"].(basetypes.StringValue).ValueStringPointer()) { val, d := parsePointer2(objAttrs["end_date"].(basetypes.StringValue), serialization.ParseDateOnly) @@ -1516,6 +1521,11 @@ func tfObjectToTKHDSGroupGroup(ctx context.Context, recurse bool, objVal types.O } tkh.SetAdmin(objAttrs["admin"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetName(objAttrs["name"].(basetypes.StringValue).ValueStringPointer()) + { + val, d := tfObjectToTKHDSOrganizationOrganizationalUnitPrimer(ctx, recurse, objAttrs["organizational_unit"].(basetypes.ObjectValue)) + diags.Append(d...) + tkh.SetOrganizationalUnit(val) + } tkh.SetUuid(objAttrs["uuid"].(basetypes.StringValue).ValueStringPointer()) tkh.SetApplicationAdministration(objAttrs["application_administration"].(basetypes.BoolValue).ValueBoolPointer()) { @@ -1575,11 +1585,6 @@ func tfObjectToTKHDSGroupGroup(ctx context.Context, recurse bool, objVal types.O diags.Append(d...) tkh.SetNestedUnder(val) } - { - val, d := tfObjectToTKHDSOrganizationOrganizationalUnitPrimer(ctx, false, objAttrs["organizational_unit"].(basetypes.ObjectValue)) - diags.Append(d...) - tkh.SetOrganizationalUnit(val) - } tkh.SetPrivateGroup(objAttrs["private_group"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetRecordTrail(objAttrs["record_trail"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetRotatingPasswordRequired(objAttrs["rotating_password_required"].(basetypes.BoolValue).ValueBoolPointer()) @@ -2288,6 +2293,11 @@ func tfObjectToTKHDSGroupGroupPrimer(ctx context.Context, recurse bool, objVal t } tkh.SetAdmin(objAttrs["admin"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetName(objAttrs["name"].(basetypes.StringValue).ValueStringPointer()) + { + val, d := tfObjectToTKHDSOrganizationOrganizationalUnitPrimer(ctx, recurse, objAttrs["organizational_unit"].(basetypes.ObjectValue)) + diags.Append(d...) + tkh.SetOrganizationalUnit(val) + } tkh.SetUuid(objAttrs["uuid"].(basetypes.StringValue).ValueStringPointer()) return tkh, diags } @@ -3229,6 +3239,24 @@ func tfObjectToTKHDSProvisioningProvisionedLDAPDirectory(ctx context.Context, re return tkh, diags } +func tfObjectToTKHDSProvisioningProvisionedNamespace(ctx context.Context, recurse bool, objVal types.Object) (keyhubmodel.ProvisioningProvisionedNamespaceable, diag.Diagnostics) { + var diags diag.Diagnostics + if objVal.IsNull() || objVal.IsUnknown() { + return nil, diags + } + objAttrs := objVal.Attributes() + var tkh keyhubmodel.ProvisioningProvisionedNamespaceable + tkh = keyhubmodel.NewProvisioningProvisionedNamespace() + { + val, d := tfObjectToTKHDSProvisioningProvisionedSystemPrimer(ctx, recurse, objAttrs["base_system"].(basetypes.ObjectValue)) + diags.Append(d...) + tkh.SetBaseSystem(val) + } + tkh.SetGroupDN(objAttrs["group_dn"].(basetypes.StringValue).ValueStringPointer()) + tkh.SetServiceAccountDN(objAttrs["service_account_dn"].(basetypes.StringValue).ValueStringPointer()) + return tkh, diags +} + func tfObjectToTKHDSProvisioningProvisionedSystem(ctx context.Context, recurse bool, objVal types.Object) (keyhubmodel.ProvisioningProvisionedSystemable, diag.Diagnostics) { var diags diag.Diagnostics if objVal.IsNull() || objVal.IsUnknown() { @@ -3288,6 +3316,7 @@ func tfObjectToTKHDSProvisioningProvisionedSystem(ctx context.Context, recurse b } tkh.SetSelfServiceExistingGroups(objAttrs["self_service_existing_groups"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetSelfServiceNewGroups(objAttrs["self_service_new_groups"].(basetypes.BoolValue).ValueBoolPointer()) + tkh.SetSelfServiceNewNamespaces(objAttrs["self_service_new_namespaces"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetSelfServiceServiceAccounts(objAttrs["self_service_service_accounts"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetShouldDestroyUnknownAccounts(objAttrs["should_destroy_unknown_accounts"].(basetypes.BoolValue).ValueBoolPointer()) { @@ -3360,6 +3389,14 @@ func tfObjectToTKHDSProvisioningProvisionedSystem(ctx context.Context, recurse b val.SetTypeEscaped(dtype) tkh = val } + if !objAttrs["provisioned_namespace"].IsNull() { + val, d := tfObjectToTKHDSProvisioningProvisionedNamespace(ctx, false, objAttrs["provisioned_namespace"].(basetypes.ObjectValue)) + diags.Append(d...) + dtype := val.GetTypeEscaped() + (*val.(*keyhubmodel.ProvisioningProvisionedNamespace)).ProvisioningProvisionedSystem = *tkh.(*keyhubmodel.ProvisioningProvisionedSystem) + val.SetTypeEscaped(dtype) + tkh = val + } if recurse { { val, d := tfObjectToTKHDSProvisioningProvisionedSystem_additionalObjects(ctx, false, objVal) diff --git a/internal/provider/full-tf-to-tkh-rs.go b/internal/provider/full-tf-to-tkh-rs.go index aab10a9..981b944 100644 --- a/internal/provider/full-tf-to-tkh-rs.go +++ b/internal/provider/full-tf-to-tkh-rs.go @@ -1163,6 +1163,11 @@ func tfObjectToTKHRSGroupGroup(ctx context.Context, recurse bool, objVal types.O } tkh.SetAdmin(objAttrs["admin"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetName(objAttrs["name"].(basetypes.StringValue).ValueStringPointer()) + { + val, d := findOrganizationOrganizationalUnitPrimerByUUID(ctx, objAttrs["organizational_unit_uuid"].(basetypes.StringValue).ValueStringPointer()) + diags.Append(d...) + tkh.SetOrganizationalUnit(val) + } tkh.SetUuid(objAttrs["uuid"].(basetypes.StringValue).ValueStringPointer()) tkh.SetApplicationAdministration(objAttrs["application_administration"].(basetypes.BoolValue).ValueBoolPointer()) { @@ -1222,11 +1227,6 @@ func tfObjectToTKHRSGroupGroup(ctx context.Context, recurse bool, objVal types.O diags.Append(d...) tkh.SetNestedUnder(val) } - { - val, d := findOrganizationOrganizationalUnitPrimerByUUID(ctx, objAttrs["organizational_unit_uuid"].(basetypes.StringValue).ValueStringPointer()) - diags.Append(d...) - tkh.SetOrganizationalUnit(val) - } tkh.SetPrivateGroup(objAttrs["private_group"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetRecordTrail(objAttrs["record_trail"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetRotatingPasswordRequired(objAttrs["rotating_password_required"].(basetypes.BoolValue).ValueBoolPointer()) @@ -1769,6 +1769,11 @@ func tfObjectToTKHRSGroupGroupPrimer(ctx context.Context, recurse bool, objVal t } tkh.SetAdmin(objAttrs["admin"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetName(objAttrs["name"].(basetypes.StringValue).ValueStringPointer()) + { + val, d := findOrganizationOrganizationalUnitPrimerByUUID(ctx, objAttrs["organizational_unit_uuid"].(basetypes.StringValue).ValueStringPointer()) + diags.Append(d...) + tkh.SetOrganizationalUnit(val) + } tkh.SetUuid(objAttrs["uuid"].(basetypes.StringValue).ValueStringPointer()) return tkh, diags } @@ -2888,6 +2893,24 @@ func tfObjectToTKHRSProvisioningProvisionedLDAPDirectory(ctx context.Context, re return tkh, diags } +func tfObjectToTKHRSProvisioningProvisionedNamespace(ctx context.Context, recurse bool, objVal types.Object) (keyhubmodel.ProvisioningProvisionedNamespaceable, diag.Diagnostics) { + var diags diag.Diagnostics + if objVal.IsNull() || objVal.IsUnknown() { + return nil, diags + } + objAttrs := objVal.Attributes() + var tkh keyhubmodel.ProvisioningProvisionedNamespaceable + tkh = keyhubmodel.NewProvisioningProvisionedNamespace() + { + val, d := findProvisioningProvisionedSystemPrimerByUUID(ctx, objAttrs["base_system_uuid"].(basetypes.StringValue).ValueStringPointer()) + diags.Append(d...) + tkh.SetBaseSystem(val) + } + tkh.SetGroupDN(objAttrs["group_dn"].(basetypes.StringValue).ValueStringPointer()) + tkh.SetServiceAccountDN(objAttrs["service_account_dn"].(basetypes.StringValue).ValueStringPointer()) + return tkh, diags +} + func tfObjectToTKHRSProvisioningProvisionedSystem(ctx context.Context, recurse bool, objVal types.Object) (keyhubmodel.ProvisioningProvisionedSystemable, diag.Diagnostics) { var diags diag.Diagnostics if objVal.IsNull() || objVal.IsUnknown() { @@ -2947,6 +2970,7 @@ func tfObjectToTKHRSProvisioningProvisionedSystem(ctx context.Context, recurse b } tkh.SetSelfServiceExistingGroups(objAttrs["self_service_existing_groups"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetSelfServiceNewGroups(objAttrs["self_service_new_groups"].(basetypes.BoolValue).ValueBoolPointer()) + tkh.SetSelfServiceNewNamespaces(objAttrs["self_service_new_namespaces"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetSelfServiceServiceAccounts(objAttrs["self_service_service_accounts"].(basetypes.BoolValue).ValueBoolPointer()) tkh.SetShouldDestroyUnknownAccounts(objAttrs["should_destroy_unknown_accounts"].(basetypes.BoolValue).ValueBoolPointer()) { @@ -3019,6 +3043,14 @@ func tfObjectToTKHRSProvisioningProvisionedSystem(ctx context.Context, recurse b val.SetTypeEscaped(dtype) tkh = val } + if !objAttrs["provisioned_namespace"].IsNull() { + val, d := tfObjectToTKHRSProvisioningProvisionedNamespace(ctx, false, objAttrs["provisioned_namespace"].(basetypes.ObjectValue)) + diags.Append(d...) + dtype := val.GetTypeEscaped() + (*val.(*keyhubmodel.ProvisioningProvisionedNamespace)).ProvisioningProvisionedSystem = *tkh.(*keyhubmodel.ProvisioningProvisionedSystem) + val.SetTypeEscaped(dtype) + tkh = val + } if recurse { { val, d := tfObjectToTKHRSProvisioningProvisionedSystem_additionalObjects(ctx, false, objVal) diff --git a/internal/provider/full-tkh-to-tf-ds.go b/internal/provider/full-tkh-to-tf-ds.go index 631a35d..309c4a5 100644 --- a/internal/provider/full-tkh-to-tf-ds.go +++ b/internal/provider/full-tkh-to-tf-ds.go @@ -1567,6 +1567,11 @@ func tkhToTFObjectDSGroupAccountGroup(recurse bool, tkh keyhubmodel.GroupAccount } obj["admin"] = types.BoolPointerValue(tkh.GetAdmin()) obj["name"] = types.StringPointerValue(tkh.GetName()) + { + val, d := tkhToTFObjectDSOrganizationOrganizationalUnitPrimer(recurse, tkh.GetOrganizationalUnit()) + diags.Append(d...) + obj["organizational_unit"] = val + } obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) obj["additional"] = types.ListNull(types.StringType) obj["end_date"] = stringerToTF(tkh.GetEndDate()) @@ -1715,6 +1720,11 @@ func tkhToTFObjectDSGroupGroup(recurse bool, tkh keyhubmodel.GroupGroupable) (ty } obj["admin"] = types.BoolPointerValue(tkh.GetAdmin()) obj["name"] = types.StringPointerValue(tkh.GetName()) + { + val, d := tkhToTFObjectDSOrganizationOrganizationalUnitPrimer(recurse, tkh.GetOrganizationalUnit()) + diags.Append(d...) + obj["organizational_unit"] = val + } obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) obj["additional"] = types.ListNull(types.StringType) obj["application_administration"] = types.BoolPointerValue(tkh.GetApplicationAdministration()) @@ -1766,11 +1776,6 @@ func tkhToTFObjectDSGroupGroup(recurse bool, tkh keyhubmodel.GroupGroupable) (ty diags.Append(d...) obj["nested_under"] = val } - { - val, d := tkhToTFObjectDSOrganizationOrganizationalUnitPrimer(false, tkh.GetOrganizationalUnit()) - diags.Append(d...) - obj["organizational_unit"] = val - } obj["private_group"] = types.BoolPointerValue(tkh.GetPrivateGroup()) obj["record_trail"] = types.BoolPointerValue(tkh.GetRecordTrail()) obj["rotating_password_required"] = types.BoolPointerValue(tkh.GetRotatingPasswordRequired()) @@ -2586,6 +2591,11 @@ func tkhToTFObjectDSGroupGroupPrimer(recurse bool, tkh keyhubmodel.GroupGroupPri } obj["admin"] = types.BoolPointerValue(tkh.GetAdmin()) obj["name"] = types.StringPointerValue(tkh.GetName()) + { + val, d := tkhToTFObjectDSOrganizationOrganizationalUnitPrimer(recurse, tkh.GetOrganizationalUnit()) + diags.Append(d...) + obj["organizational_unit"] = val + } obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) objVal, d := types.ObjectValue(attrs, obj) @@ -3757,6 +3767,32 @@ func tkhToTFObjectDSProvisioningProvisionedLDAPDirectory(recurse bool, tkh keyhu return objVal, diags } +func tkhToTFObjectDSProvisioningProvisionedNamespace(recurse bool, tkh keyhubmodel.ProvisioningProvisionedNamespaceable) (types.Object, diag.Diagnostics) { + var diags diag.Diagnostics + var attrs map[string]attr.Type + if recurse { + attrs = provisioningProvisionedNamespaceAttrTypesDSRecurse + } else { + attrs = provisioningProvisionedNamespaceAttrTypesDS + } + if tkh == nil { + return types.ObjectNull(attrs), diags + } + + obj := make(map[string]attr.Value) + { + val, d := tkhToTFObjectDSProvisioningProvisionedSystemPrimer(recurse, tkh.GetBaseSystem()) + diags.Append(d...) + obj["base_system"] = val + } + obj["group_dn"] = types.StringPointerValue(tkh.GetGroupDN()) + obj["service_account_dn"] = types.StringPointerValue(tkh.GetServiceAccountDN()) + + objVal, d := types.ObjectValue(attrs, obj) + diags.Append(d...) + return objVal, diags +} + func tkhToTFObjectDSProvisioningProvisionedSystem(recurse bool, tkh keyhubmodel.ProvisioningProvisionedSystemable) (types.Object, diag.Diagnostics) { var diags diag.Diagnostics var attrs map[string]attr.Type @@ -3821,6 +3857,7 @@ func tkhToTFObjectDSProvisioningProvisionedSystem(recurse bool, tkh keyhubmodel. } obj["self_service_existing_groups"] = types.BoolPointerValue(tkh.GetSelfServiceExistingGroups()) obj["self_service_new_groups"] = types.BoolPointerValue(tkh.GetSelfServiceNewGroups()) + obj["self_service_new_namespaces"] = types.BoolPointerValue(tkh.GetSelfServiceNewNamespaces()) obj["self_service_service_accounts"] = types.BoolPointerValue(tkh.GetSelfServiceServiceAccounts()) obj["should_destroy_unknown_accounts"] = types.BoolPointerValue(tkh.GetShouldDestroyUnknownAccounts()) { @@ -3877,6 +3914,12 @@ func tkhToTFObjectDSProvisioningProvisionedSystem(recurse bool, tkh keyhubmodel. diags.Append(d...) obj["provisioned_ldap_directory"] = val } + { + tkhCast, _ := tkh.(keyhubmodel.ProvisioningProvisionedNamespaceable) + val, d := tkhToTFObjectDSProvisioningProvisionedNamespace(false, tkhCast) + diags.Append(d...) + obj["provisioned_namespace"] = val + } objVal, d := types.ObjectValue(attrs, obj) diags.Append(d...) diff --git a/internal/provider/full-tkh-to-tf-rs.go b/internal/provider/full-tkh-to-tf-rs.go index d57c6de..de0ceca 100644 --- a/internal/provider/full-tkh-to-tf-rs.go +++ b/internal/provider/full-tkh-to-tf-rs.go @@ -1261,6 +1261,7 @@ func tkhToTFObjectRSGroupGroup(recurse bool, tkh keyhubmodel.GroupGroupable) (ty } obj["admin"] = types.BoolPointerValue(tkh.GetAdmin()) obj["name"] = types.StringPointerValue(tkh.GetName()) + obj["organizational_unit_uuid"] = withUuidToTF(tkh.GetOrganizationalUnit()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) obj["application_administration"] = types.BoolPointerValue(tkh.GetApplicationAdministration()) { @@ -1287,7 +1288,6 @@ func tkhToTFObjectRSGroupGroup(recurse bool, tkh keyhubmodel.GroupGroupable) (ty obj["extended_access"] = stringerToTF(tkh.GetExtendedAccess()) obj["hide_audit_trail"] = types.BoolPointerValue(tkh.GetHideAuditTrail()) obj["nested_under_uuid"] = withUuidToTF(tkh.GetNestedUnder()) - obj["organizational_unit_uuid"] = withUuidToTF(tkh.GetOrganizationalUnit()) obj["private_group"] = types.BoolPointerValue(tkh.GetPrivateGroup()) obj["record_trail"] = types.BoolPointerValue(tkh.GetRecordTrail()) obj["rotating_password_required"] = types.BoolPointerValue(tkh.GetRotatingPasswordRequired()) @@ -1867,6 +1867,7 @@ func tkhToTFObjectRSGroupGroupPrimer(recurse bool, tkh keyhubmodel.GroupGroupPri } obj["admin"] = types.BoolPointerValue(tkh.GetAdmin()) obj["name"] = types.StringPointerValue(tkh.GetName()) + obj["organizational_unit_uuid"] = withUuidToTF(tkh.GetOrganizationalUnit()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) objVal, d := types.ObjectValue(attrs, obj) @@ -3116,6 +3117,28 @@ func tkhToTFObjectRSProvisioningProvisionedLDAPDirectory(recurse bool, tkh keyhu return objVal, diags } +func tkhToTFObjectRSProvisioningProvisionedNamespace(recurse bool, tkh keyhubmodel.ProvisioningProvisionedNamespaceable) (types.Object, diag.Diagnostics) { + var diags diag.Diagnostics + var attrs map[string]attr.Type + if recurse { + attrs = provisioningProvisionedNamespaceAttrTypesRSRecurse + } else { + attrs = provisioningProvisionedNamespaceAttrTypesRS + } + if tkh == nil { + return types.ObjectNull(attrs), diags + } + + obj := make(map[string]attr.Value) + obj["base_system_uuid"] = withUuidToTF(tkh.GetBaseSystem()) + obj["group_dn"] = types.StringPointerValue(tkh.GetGroupDN()) + obj["service_account_dn"] = types.StringPointerValue(tkh.GetServiceAccountDN()) + + objVal, d := types.ObjectValue(attrs, obj) + diags.Append(d...) + return objVal, diags +} + func tkhToTFObjectRSProvisioningProvisionedSystem(recurse bool, tkh keyhubmodel.ProvisioningProvisionedSystemable) (types.Object, diag.Diagnostics) { var diags diag.Diagnostics var attrs map[string]attr.Type @@ -3167,6 +3190,7 @@ func tkhToTFObjectRSProvisioningProvisionedSystem(recurse bool, tkh keyhubmodel. obj["owner_uuid"] = withUuidToTF(tkh.GetOwner()) obj["self_service_existing_groups"] = types.BoolPointerValue(tkh.GetSelfServiceExistingGroups()) obj["self_service_new_groups"] = types.BoolPointerValue(tkh.GetSelfServiceNewGroups()) + obj["self_service_new_namespaces"] = types.BoolPointerValue(tkh.GetSelfServiceNewNamespaces()) obj["self_service_service_accounts"] = types.BoolPointerValue(tkh.GetSelfServiceServiceAccounts()) obj["should_destroy_unknown_accounts"] = types.BoolPointerValue(tkh.GetShouldDestroyUnknownAccounts()) obj["technical_administrator_uuid"] = withUuidToTF(tkh.GetTechnicalAdministrator()) @@ -3219,6 +3243,12 @@ func tkhToTFObjectRSProvisioningProvisionedSystem(recurse bool, tkh keyhubmodel. diags.Append(d...) obj["provisioned_ldap_directory"] = val } + { + tkhCast, _ := tkh.(keyhubmodel.ProvisioningProvisionedNamespaceable) + val, d := tkhToTFObjectRSProvisioningProvisionedNamespace(false, tkhCast) + diags.Append(d...) + obj["provisioned_namespace"] = val + } objVal, d := types.ObjectValue(attrs, obj) diags.Append(d...) diff --git a/main.go b/main.go index 7a3b3a1..77d183f 100644 --- a/main.go +++ b/main.go @@ -31,24 +31,24 @@ import ( // system/{systemid}/group // serviceaccount/{accountid}/group -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode model -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource account --linkable authAccount -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource certificate --linkable certificateCertificate -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource client --linkable clientClientApplication -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource directory --linkable directoryAccountDirectory -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource group --linkable groupGroup -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource groupclassification --linkable groupGroupClassification -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource organizationalunit --linkable organizationOrganizationalUnit -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource serviceaccount --linkable serviceaccountServiceAccount -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource system --linkable provisioningProvisionedSystem -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource vaultrecord --linkable vaultVaultRecord -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode data --resource webhook --linkable webhookWebhook -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode resource --resource clientapplication -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode resource --resource client_vaultrecord -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode resource --resource group_vaultrecord -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode resource --resource group -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode resource --resource grouponsystem -//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.5 --mode resource --resource serviceaccount +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode model +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource account --linkable authAccount +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource certificate --linkable certificateCertificate +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource client --linkable clientClientApplication +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource directory --linkable directoryAccountDirectory +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource group --linkable groupGroup +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource groupclassification --linkable groupGroupClassification +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource organizationalunit --linkable organizationOrganizationalUnit +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource serviceaccount --linkable serviceaccountServiceAccount +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource system --linkable provisioningProvisionedSystem +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource vaultrecord --linkable vaultVaultRecord +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode data --resource webhook --linkable webhookWebhook +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode resource --resource clientapplication +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode resource --resource client_vaultrecord +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode resource --resource group_vaultrecord +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode resource --resource group +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode resource --resource grouponsystem +//go:generate go run github.com/topicuskeyhub/terraform-provider-keyhub-generator@v0.0.6 --mode resource --resource serviceaccount // If you do not have terraform installed, you can remove the formatting command, but its suggested to // ensure the documentation is formatted properly.