diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..9d1119a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,28 @@ +--- +name: Bug report +about: Create a report to improve the provider +title: '' +labels: 'bug' +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Log Output** +If applicable, add logs to help explain your problem. + +**Additional Data** +Important for reproducability. + +- Terraform Version + +- Operating System + +- Provider Version diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..810d572 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this provider +title: '' +labels: 'enhancement' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.gitignore b/.gitignore index cde0123..8762fee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ - -dist/ +.vscode +dist/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4ad4d98 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2022 lerentis, https://git.uploadfilter24.eu/lerentis +Copyright (c) 2022 The Gitea Authors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile index 6e4f53e..a85a5f8 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ TEST?=./gitea GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) - GOFMT ?= gofmt -s -VERSION = 0.6.1 +VERSION = 0.2.0 test: fmt-check go test -i $(TEST) || exit 1 @@ -31,11 +30,6 @@ fmt-check: exit 1; \ fi; build: - go build -o terraform-provider-gitea_${VERSION} -install: build - @echo installing to - @echo ~/.terraform.d/plugins/terraform.local/local/gitea/${VERSION}/linux_amd64/terraform-provider-gitea_${VERSION} - @mkdir -p ~/.terraform.d/plugins/terraform.local/local/gitea/${VERSION}/linux_amd64 - @mv terraform-provider-gitea_${VERSION} ~/.terraform.d/plugins/terraform.local/local/gitea/${VERSION}/linux_amd64/terraform-provider-gitea_${VERSION} + go build -ldflags="-X 'main.Version=${VERSION}'" -o terraform-provider-gitea_${VERSION} doc: - tfplugindocs \ No newline at end of file + tfplugindocs diff --git a/README.md b/README.md index bbc1ebd..34a4ec5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,74 @@ # terraform-provider-gitea Terraform Gitea Provider + +This repo is mirrored from https://gitea.com/gitea/terraform-provider-gitea please send all issues and pull requests there. + +## Usage + +This is not a 1.0 release, so usage is subject to change! + +```terraform +terraform { + required_providers { + gitea = { + source = "go-gitea/gitea" + version = "0.2.0" + } + } +} + +provider "gitea" { + base_url = var.gitea_url # optionally use GITEA_BASE_URL env var + token = var.gitea_token # optionally use GITEA_TOKEN env var + + # Username/Password authentication is mutally exclusive with token authentication + # username = var.username # optionally use GITEA_USERNAME env var + # password = var.password # optionally use GITEA_PASSWORD env var + + # A file containing the ca certificate to use in case ssl certificate is not from a standard chain + cacert_file = var.cacert_file + + # If you are running a gitea instance with self signed TLS certificates + # and you want to disable certificate validation you can deactivate it with this flag + insecure = false +} + +resource "gitea_repository" "test" { + username = "lerentis" + name = "test" + private = true + issue_labels = "Default" + license = "MIT" + gitignores = "Go" +} + +resource "gitea_repository" "mirror" { + username = "lerentis" + name = "terraform-provider-gitea-mirror" + description = "Mirror of Terraform Provider" + mirror = true + migration_clone_addresse = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git" + migration_service = "gitea" + migration_service_auth_token = var.gitea_mirror_token +} + +resource "gitea_org" "test_org" { + name = "test-org" +} + +resource "gitea_repository" "org_repo" { + username = gitea_org.test_org.name + name = "org-test-repo" +} + +``` + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## History + +This codebase was created at https://gitea.com/gitea/terraform-provider-gitea, was forked by @lerentis, and then their changes were merged back into the original repo. Thank you to everyone who contributed! + diff --git a/docs/index.md b/docs/index.md index 9d0f6e2..59e9209 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,8 +16,8 @@ description: |- terraform { required_providers { gitea = { - source = "gitea/gitea" - version = "0.6.1" + source = "go-gitea/gitea" + version = "0.1.0" } } } diff --git a/docs/resources/fork.md b/docs/resources/fork.md new file mode 100644 index 0000000..6733ea7 --- /dev/null +++ b/docs/resources/fork.md @@ -0,0 +1,61 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "gitea_fork Resource - terraform-provider-gitea" +subcategory: "" +description: |- + gitea_fork manages repository fork to the current user or an organisation + Forking a repository to a dedicated user is currently unsupported + Creating a fork using this resource without an organisation will create the fork in the executors name +--- + +# gitea_fork (Resource) + +`gitea_fork` manages repository fork to the current user or an organisation +Forking a repository to a dedicated user is currently unsupported +Creating a fork using this resource without an organisation will create the fork in the executors name + +## Example Usage + +```terraform +resource "gitea_org" "org1" { + name = "org1" +} + +resource "gitea_org" "org2" { + name = "org2" +} + +resource "gitea_repository" "repo1_in_org1" { + username = gitea_org.org1.name + name = "repo1-in-org1" +} + +resource "gitea_fork" "user_fork_of_repo1_in_org1" { + owner = gitea_org.org1.name + repo = gitea_repository.repo1_in_org1.name +} + +resource "gitea_fork" "org2_fork_of_repo1_in_org1" { + owner = gitea_org.org1.name + repo = gitea_repository.repo1_in_org1.name + organization = gitea_org.org2.name +} +``` + + +## Schema + +### Required + +- `owner` (String) The owner or owning organization of the repository to fork +- `repo` (String) The name of the repository to fork + +### Optional + +- `organization` (String) The organization that owns the forked repo + +### Read-Only + +- `id` (String) The ID of this resource. + + diff --git a/docs/resources/git_hook.md b/docs/resources/git_hook.md new file mode 100644 index 0000000..ba12e1e --- /dev/null +++ b/docs/resources/git_hook.md @@ -0,0 +1,55 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "gitea_git_hook Resource - terraform-provider-gitea" +subcategory: "" +description: |- + gitea_git_hook manages git hooks on a repository. + import is currently not supported + WARNING: using this resource requires to enable server side hookswhich are known to cause security issues https://github.com/go-gitea/gitea/pull/13058! + if you want to procede, you need to enable server side hooks as stated here https://docs.gitea.io/en-us/config-cheat-sheet/#security-security +--- + +# gitea_git_hook (Resource) + +`gitea_git_hook` manages git hooks on a repository. +import is currently not supported + +WARNING: using this resource requires to enable server side hookswhich are known to cause [security issues](https://github.com/go-gitea/gitea/pull/13058)! + +if you want to procede, you need to enable server side hooks as stated [here](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security) + +## Example Usage + +```terraform +resource "gitea_org" "test_org" { + name = "test-org" +} + +resource "gitea_repository" "org_repo" { + username = gitea_org.test_org.name + name = "org-test-repo" +} + +resource "gitea_git_hook" "org_repo_post_receive" { + name = "post-receive" + user = gitea_org.test_org.name + repo = gitea_repository.org_repo.name + content = file("${path.module}/post-receive.sh") +} +``` + + +## Schema + +### Required + +- `content` (String) Content of the git hook +- `name` (String) Name of the git hook to configure +- `repo` (String) The repository that this hook belongs too. +- `user` (String) The user (or organisation) owning the repo this hook belongs too + +### Read-Only + +- `id` (String) The ID of this resource. + + diff --git a/docs/resources/oauth2_app.md b/docs/resources/oauth2_app.md index 9dd1740..24b6d36 100644 --- a/docs/resources/oauth2_app.md +++ b/docs/resources/oauth2_app.md @@ -20,6 +20,10 @@ Handling [gitea oauth application](https://docs.gitea.io/en-us/oauth2-provider/) - `name` (String) OAuth Application name - `redirect_uris` (Set of String) Accepted redirect URIs +### Optional + +- `confidential_client` (Boolean) If set to false, it will be a public client (PKCE will be required) + ### Read-Only - `client_id` (String) OAuth2 Application client id diff --git a/docs/resources/org.md b/docs/resources/org.md index d09f7c0..f646213 100644 --- a/docs/resources/org.md +++ b/docs/resources/org.md @@ -46,5 +46,6 @@ resource "gitea_repository" "org_repo" { - `avatar_url` (String) - `id` (String) The ID of this resource. +- `repos` (List of String) List of all Repositories that are part of this organisation diff --git a/docs/resources/repository.md b/docs/resources/repository.md index 600ba78..6225540 100644 --- a/docs/resources/repository.md +++ b/docs/resources/repository.md @@ -21,16 +21,8 @@ Repository migrations have some properties that are not available to regular rep ## Example Usage ```terraform -resource "gitea_user" "test" { - username = "test" - login_name = "test" - password = "Geheim1!" - email = "test@user.dev" - must_change_password = false -} - resource "gitea_repository" "test" { - username = resource.gitea_user.test.name + username = "lerentis" name = "test" private = true issue_labels = "Default" @@ -39,7 +31,7 @@ resource "gitea_repository" "test" { } resource "gitea_repository" "mirror" { - username = resource.gitea_user.test.name + username = "lerentis" name = "terraform-provider-gitea-mirror" description = "Mirror of Terraform Provider" mirror = true @@ -47,6 +39,16 @@ resource "gitea_repository" "mirror" { migration_service = "gitea" migration_service_auth_token = var.gitea_mirror_token } + +resource "gitea_repository" "clone" { + username = "lerentis" + name = "terraform-provider-gitea-clone" + description = "Clone of Terraform Provider" + mirror = false + migration_clone_address = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git" + migration_service = "gitea" + migration_service_auth_token = var.gitea_clone_token +} ``` @@ -80,7 +82,8 @@ Need to exist in the gitea instance Need to exist in the gitea instance - `license` (String) The license under which the source code of this repository should be. Need to exist in the gitea instance -- `migration_clone_addresse` (String) +- `migration_clone_address` (String) +- `migration_clone_addresse` (String) DEPRECATED in favor of `migration_clone_address` - `migration_issue_labels` (Boolean) - `migration_lfs` (Boolean) - `migration_lfs_endpoint` (String) @@ -99,11 +102,14 @@ Need to exist in the gitea instance ### Read-Only +- `clone_url` (String) - `created` (String) +- `html_url` (String) - `id` (String) The ID of this resource. - `permission_admin` (Boolean) - `permission_pull` (Boolean) - `permission_push` (Boolean) +- `ssh_url` (String) - `updated` (String) diff --git a/docs/resources/repository_key.md b/docs/resources/repository_key.md new file mode 100644 index 0000000..aef33dd --- /dev/null +++ b/docs/resources/repository_key.md @@ -0,0 +1,63 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "gitea_repository_key Resource - terraform-provider-gitea" +subcategory: "" +description: |- + gitea_repository_key manages a deploy key for a single gitea_repository. + Every key needs a unique name and unique key, i.e. no key can be added twice to the same repo +--- + +# gitea_repository_key (Resource) + +`gitea_repository_key` manages a deploy key for a single gitea_repository. + +Every key needs a unique name and unique key, i.e. no key can be added twice to the same repo + +## Example Usage + +```terraform +terraform { + required_providers { + tls = { + source = "hashicorp/tls" + version = "4.0.4" + } + } +} + +resource "tls_private_key" "example" { + type = "RSA" + rsa_bits = 4096 +} + +resource "gitea_repository" "example" { + name = "example" + private = true +} + +resource "gitea_repository_key" "example" { + repository = gitea_repository.example.id + title = "Example Deploy Key" + read_only = true + key = tls_private_key.example.public_key_openssh +} +``` + + +## Schema + +### Required + +- `key` (String) Armored SSH key to add +- `repository` (Number) The ID of the repository where the deploy key belongs to +- `title` (String) Name of the deploy key + +### Optional + +- `read_only` (Boolean) Whether this key has read or read/write access + +### Read-Only + +- `id` (String) The ID of this resource. + + diff --git a/docs/resources/team.md b/docs/resources/team.md index 6434ca7..9d891d2 100644 --- a/docs/resources/team.md +++ b/docs/resources/team.md @@ -34,6 +34,26 @@ resource "gitea_team" "test_team" { permission = "write" members = [gitea_user.test.username] } + + +resource "gitea_repository" "test" { + username = gitea_org.test_org.name + name = "test" + private = true + issue_labels = "Default" + license = "MIT" + gitignores = "Go" +} + +resource "gitea_team" "test_team_restricted" { + name = "Restricted Devs" + organisation = gitea_org.test_org.name + description = "Restricted Devs of Test Org" + permission = "write" + members = [gitea_user.test.username] + include_all_repositories = false + repositories = [gitea_repository.test.name] +} ``` @@ -52,6 +72,7 @@ resource "gitea_team" "test_team" { - `members` (List of String) List of Users that should be part of this team - `permission` (String) Permissions associated with this Team Can be `none`, `read`, `write`, `admin` or `owner` +- `repositories` (List of String) List of Repositories that should be part of this team - `units` (String) List of types of Repositories that should be allowed to be created from Team members. Can be `repo.code`, `repo.issues`, `repo.ext_issues`, `repo.wiki`, `repo.pulls`, `repo.releases`, `repo.projects` and/or `repo.ext_wiki` diff --git a/docs/resources/token.md b/docs/resources/token.md new file mode 100644 index 0000000..5e9a18e --- /dev/null +++ b/docs/resources/token.md @@ -0,0 +1,67 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "gitea_token Resource - terraform-provider-gitea" +subcategory: "" +description: |- + gitea_token manages gitea Access Tokens. + Due to upstream limitations (see https://gitea.com/gitea/go-sdk/issues/610) this resource + can only be used with username/password provider configuration. + WARNING: + Tokens will be stored in the terraform state! +--- + +# gitea_token (Resource) + +`gitea_token` manages gitea Access Tokens. + +Due to upstream limitations (see https://gitea.com/gitea/go-sdk/issues/610) this resource +can only be used with username/password provider configuration. + +WARNING: +Tokens will be stored in the terraform state! + +## Example Usage + +```terraform +provider "gitea" { + base_url = var.gitea_url + # Token Auth can not be used with this resource + username = var.gitea_username + password = var.gitea_password +} + +resource "gitea_user" "test" { + username = "test" + login_name = "test" + password = "Geheim1!" + email = "test@user.dev" + must_change_password = false + admin = true +} + +resource "gitea_token" "test_token" { + username = resource.gitea_user.test.username + name = "test-token" +} + +output "token" { + value = resource.gitea_token.test_token.token + sensitive = true +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Access Token +- `username` (String) The owner of the Access Token + +### Read-Only + +- `id` (String) The ID of this resource. +- `last_eight` (String) +- `token` (String, Sensitive) The actual Access Token + + diff --git a/examples/main.tf b/examples/main.tf new file mode 100644 index 0000000..3154f8c --- /dev/null +++ b/examples/main.tf @@ -0,0 +1,137 @@ +resource "gitea_repository" "test" { + username = "lerentis" + name = "test" + private = true + issue_labels = "Default" + license = "MIT" + gitignores = "Go" +} + +resource "gitea_repository" "mirror" { + username = "lerentis" + name = "terraform-provider-gitea-mirror" + description = "Mirror of Terraform Provider" + mirror = true + migration_clone_address = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git" + migration_service = "gitea" + migration_service_auth_token = var.gitea_mirror_token +} + +resource "gitea_org" "test_org" { + name = "test-org" + description = "test description" +} + +resource "gitea_repository" "org_repo" { + username = gitea_org.test_org.name + name = "org-test-repo" +} + +data "gitea_user" "me" { + username = "lerentis" +} + +resource "gitea_user" "test" { + username = "test" + login_name = "test" + password = "Geheim1!" + email = "test@user.dev" + must_change_password = false + admin = true +} + + +resource "gitea_public_key" "test_user_key" { + title = "test" + key = file("${path.module}/resources/gitea_public_key/id_ed25519.pub") + read_only = true + username = gitea_user.test.username +} + + +resource "gitea_team" "test_team" { + name = "Devs" + organisation = gitea_org.test_org.name + description = "Devs of Test Org" + permission = "write" + members = [gitea_user.test.username] +} + +resource "gitea_team" "admin_team" { + name = "Admins" + organisation = gitea_org.test_org.name + description = "Admins of Test Org" + permission = "admin" + members = [data.gitea_user.me.username] +} + +resource "gitea_git_hook" "org_repo_pre_receive" { + name = "pre-receive" + user = gitea_org.test_org.name + repo = gitea_repository.org_repo.name + content = file("${path.module}/pre-receive.sh") +} + +resource "gitea_org" "org1" { + name = "org1" +} + +resource "gitea_org" "org2" { + name = "org2" +} + +resource "gitea_repository" "repo1_in_org1" { + username = gitea_org.org1.name + name = "repo1-in-org1" +} + +resource "gitea_fork" "user_fork_of_repo1_in_org1" { + owner = gitea_org.org1.name + repo = gitea_repository.repo1_in_org1.name +} + +resource "gitea_fork" "org2_fork_of_repo1_in_org1" { + owner = gitea_org.org1.name + repo = gitea_repository.repo1_in_org1.name + organization = gitea_org.org2.name +} + +resource "gitea_token" "test_token" { + username = data.gitea_user.me.username + name = "test-token" +} + +resource "gitea_repository" "test_existing_user" { + username = "testuser2" + name = "testExistingUser" + private = true + issue_labels = "Default" + license = "MIT" + gitignores = "Go" +} + +//resource "gitea_repository" "test_bs_user" { +// username = "manualTest" +// name = "testBullshitUser" +// private = true +// issue_labels = "Default" +// license = "MIT" +// gitignores = "Go" +//} + +output "token" { + value = resource.gitea_token.test_token.token + sensitive = true +} + +data "gitea_repo" "org_repos" { + name = each.key + username = gitea_org.org1.name + for_each = { + for repo in resource.gitea_org.org1.repos : repo => repo + } +} + +output "repos" { + value = data.gitea_repo.org_repos["repo1-in-org1"].clone_url +} diff --git a/examples/pre-receive.sh b/examples/pre-receive.sh new file mode 100644 index 0000000..a0638ed --- /dev/null +++ b/examples/pre-receive.sh @@ -0,0 +1,9 @@ +#!/bin/bash +while read oldrev newrev refname +do + branch=$(git rev-parse --symbolic --abbrev-ref $refname) + if [ "master" = "$branch" ]; then + echo "wrong branch" + exit 1 + fi +done \ No newline at end of file diff --git a/examples/provider.tf b/examples/provider.tf new file mode 100644 index 0000000..8ac39ce --- /dev/null +++ b/examples/provider.tf @@ -0,0 +1,15 @@ +terraform { + required_providers { + gitea = { + source = "go-gitea/gitea" + version = "0.1.0" + } + } +} + +provider "gitea" { + base_url = var.gitea_url + username = "lerentis" + password = var.gitea_password + #token = var.gitea_token +} \ No newline at end of file diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 097c67f..fd79d1f 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -21,4 +21,4 @@ provider "gitea" { # If you are running a gitea instance with self signed TLS certificates # and you want to disable certificate validation you can deactivate it with this flag insecure = false -} +} \ No newline at end of file diff --git a/examples/resources/gitea_fork/resource.tf b/examples/resources/gitea_fork/resource.tf new file mode 100644 index 0000000..f680d5e --- /dev/null +++ b/examples/resources/gitea_fork/resource.tf @@ -0,0 +1,23 @@ +resource "gitea_org" "org1" { + name = "org1" +} + +resource "gitea_org" "org2" { + name = "org2" +} + +resource "gitea_repository" "repo1_in_org1" { + username = gitea_org.org1.name + name = "repo1-in-org1" +} + +resource "gitea_fork" "user_fork_of_repo1_in_org1" { + owner = gitea_org.org1.name + repo = gitea_repository.repo1_in_org1.name +} + +resource "gitea_fork" "org2_fork_of_repo1_in_org1" { + owner = gitea_org.org1.name + repo = gitea_repository.repo1_in_org1.name + organization = gitea_org.org2.name +} diff --git a/examples/resources/gitea_git_hook/post-receive.sh b/examples/resources/gitea_git_hook/post-receive.sh new file mode 100644 index 0000000..be7b0bb --- /dev/null +++ b/examples/resources/gitea_git_hook/post-receive.sh @@ -0,0 +1,8 @@ +#!/bin/bash +while read oldrev newrev refname +do + branch=$(git rev-parse --symbolic --abbrev-ref $refname) + if [ "master" = "$branch" ]; then + # Do something + fi +done \ No newline at end of file diff --git a/examples/resources/gitea_git_hook/resource.tf b/examples/resources/gitea_git_hook/resource.tf new file mode 100644 index 0000000..8773dda --- /dev/null +++ b/examples/resources/gitea_git_hook/resource.tf @@ -0,0 +1,15 @@ +resource "gitea_org" "test_org" { + name = "test-org" +} + +resource "gitea_repository" "org_repo" { + username = gitea_org.test_org.name + name = "org-test-repo" +} + +resource "gitea_git_hook" "org_repo_post_receive" { + name = "post-receive" + user = gitea_org.test_org.name + repo = gitea_repository.org_repo.name + content = file("${path.module}/post-receive.sh") +} \ No newline at end of file diff --git a/examples/resources/gitea_repository/resource.tf b/examples/resources/gitea_repository/resource.tf index db9a55d..f18838b 100644 --- a/examples/resources/gitea_repository/resource.tf +++ b/examples/resources/gitea_repository/resource.tf @@ -1,13 +1,5 @@ -resource "gitea_user" "test" { - username = "test" - login_name = "test" - password = "Geheim1!" - email = "test@user.dev" - must_change_password = false -} - resource "gitea_repository" "test" { - username = resource.gitea_user.test.name + username = "lerentis" name = "test" private = true issue_labels = "Default" @@ -16,7 +8,7 @@ resource "gitea_repository" "test" { } resource "gitea_repository" "mirror" { - username = resource.gitea_user.test.name + username = "lerentis" name = "terraform-provider-gitea-mirror" description = "Mirror of Terraform Provider" mirror = true @@ -24,3 +16,13 @@ resource "gitea_repository" "mirror" { migration_service = "gitea" migration_service_auth_token = var.gitea_mirror_token } + +resource "gitea_repository" "clone" { + username = "lerentis" + name = "terraform-provider-gitea-clone" + description = "Clone of Terraform Provider" + mirror = false + migration_clone_address = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git" + migration_service = "gitea" + migration_service_auth_token = var.gitea_clone_token +} diff --git a/examples/resources/gitea_repository_key/resource.tf b/examples/resources/gitea_repository_key/resource.tf new file mode 100644 index 0000000..c8a6f4a --- /dev/null +++ b/examples/resources/gitea_repository_key/resource.tf @@ -0,0 +1,25 @@ +terraform { + required_providers { + tls = { + source = "hashicorp/tls" + version = "4.0.4" + } + } +} + +resource "tls_private_key" "example" { + type = "RSA" + rsa_bits = 4096 +} + +resource "gitea_repository" "example" { + name = "example" + private = true +} + +resource "gitea_repository_key" "example" { + repository = gitea_repository.example.id + title = "Example Deploy Key" + read_only = true + key = tls_private_key.example.public_key_openssh +} \ No newline at end of file diff --git a/examples/resources/gitea_team/resource.tf b/examples/resources/gitea_team/resource.tf index 7accce0..256f8ce 100644 --- a/examples/resources/gitea_team/resource.tf +++ b/examples/resources/gitea_team/resource.tf @@ -19,3 +19,23 @@ resource "gitea_team" "test_team" { permission = "write" members = [gitea_user.test.username] } + + +resource "gitea_repository" "test" { + username = gitea_org.test_org.name + name = "test" + private = true + issue_labels = "Default" + license = "MIT" + gitignores = "Go" +} + +resource "gitea_team" "test_team_restricted" { + name = "Restricted Devs" + organisation = gitea_org.test_org.name + description = "Restricted Devs of Test Org" + permission = "write" + members = [gitea_user.test.username] + include_all_repositories = false + repositories = [gitea_repository.test.name] +} diff --git a/examples/resources/gitea_token/resource.tf b/examples/resources/gitea_token/resource.tf new file mode 100644 index 0000000..a6707fe --- /dev/null +++ b/examples/resources/gitea_token/resource.tf @@ -0,0 +1,25 @@ +provider "gitea" { + base_url = var.gitea_url + # Token Auth can not be used with this resource + username = var.gitea_username + password = var.gitea_password +} + +resource "gitea_user" "test" { + username = "test" + login_name = "test" + password = "Geheim1!" + email = "test@user.dev" + must_change_password = false + admin = true +} + +resource "gitea_token" "test_token" { + username = resource.gitea_user.test.username + name = "test-token" +} + +output "token" { + value = resource.gitea_token.test_token.token + sensitive = true +} diff --git a/examples/variables.tf b/examples/variables.tf new file mode 100644 index 0000000..53e6515 --- /dev/null +++ b/examples/variables.tf @@ -0,0 +1,15 @@ +variable "gitea_url" { + default = "http://localhost:3000/" +} + +variable "gitea_token" { + +} + +variable "gitea_mirror_token" { + +} + +variable "gitea_password" { + +} \ No newline at end of file diff --git a/gitea/config.go b/gitea/config.go index 39bd524..c282b65 100644 --- a/gitea/config.go +++ b/gitea/config.go @@ -6,9 +6,10 @@ import ( "fmt" "io/ioutil" "net/http" + "time" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/logging" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" ) // Config is per-provider, specifies where to connect to gitea @@ -28,8 +29,7 @@ func (c *Config) Client() (interface{}, error) { return nil, fmt.Errorf("either a token or a username needs to be used") } // Configure TLS/SSL - tlsConfig := &tls.Config{} - + var tlsConfig tls.Config // If a CACertFile has been specified, use that for cert validation if c.CACertFile != "" { caCert, err := ioutil.ReadFile(c.CACertFile) @@ -43,13 +43,12 @@ func (c *Config) Client() (interface{}, error) { } // If configured as insecure, turn off SSL verification - if c.Insecure { - tlsConfig.InsecureSkipVerify = true - } + tlsConfig.InsecureSkipVerify = c.Insecure t := http.DefaultTransport.(*http.Transport).Clone() - t.TLSClientConfig = tlsConfig + t.TLSClientConfig = &tlsConfig t.MaxIdleConnsPerHost = 100 + t.TLSHandshakeTimeout = 10 * time.Second httpClient := &http.Client{ Transport: logging.NewTransport("Gitea", t), @@ -60,16 +59,23 @@ func (c *Config) Client() (interface{}, error) { } var client *gitea.Client + var err error if c.Token != "" { - client, _ = gitea.NewClient(c.BaseURL, gitea.SetToken(c.Token), gitea.SetHTTPClient(httpClient)) + client, err = gitea.NewClient(c.BaseURL, gitea.SetToken(c.Token), gitea.SetHTTPClient(httpClient)) + if err != nil { + return nil, err + } } if c.Username != "" { - client, _ = gitea.NewClient(c.BaseURL, gitea.SetBasicAuth(c.Username, c.Password), gitea.SetHTTPClient(httpClient)) + client, err = gitea.NewClient(c.BaseURL, gitea.SetBasicAuth(c.Username, c.Password), gitea.SetHTTPClient(httpClient)) + if err != nil { + return nil, err + } } // Test the credentials by checking we can get information about the authenticated user. - _, _, err := client.GetMyUserInfo() + _, _, err = client.GetMyUserInfo() return client, err } diff --git a/gitea/data_source_gitea_org.go b/gitea/data_source_gitea_org.go index 92d3757..533cf2d 100644 --- a/gitea/data_source_gitea_org.go +++ b/gitea/data_source_gitea_org.go @@ -6,7 +6,7 @@ import ( "strings" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceGiteaOrg() *schema.Resource { diff --git a/gitea/data_source_gitea_repo.go b/gitea/data_source_gitea_repo.go index 61f01d6..32b94ca 100644 --- a/gitea/data_source_gitea_repo.go +++ b/gitea/data_source_gitea_repo.go @@ -5,7 +5,7 @@ import ( "strings" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceGiteaRepo() *schema.Resource { diff --git a/gitea/data_source_gitea_user.go b/gitea/data_source_gitea_user.go index f7af362..5d299e8 100644 --- a/gitea/data_source_gitea_user.go +++ b/gitea/data_source_gitea_user.go @@ -6,7 +6,7 @@ import ( "strings" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) func dataSourceGiteaUser() *schema.Resource { diff --git a/gitea/data_source_gitea_user_test.go b/gitea/data_source_gitea_user_test.go index 58731f5..bf70b24 100644 --- a/gitea/data_source_gitea_user_test.go +++ b/gitea/data_source_gitea_user_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) func TestAccDataSourceGiteaUser_basic(t *testing.T) { diff --git a/gitea/provider.go b/gitea/provider.go index 11daf15..be7b500 100644 --- a/gitea/provider.go +++ b/gitea/provider.go @@ -4,12 +4,11 @@ import ( "fmt" "strings" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) // Provider returns a terraform.ResourceProvider. -func Provider() terraform.ResourceProvider { +func Provider() *schema.Provider { // The actual provider return &schema.Provider{ @@ -74,13 +73,17 @@ func Provider() terraform.ResourceProvider { ResourcesMap: map[string]*schema.Resource{ "gitea_org": resourceGiteaOrg(), - // "gitea_team": resourceGiteaTeam(), - // "gitea_repo": resourceGiteaRepo(), - "gitea_user": resourceGiteaUser(), - "gitea_oauth2_app": resourceGiteaOauthApp(), - "gitea_repository": resourceGiteaRepository(), - "gitea_public_key": resourceGiteaPublicKey(), - "gitea_team": resourceGiteaTeam(), + // "gitea_team": resourceGiteaTeam(), + // "gitea_repo": resourceGiteaRepo(), + "gitea_user": resourceGiteaUser(), + "gitea_oauth2_app": resourceGiteaOauthApp(), + "gitea_repository": resourceGiteaRepository(), + "gitea_fork": resourceGiteaFork(), + "gitea_public_key": resourceGiteaPublicKey(), + "gitea_team": resourceGiteaTeam(), + "gitea_git_hook": resourceGiteaGitHook(), + "gitea_token": resourceGiteaToken(), + "gitea_repository_key": resourceGiteaRepositoryKey(), }, ConfigureFunc: providerConfigure, @@ -118,5 +121,8 @@ func validateAPIURLVersion(value interface{}, key string) (ws []string, es []err if strings.HasSuffix(v, "/api/v1") || strings.HasSuffix(v, "/api/v1/") { es = append(es, fmt.Errorf("terraform-gitea-provider base URL format is incorrect; Please leave out API Path %s", v)) } + if strings.Contains(v, "localhost") && strings.Contains(v, ".") { + es = append(es, fmt.Errorf("terraform-gitea-provider base URL violates RFC 2606; Please do not define a subdomain for localhost!")) + } return } diff --git a/gitea/provider_test.go b/gitea/provider_test.go index 9345aac..64c65d5 100644 --- a/gitea/provider_test.go +++ b/gitea/provider_test.go @@ -4,30 +4,28 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -var testAccProviders map[string]terraform.ResourceProvider +var testAccProviders map[string]*schema.Provider var testAccProvider *schema.Provider func init() { - testAccProvider = Provider().(*schema.Provider) - testAccProviders = map[string]terraform.ResourceProvider{ + testAccProvider = Provider() + testAccProviders = map[string]*schema.Provider{ "gitea": testAccProvider, } } func TestProvider(t *testing.T) { - if err := Provider().(*schema.Provider).InternalValidate(); err != nil { + if err := Provider().InternalValidate(); err != nil { t.Fatalf("err: %s", err) } } func TestProvider_impl(t *testing.T) { - var _ terraform.ResourceProvider = Provider() + var _ *schema.Provider = Provider() } - func testAccPreCheck(t *testing.T) { if v := os.Getenv("GITEA_TOKEN"); v == "" { t.Fatal("GITEA_TOKEN must be set for acceptance tests") diff --git a/gitea/resource_gitea_fork.go b/gitea/resource_gitea_fork.go new file mode 100644 index 0000000..775586b --- /dev/null +++ b/gitea/resource_gitea_fork.go @@ -0,0 +1,127 @@ +package gitea + +import ( + "fmt" + "strconv" + + "code.gitea.io/sdk/gitea" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + forkOwner string = "owner" + forkRepo string = "repo" + forkOrganization string = "organization" +) + +func resourceForkCreate(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + var opts gitea.CreateForkOption + var org string + org = d.Get(forkOrganization).(string) + if org != "" { + opts.Organization = &org + } + + repo, _, err := client.CreateFork(d.Get(forkOwner).(string), + d.Get(forkRepo).(string), + opts) + if err == nil { + err = setForkResourceData(repo, d) + } + return err +} + +func resourceForkRead(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + id, err := strconv.ParseInt(d.Id(), 10, 64) + var resp *gitea.Response + + if err != nil { + return err + } + + repo, resp, err := client.GetRepoByID(id) + + if err != nil { + if resp.StatusCode == 404 { + d.SetId("") + return nil + } else { + return err + } + } + + err = setForkResourceData(repo, d) + + return +} + +func resourceForkDelete(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + id, err := strconv.ParseInt(d.Id(), 10, 64) + + if err != nil { + return err + } + + repo, _, err := client.GetRepoByID(id) + var resp *gitea.Response + + resp, err = client.DeleteRepo(repo.Owner.UserName, repo.Name) + + if err != nil { + if resp.StatusCode == 404 { + return + } else { + return err + } + } + + return +} + +func setForkResourceData(repo *gitea.Repository, d *schema.ResourceData) (err error) { + + d.SetId(fmt.Sprintf("%d", repo.ID)) + + return +} + +func resourceGiteaFork() *schema.Resource { + return &schema.Resource{ + Read: resourceForkRead, + Create: resourceForkCreate, + Delete: resourceForkDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Schema: map[string]*schema.Schema{ + "owner": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The owner or owning organization of the repository to fork", + }, + "repo": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the repository to fork", + }, + "organization": { + Type: schema.TypeString, + Required: false, + Optional: true, + ForceNew: true, + Description: "The organization that owns the forked repo", + }, + }, + Description: "`gitea_fork` manages repository fork to the current user or an organisation\n" + + "Forking a repository to a dedicated user is currently unsupported\n" + + "Creating a fork using this resource without an organisation will create the fork in the executors name", + } +} diff --git a/gitea/resource_gitea_git_hook.go b/gitea/resource_gitea_git_hook.go new file mode 100644 index 0000000..8b7e8c1 --- /dev/null +++ b/gitea/resource_gitea_git_hook.go @@ -0,0 +1,120 @@ +package gitea + +import ( + "fmt" + + "code.gitea.io/sdk/gitea" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + GitHookUser string = "user" + GitHookRepo string = "repo" + GitHookName string = "name" + GitHookContent string = "content" +) + +func resourceGitHookRead(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + user := d.Get(GitHookUser).(string) + repo := d.Get(GitHookRepo).(string) + name := d.Get(GitHookName).(string) + + gitHook, _, err := client.GetRepoGitHook(user, repo, name) + + if err != nil { + return err + } + + err = setGitHookResourceData(user, repo, gitHook, d) + + return +} + +func resourceGitHookUpdate(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + user := d.Get(GitHookUser).(string) + repo := d.Get(GitHookRepo).(string) + name := d.Get(GitHookName).(string) + + opts := gitea.EditGitHookOption{ + Content: d.Get(GitHookContent).(string), + } + + _, err = client.EditRepoGitHook(user, repo, name, opts) + + if err != nil { + return err + } + + // Get gitHook ourselves, EditRepoGitHook does not return it + gitHook, _, err := client.GetRepoGitHook(user, repo, name) + + if err != nil { + return err + } + + err = setGitHookResourceData(user, repo, gitHook, d) + + return +} + +func resourceGitHookDelete(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + user := d.Get(GitHookUser).(string) + repo := d.Get(GitHookRepo).(string) + name := d.Get(GitHookName).(string) + + _, err = client.DeleteRepoGitHook(user, repo, name) + + return +} + +func setGitHookResourceData(user string, repo string, gitHook *gitea.GitHook, d *schema.ResourceData) (err error) { + d.SetId(fmt.Sprintf("%s/%s/%s", user, repo, gitHook.Name)) + d.Set(GitHookUser, user) + d.Set(GitHookRepo, repo) + d.Set(GitHookName, gitHook.Name) + d.Set(GitHookContent, gitHook.Content) + return +} + +func resourceGiteaGitHook() *schema.Resource { + return &schema.Resource{ + Read: resourceGitHookRead, + Create: resourceGitHookUpdate, // All hooks already exist, just empty and disabled + Update: resourceGitHookUpdate, + Delete: resourceGitHookDelete, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the git hook to configure", + }, + "repo": { + Type: schema.TypeString, + Required: true, + Description: "The repository that this hook belongs too.", + }, + "user": { + Type: schema.TypeString, + Required: true, + Description: "The user (or organisation) owning the repo this hook belongs too", + }, + "content": { + Type: schema.TypeString, + Required: true, + Description: "Content of the git hook", + }, + }, + Description: "`gitea_git_hook` manages git hooks on a repository.\n" + + "import is currently not supported\n\n" + + "WARNING: using this resource requires to enable server side hooks" + + "which are known to cause [security issues](https://github.com/go-gitea/gitea/pull/13058)!\n\n" + + "if you want to procede, you need to enable server side hooks as stated" + + " [here](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security)", + } +} diff --git a/gitea/resource_gitea_oauth_app.go b/gitea/resource_gitea_oauth_app.go index 4ff217f..ea6cd0c 100644 --- a/gitea/resource_gitea_oauth_app.go +++ b/gitea/resource_gitea_oauth_app.go @@ -4,14 +4,15 @@ import ( "fmt" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( - oauth2KeyName string = "name" - oauth2KeyRedirectURIs string = "redirect_uris" - oauth2KeyClientId string = "client_id" - oauth2KeyClientSecret string = "client_secret" + oauth2KeyName string = "name" + oauth2KeyConfidentialClient string = "confidential_client" + oauth2KeyRedirectURIs string = "redirect_uris" + oauth2KeyClientId string = "client_id" + oauth2KeyClientSecret string = "client_secret" ) func resourceGiteaOauthApp() *schema.Resource { @@ -37,6 +38,12 @@ func resourceGiteaOauthApp() *schema.Resource { }, Description: "Accepted redirect URIs", }, + oauth2KeyConfidentialClient: { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "If set to false, it will be a public client (PKCE will be required)", + }, oauth2KeyClientId: { Type: schema.TypeString, Computed: true, @@ -89,9 +96,16 @@ func resourceOauth2AppUpcreate(d *schema.ResourceData, meta interface{}) (err er return fmt.Errorf("attribute %s must be set and must be a string", oauth2KeyName) } + confidentialClient, confidentialClientOk := d.Get(oauth2KeyConfidentialClient).(bool) + + if !confidentialClientOk { + return fmt.Errorf("attribute %s must be set and must be a bool", oauth2KeyConfidentialClient) + } + opts := gitea.CreateOauth2Option{ - Name: name, - RedirectURIs: redirectURIs, + Name: name, + ConfidentialClient: confidentialClient, + RedirectURIs: redirectURIs, } var oauth2 *gitea.Oauth2 @@ -99,7 +113,7 @@ func resourceOauth2AppUpcreate(d *schema.ResourceData, meta interface{}) (err er if d.IsNewResource() { oauth2, _, err = client.CreateOauth2(opts) } else { - oauth2, err := searchOauth2AppByClientId(client, d.Id()) + oauth2, err = searchOauth2AppByClientId(client, d.Id()) if err != nil { return err @@ -176,9 +190,10 @@ func setOAuth2ResourceData(app *gitea.Oauth2, d *schema.ResourceData) (err error d.SetId(app.ClientID) for k, v := range map[string]interface{}{ - oauth2KeyName: app.Name, - oauth2KeyRedirectURIs: schema.NewSet(schema.HashString, CollapseStringList(app.RedirectURIs)), - oauth2KeyClientId: app.ClientID, + oauth2KeyName: app.Name, + oauth2KeyConfidentialClient: app.ConfidentialClient, + oauth2KeyRedirectURIs: schema.NewSet(schema.HashString, CollapseStringList(app.RedirectURIs)), + oauth2KeyClientId: app.ClientID, } { err = d.Set(k, v) if err != nil { diff --git a/gitea/resource_gitea_organisation.go b/gitea/resource_gitea_organisation.go index be78e41..f6e308e 100644 --- a/gitea/resource_gitea_organisation.go +++ b/gitea/resource_gitea_organisation.go @@ -2,9 +2,10 @@ package gitea import ( "fmt" + "strconv" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( @@ -15,26 +16,81 @@ const ( orgLocation string = "location" orgVisibility string = "visibility" RepoAdminChangeTeamAccess string = "repo_admin_change_team_access" + orgRepos string = "org_repos" ) +// might come in handy if we want to stick to numeric IDs +func searchOrgByClientId(c *gitea.Client, id int64) (res *gitea.Organization, err error) { + + page := 1 + + for { + orgs, _, err := c.AdminListOrgs(gitea.AdminListOrgsOptions{ + ListOptions: gitea.ListOptions{ + Page: page, + PageSize: 50, + }, + }) + if err != nil { + return nil, err + } + + if len(orgs) == 0 { + return nil, fmt.Errorf("Organisation with ID %d could not be found", id) + } + + for _, org := range orgs { + if org.ID == id { + return org, nil + } + } + + page += 1 + } +} + +func getAllOrgRepos(c *gitea.Client, orgName string) (repos []string, err error) { + page := 1 + + for { + repoBuffer, _, err := c.ListOrgRepos(orgName, gitea.ListOrgReposOptions{ + ListOptions: gitea.ListOptions{ + Page: page, + PageSize: 50, + }, + }) + if err != nil { + return nil, err + } + + if len(repoBuffer) == 0 { + return repos, nil + } + + for _, repo := range repoBuffer { + repos = append(repos, repo.Name) + } + + page += 1 + } +} + func resourceOrgRead(d *schema.ResourceData, meta interface{}) (err error) { client := meta.(*gitea.Client) var org *gitea.Organization - var resp *gitea.Response - org, resp, err = client.GetOrg(d.Get(orgName).(string)) + id, err := strconv.ParseInt(d.Id(), 10, 64) + + org, err = searchOrgByClientId(client, id) if err != nil { - if resp.StatusCode == 404 { - d.SetId("") - return nil - } else { - return err - } + d.SetId("") + return nil } - err = setOrgResourceData(org, d) + repos, _ := getAllOrgRepos(client, org.UserName) + err = setOrgResourceData(org, d, &repos) return } @@ -57,7 +113,8 @@ func resourceOrgCreate(d *schema.ResourceData, meta interface{}) (err error) { return } - err = setOrgResourceData(org, d) + repos, _ := getAllOrgRepos(client, org.UserName) + err = setOrgResourceData(org, d, &repos) return } @@ -90,7 +147,8 @@ func resourceOrgUpdate(d *schema.ResourceData, meta interface{}) (err error) { org, resp, err = client.GetOrg(d.Get(orgName).(string)) - err = setOrgResourceData(org, d) + repos, _ := getAllOrgRepos(client, org.UserName) + err = setOrgResourceData(org, d, &repos) return } @@ -113,7 +171,7 @@ func resourceOrgDelete(d *schema.ResourceData, meta interface{}) (err error) { return } -func setOrgResourceData(org *gitea.Organization, d *schema.ResourceData) (err error) { +func setOrgResourceData(org *gitea.Organization, d *schema.ResourceData, repos *[]string) (err error) { d.SetId(fmt.Sprintf("%d", org.ID)) d.Set("name", org.UserName) d.Set("full_name", org.FullName) @@ -122,6 +180,7 @@ func setOrgResourceData(org *gitea.Organization, d *schema.ResourceData) (err er d.Set("website", org.Website) d.Set("location", org.Location) d.Set("visibility", org.Visibility) + d.Set("repos", repos) return } @@ -133,7 +192,7 @@ func resourceGiteaOrg() *schema.Resource { Update: resourceOrgUpdate, Delete: resourceOrgDelete, Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, + StateContext: schema.ImportStatePassthroughContext, }, Schema: map[string]*schema.Schema{ "name": { @@ -183,6 +242,13 @@ func resourceGiteaOrg() *schema.Resource { Default: "public", Description: "Flag is this organisation should be publicly visible or not.", }, + "repos": { + Type: schema.TypeList, + Required: false, + Computed: true, + Description: "List of all Repositories that are part of this organisation", + Elem: &schema.Schema{Type: schema.TypeString}, + }, }, Description: "`gitea_org` manages a gitea organisation.\n\n" + "Organisations are a way to group repositories and abstract permission management in a gitea instance.", diff --git a/gitea/resource_gitea_public_key.go b/gitea/resource_gitea_public_key.go index c83a39f..6893614 100644 --- a/gitea/resource_gitea_public_key.go +++ b/gitea/resource_gitea_public_key.go @@ -5,7 +5,7 @@ import ( "strconv" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( diff --git a/gitea/resource_gitea_repository.go b/gitea/resource_gitea_repository.go index 5cda6ef..276cce0 100644 --- a/gitea/resource_gitea_repository.go +++ b/gitea/resource_gitea_repository.go @@ -1,11 +1,15 @@ package gitea import ( + "context" + "errors" "fmt" "strconv" + "strings" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( @@ -34,7 +38,8 @@ const ( repoAllowManualMerge string = "allow_manual_merge" repoAutodetectManualMerge string = "autodetect_manual_merge" repoMirror string = "mirror" - migrationCloneAddress string = "migration_clone_addresse" + migrationCloneAddresse string = "migration_clone_addresse" + migrationCloneAddress string = "migration_clone_address" migrationService string = "migration_service" migrationServiceAuthName string = "migration_service_auth_username" migrationServiceAuthPassword string = "migration_service_auth_password" @@ -47,6 +52,34 @@ const ( migrationLFSEndpoint string = "migration_lfs_endpoint" ) +func searchUserByName(c *gitea.Client, name string) (res *gitea.User, err error) { + page := 1 + + for { + users, _, err := c.AdminListUsers(gitea.AdminListUsersOptions{ + ListOptions: gitea.ListOptions{ + Page: page, + PageSize: 50, + }, + }) + if err != nil { + return nil, err + } + + if len(users) == 0 { + return nil, fmt.Errorf("User with name %s could not be found", name) + } + + for _, user := range users { + if user.UserName == name { + return user, nil + } + } + + page += 1 + } +} + func resourceRepoRead(d *schema.ResourceData, meta interface{}) (err error) { client := meta.(*gitea.Client) @@ -78,21 +111,39 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) { var repo *gitea.Repository var resp *gitea.Response - var orgRepo bool + var orgRepo, hasAdmin bool _, resp, err = client.GetOrg(d.Get(repoOwner).(string)) if resp.StatusCode == 404 { + _, err := searchUserByName(client, d.Get(repoOwner).(string)) + if err != nil { + if strings.Contains(err.Error(), "could not be found") { + return errors.New(fmt.Sprintf("Creation of repository cound not proceed as owner %s is not present in gitea", d.Get(repoOwner).(string))) + } + tflog.Warn(context.Background(), "Error query for users. Assuming missing permissions and proceding with user permissions") + hasAdmin = false + } else { + hasAdmin = true + } orgRepo = false } else { orgRepo = true } - if (d.Get(repoMirror)).(bool) { + var cloneAddr string + if d.Get(migrationCloneAddresse).(string) != "" { + cloneAddr = d.Get(migrationCloneAddresse).(string) + } else { + cloneAddr = d.Get(migrationCloneAddress).(string) + } + + if cloneAddr != "" { + opts := gitea.MigrateRepoOption{ RepoName: d.Get(repoName).(string), RepoOwner: d.Get(repoOwner).(string), - CloneAddr: d.Get(migrationCloneAddress).(string), + CloneAddr: cloneAddr, Service: gitea.GitServiceType(d.Get(migrationService).(string)), Mirror: d.Get(repoMirror).(bool), Private: d.Get(repoPrivateFlag).(bool), @@ -138,12 +189,16 @@ func resourceRepoCreate(d *schema.ResourceData, meta interface{}) (err error) { if orgRepo { repo, _, err = client.CreateOrgRepo(d.Get(repoOwner).(string), opts) } else { - repo, _, err = client.CreateRepo(opts) + if hasAdmin { + repo, _, err = client.AdminCreateRepo(d.Get(repoOwner).(string), opts) + } else { + repo, _, err = client.CreateRepo(opts) + } } } if err != nil { - return + return err } err = setRepoResourceData(repo, d) @@ -223,6 +278,7 @@ func respurceRepoDelete(d *schema.ResourceData, meta interface{}) (err error) { func setRepoResourceData(repo *gitea.Repository, d *schema.ResourceData) (err error) { d.SetId(fmt.Sprintf("%d", repo.ID)) + d.Set("username", repo.Owner.UserName) d.Set("name", repo.Name) d.Set("description", repo.Description) d.Set("full_name", repo.FullName) @@ -239,8 +295,8 @@ func setRepoResourceData(repo *gitea.Repository, d *schema.ResourceData) (err er d.Set("watchers", repo.Watchers) d.Set("open_issue_count", repo.OpenIssues) d.Set("default_branch", repo.DefaultBranch) - d.Set("created", repo.Created) - d.Set("updated", repo.Updated) + d.Set("created", repo.Created.String()) + d.Set("updated", repo.Updated.String()) d.Set("permission_admin", repo.Permissions.Admin) d.Set("permission_push", repo.Permissions.Push) d.Set("permission_pull", repo.Permissions.Pull) @@ -255,7 +311,7 @@ func resourceGiteaRepository() *schema.Resource { Update: resourceRepoUpdate, Delete: respurceRepoDelete, Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, + StateContext: schema.ImportStatePassthroughContext, }, Schema: map[string]*schema.Schema{ "username": { @@ -445,6 +501,13 @@ func resourceGiteaRepository() *schema.Resource { Default: false, }, "migration_clone_addresse": { + Type: schema.TypeString, + Required: false, + Optional: true, + ForceNew: true, + Description: "DEPRECATED in favor of `migration_clone_address`", + }, + "migration_clone_address": { Type: schema.TypeString, Required: false, Optional: true, @@ -513,6 +576,18 @@ func resourceGiteaRepository() *schema.Resource { Optional: true, Default: "", }, + "clone_url": { + Type: schema.TypeString, + Computed: true, + }, + "html_url": { + Type: schema.TypeString, + Computed: true, + }, + "ssh_url": { + Type: schema.TypeString, + Computed: true, + }, }, Description: "`gitea_repository` manages a gitea repository.\n\n" + "Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).\n" + diff --git a/gitea/resource_gitea_repository_key.go b/gitea/resource_gitea_repository_key.go new file mode 100644 index 0000000..69cb863 --- /dev/null +++ b/gitea/resource_gitea_repository_key.go @@ -0,0 +1,169 @@ +package gitea + +import ( + "fmt" + "strconv" + "strings" + + "code.gitea.io/sdk/gitea" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + deployKeyRepoId string = "repository" + deployKeyName string = "title" + deployKeyKey string = "key" + deployKeyReadOnly string = "read_only" +) + +func resourceRepoKeyIdParts(d *schema.ResourceData) (bool, int64, int64, error) { + parts := strings.Split(d.Id(), "/") + if len(parts) != 2 { + return false, 0, 0, nil + } + + repoId, err := strconv.ParseInt(parts[0], 10, 64) + if err != nil { + return false, 0, 0, err + } + keyId, err := strconv.ParseInt(parts[1], 10, 64) + if err != nil { + return false, 0, 0, err + } + return true, repoId, keyId, err +} + +func resourceRepoKeyRead(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + hasId, repoId, keyId, err := resourceRepoKeyIdParts(d) + if err != nil { + return err + } + if !hasId { + d.SetId("") + return nil + } + + repo, resp, err := client.GetRepoByID(repoId) + if err != nil { + if resp.StatusCode == 404 { + d.SetId("") + return nil + } else { + return err + } + } + + key, resp, err := client.GetDeployKey(repo.Owner.UserName, repo.Name, keyId) + if err != nil { + if resp.StatusCode == 404 { + d.SetId("") + return nil + } else { + return err + } + } + + err = setRepoKeyResourceData(key, repoId, d) + + return +} + +func resourceRepoKeyCreate(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + repo, _, err := client.GetRepoByID(int64(d.Get(deployKeyRepoId).(int))) + + if err != nil { + return err + } + + dk, _, err := client.CreateDeployKey(repo.Owner.UserName, repo.Name, gitea.CreateKeyOption{ + Title: d.Get(deployKeyName).(string), + ReadOnly: d.Get(deployKeyReadOnly).(bool), + Key: d.Get(deployKeyKey).(string), + }) + + if err != nil { + return err + } + + setRepoKeyResourceData(dk, repo.ID, d) + return nil +} + +func respurceRepoKeyDelete(d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + + hasId, repoId, keyId, err := resourceRepoKeyIdParts(d) + if err != nil { + return err + } + if !hasId { + d.SetId("") + return nil + } + + repo, resp, err := client.GetRepoByID(repoId) + if err != nil { + if resp.StatusCode == 404 { + d.SetId("") + return nil + } + return err + } + + client.DeleteDeployKey(repo.Owner.UserName, repo.Name, keyId) + return nil +} + +func setRepoKeyResourceData(dk *gitea.DeployKey, repoId int64, d *schema.ResourceData) (err error) { + d.SetId(fmt.Sprintf("%d/%d", repoId, dk.ID)) + d.Set(deployKeyRepoId, repoId) + d.Set(deployKeyReadOnly, dk.ReadOnly) + d.Set(deployKeyKey, dk.Key) + d.Set(deployKeyName, dk.Title) + return +} + +func resourceGiteaRepositoryKey() *schema.Resource { + return &schema.Resource{ + Read: resourceRepoKeyRead, + Create: resourceRepoKeyCreate, + Delete: respurceRepoKeyDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Schema: map[string]*schema.Schema{ + deployKeyRepoId: { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "The ID of the repository where the deploy key belongs to", + }, + deployKeyKey: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Armored SSH key to add", + }, + deployKeyReadOnly: { + Type: schema.TypeBool, + Required: false, + Optional: true, + Default: true, + ForceNew: true, + Description: "Whether this key has read or read/write access", + }, + deployKeyName: { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Name of the deploy key", + }, + }, + Description: "`gitea_repository_key` manages a deploy key for a single gitea_repository.\n\n" + + "Every key needs a unique name and unique key, i.e. no key can be added twice to the same repo", + } +} diff --git a/gitea/resource_gitea_team.go b/gitea/resource_gitea_team.go index 8bfed82..e65798f 100644 --- a/gitea/resource_gitea_team.go +++ b/gitea/resource_gitea_team.go @@ -1,12 +1,13 @@ package gitea import ( + "errors" "fmt" "strconv" "strings" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( @@ -18,6 +19,7 @@ const ( TeamIncludeAllReposFlag string = "include_all_repositories" TeamUnits string = "units" TeamMembers string = "members" + TeamRepositories string = "repositories" ) func resourceTeamRead(d *schema.ResourceData, meta interface{}) (err error) { @@ -39,7 +41,7 @@ func resourceTeamRead(d *schema.ResourceData, meta interface{}) (err error) { } } - err = setTeamResourceData(team, d) + err = setTeamResourceData(team, d, meta) return } @@ -75,12 +77,14 @@ func resourceTeamCreate(d *schema.ResourceData, meta interface{}) (err error) { units = append(units, gitea.RepoUnitProjects) } + includeAllRepos := d.Get(TeamIncludeAllReposFlag).(bool) + opts := gitea.CreateTeamOption{ Name: d.Get(TeamName).(string), Description: d.Get(TeamDescription).(string), Permission: gitea.AccessMode(d.Get(TeamPermissions).(string)), CanCreateOrgRepo: d.Get(TeamCreateRepoFlag).(bool), - IncludesAllRepositories: d.Get(TeamIncludeAllReposFlag).(bool), + IncludesAllRepositories: includeAllRepos, Units: units, } @@ -101,7 +105,14 @@ func resourceTeamCreate(d *schema.ResourceData, meta interface{}) (err error) { } } - err = setTeamResourceData(team, d) + if !includeAllRepos { + err = setTeamRepositories(team, d, meta, false) + if err != nil { + return err + } + } + + err = setTeamResourceData(team, d, meta) return } @@ -181,9 +192,16 @@ func resourceTeamUpdate(d *schema.ResourceData, meta interface{}) (err error) { } } + if !includeAllRepos { + err = setTeamRepositories(team, d, meta, true) + if err != nil { + return err + } + } + team, _, _ = client.GetTeam(id) - err = setTeamResourceData(team, d) + err = setTeamResourceData(team, d, meta) return } @@ -208,7 +226,13 @@ func resourceTeamDelete(d *schema.ResourceData, meta interface{}) (err error) { return } -func setTeamResourceData(team *gitea.Team, d *schema.ResourceData) (err error) { +func setTeamResourceData(team *gitea.Team, d *schema.ResourceData, meta interface{}) (err error) { + client := meta.(*gitea.Client) + if err := client.CheckServerVersionConstraint(">= 1.19.4"); err != nil { + d.Set(TeamOrg, d.Get(TeamOrg).(string)) + } else { + d.Set(TeamOrg, team.Organization.UserName) + } d.SetId(fmt.Sprintf("%d", team.ID)) d.Set(TeamCreateRepoFlag, team.CanCreateOrgRepo) d.Set(TeamDescription, team.Description) @@ -216,8 +240,8 @@ func setTeamResourceData(team *gitea.Team, d *schema.ResourceData) (err error) { d.Set(TeamPermissions, string(team.Permission)) d.Set(TeamIncludeAllReposFlag, team.IncludesAllRepositories) d.Set(TeamUnits, d.Get(TeamUnits).(string)) - d.Set(TeamOrg, d.Get(TeamOrg).(string)) d.Set(TeamMembers, d.Get(TeamMembers)) + d.Set(TeamRepositories, d.Get(TeamRepositories)) return } @@ -228,7 +252,7 @@ func resourceGiteaTeam() *schema.Resource { Update: resourceTeamUpdate, Delete: resourceTeamDelete, Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, + StateContext: schema.ImportStatePassthroughContext, }, Schema: map[string]*schema.Schema{ "name": { @@ -290,7 +314,75 @@ func resourceGiteaTeam() *schema.Resource { Computed: true, Description: "List of Users that should be part of this team", }, + "repositories": { + Type: schema.TypeList, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Optional: true, + Required: false, + Computed: true, + Description: "List of Repositories that should be part of this team", + }, }, Description: "`gitea_team` manages Team that are part of an organisation.", } } + +func setTeamRepositories(team *gitea.Team, d *schema.ResourceData, meta interface{}, update bool) (err error) { + client := meta.(*gitea.Client) + + org := d.Get(TeamOrg).(string) + + repositories := make(map[string]bool) + for _, repo := range d.Get(TeamRepositories).([]interface{}) { + if repo != "" { + repositories[repo.(string)] = true + } + } + + if update { + page := 1 + + for { + var existingRepositories []*gitea.Repository + existingRepositories, _, err = client.ListTeamRepositories(team.ID, gitea.ListTeamRepositoriesOptions{ + ListOptions: gitea.ListOptions{ + Page: page, + PageSize: 50, + }, + }) + if err != nil { + return errors.New(fmt.Sprintf("[ERROR] Error listeng team repositories: %s", err)) + } + if len(existingRepositories) == 0 { + break + } + + for _, exr := range existingRepositories { + _, exists := repositories[exr.Name] + if exists { + repositories[exr.Name] = false + } else { + _, err = client.RemoveTeamRepository(team.ID, org, exr.Name) + if err != nil { + return errors.New(fmt.Sprintf("[ERROR] Error removing team repository %q: %s", exr.Name, err)) + } + } + } + + page += 1 + } + } + + for repo, flag := range repositories { + if flag { + _, err = client.AddTeamRepository(team.ID, org, repo) + if err != nil { + return errors.New(fmt.Sprintf("[ERROR] Error adding team repository %q: %s", repo, err)) + } + } + } + + return +} diff --git a/gitea/resource_gitea_token.go b/gitea/resource_gitea_token.go new file mode 100644 index 0000000..230e6dd --- /dev/null +++ b/gitea/resource_gitea_token.go @@ -0,0 +1,151 @@ +package gitea + +import ( + "fmt" + "strconv" + + "code.gitea.io/sdk/gitea" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +const ( + TokenUsername string = "username" + TokenName string = "name" + TokenHash string = "token" + TokenLastEight string = "last_eight" +) + +func searchTokenById(c *gitea.Client, id int64) (res *gitea.AccessToken, err error) { + page := 1 + + for { + tokens, _, err := c.ListAccessTokens(gitea.ListAccessTokensOptions{ + ListOptions: gitea.ListOptions{ + Page: page, + PageSize: 50, + }, + }) + if err != nil { + return nil, err + } + + if len(tokens) == 0 { + return nil, fmt.Errorf("Token with ID %d could not be found", id) + } + + for _, token := range tokens { + if token.ID == id { + return token, nil + } + } + + page += 1 + } +} + +func resourceTokenCreate(d *schema.ResourceData, meta interface{}) (err error) { + + client := meta.(*gitea.Client) + + var opt gitea.CreateAccessTokenOption + opt.Name = d.Get(TokenName).(string) + + token, _, err := client.CreateAccessToken(opt) + + if err != nil { + return err + } + + err = setTokenResourceData(token, d) + + return +} + +func resourceTokenRead(d *schema.ResourceData, meta interface{}) (err error) { + + client := meta.(*gitea.Client) + + var token *gitea.AccessToken + + id, err := strconv.ParseInt(d.Id(), 10, 64) + + token, err = searchTokenById(client, id) + + if err != nil { + return err + } + + err = setTokenResourceData(token, d) + + return +} + +func resourceTokenDelete(d *schema.ResourceData, meta interface{}) (err error) { + + client := meta.(*gitea.Client) + var resp *gitea.Response + + resp, err = client.DeleteAccessToken(d.Get(TokenName).(string)) + + if err != nil { + if resp.StatusCode == 404 { + return + } else { + return err + } + } + + return +} + +func setTokenResourceData(token *gitea.AccessToken, d *schema.ResourceData) (err error) { + + d.SetId(fmt.Sprintf("%d", token.ID)) + d.Set(TokenName, token.Name) + if token.Token != "" { + d.Set(TokenHash, token.Token) + } + d.Set(TokenLastEight, token.TokenLastEight) + + return +} + +func resourceGiteaToken() *schema.Resource { + return &schema.Resource{ + Read: resourceTokenRead, + Create: resourceTokenCreate, + Delete: resourceTokenDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + Schema: map[string]*schema.Schema{ + "username": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The owner of the Access Token", + }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the Access Token", + }, + "token": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + Description: "The actual Access Token", + }, + "last_eight": { + Type: schema.TypeString, + Computed: true, + }, + }, + Description: "`gitea_token` manages gitea Access Tokens.\n\n" + + "Due to upstream limitations (see https://gitea.com/gitea/go-sdk/issues/610) this resource\n" + + "can only be used with username/password provider configuration.\n\n" + + "WARNING:\n" + + "Tokens will be stored in the terraform state!", + } +} diff --git a/gitea/resource_gitea_user.go b/gitea/resource_gitea_user.go index 432b24e..7603d94 100644 --- a/gitea/resource_gitea_user.go +++ b/gitea/resource_gitea_user.go @@ -5,7 +5,7 @@ import ( "strconv" "code.gitea.io/sdk/gitea" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( diff --git a/go.mod b/go.mod index c776030..7d84a7a 100644 --- a/go.mod +++ b/go.mod @@ -1,71 +1,73 @@ module code.gitea.io/terraform-provider-gitea -go 1.17 +go 1.21 require ( code.gitea.io/sdk/gitea v0.15.1 - github.com/hashicorp/terraform-plugin-sdk v1.13.0 + github.com/hashicorp/terraform-plugin-docs v0.16.0 + github.com/hashicorp/terraform-plugin-log v0.9.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 ) require ( - cloud.google.com/go v0.45.1 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/agext/levenshtein v1.2.2 // indirect - github.com/apparentlymart/go-cidr v1.0.1 // indirect - github.com/apparentlymart/go-textseg v1.0.0 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/aws/aws-sdk-go v1.25.3 // indirect - github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.7.0 // indirect - github.com/golang/protobuf v1.3.4 // indirect - github.com/google/go-cmp v0.3.1 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/googleapis/gax-go/v2 v2.0.5 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.1 // indirect - github.com/hashicorp/go-getter v1.4.0 // indirect - github.com/hashicorp/go-hclog v0.9.2 // indirect - github.com/hashicorp/go-multierror v1.0.0 // indirect - github.com/hashicorp/go-plugin v1.0.1 // indirect - github.com/hashicorp/go-safetemp v1.0.0 // indirect - github.com/hashicorp/go-uuid v1.0.1 // indirect - github.com/hashicorp/go-version v1.4.0 // indirect - github.com/hashicorp/golang-lru v0.5.1 // indirect - github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f // indirect - github.com/hashicorp/hcl/v2 v2.0.0 // indirect + github.com/cloudflare/circl v1.3.3 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-checkpoint v0.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/hc-install v0.5.2 // indirect + github.com/hashicorp/hcl/v2 v2.17.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 // indirect - github.com/hashicorp/terraform-json v0.4.0 // indirect - github.com/hashicorp/terraform-plugin-test v1.3.0 // indirect - github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 // indirect + github.com/hashicorp/terraform-exec v0.18.1 // indirect + github.com/hashicorp/terraform-json v0.17.1 // indirect + github.com/hashicorp/terraform-plugin-go v0.16.0 // indirect + github.com/hashicorp/terraform-registry-address v0.2.1 // indirect + github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect - github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect - github.com/mattn/go-colorable v0.1.1 // indirect - github.com/mattn/go-isatty v0.0.5 // indirect - github.com/mitchellh/cli v1.0.0 // indirect - github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/huandu/xstrings v1.3.2 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mitchellh/cli v1.1.5 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.1.2 // indirect - github.com/mitchellh/reflectwalk v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect - github.com/posener/complete v1.2.1 // indirect - github.com/spf13/afero v1.2.2 // indirect - github.com/ulikunitz/xz v0.5.5 // indirect - github.com/vmihailenco/msgpack v4.0.1+incompatible // indirect - github.com/zclconf/go-cty v1.2.1 // indirect - github.com/zclconf/go-cty-yaml v1.0.1 // indirect - go.opencensus.io v0.22.0 // indirect - golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect - golang.org/x/net v0.0.0-20200301022130-244492dfa37a // indirect - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect - golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect - golang.org/x/text v0.3.2 // indirect - google.golang.org/api v0.9.0 // indirect - google.golang.org/appengine v1.6.1 // indirect - google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a // indirect - google.golang.org/grpc v1.27.1 // indirect + github.com/posener/complete v1.2.3 // indirect + github.com/russross/blackfriday v1.6.0 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/zclconf/go-cty v1.13.2 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect + golang.org/x/mod v0.11.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/text v0.11.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + google.golang.org/grpc v1.56.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect ) diff --git a/go.sum b/go.sum index 392f838..7ed2820 100644 --- a/go.sum +++ b/go.sum @@ -1,316 +1,244 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= -code.gitea.io/sdk/gitea v0.12.0 h1:hvDCz4wtFvo7rf5Ebj8tGd4aJ4wLPKX3BKFX9Dk1Pgs= -code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M= code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= +github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= -github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= -github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/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 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= +github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw= -github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1 h1:4OtAfUGbnKC6yS48p0CtMX2oFYtzFZVv6rok3cRWgnE= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= +github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= -github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= -github.com/hashicorp/hcl/v2 v2.0.0 h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8= -github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hc-install v0.5.2 h1:SfwMFnEXVVirpwkDuSF5kymUOhrUxrTq3udEseZdOD0= +github.com/hashicorp/hc-install v0.5.2/go.mod h1:9QISwe6newMWIfEiXpzuu1k9HAGtQYgnSH8H9T8wmoI= +github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZVY= +github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY= -github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-json v0.4.0 h1:KNh29iNxozP5adfUFBJ4/fWd0Cu3taGgjHB38JYqOF4= -github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= -github.com/hashicorp/terraform-plugin-sdk v1.13.0 h1:8v2/ZNiI12OHxEn8pzJ3noCHyRc0biKbKj+iFv5ZWKw= -github.com/hashicorp/terraform-plugin-sdk v1.13.0/go.mod h1:HiWIPD/T9HixIhQUwaSoDQxo4BLFdmiBi/Qz5gjB8Q0= -github.com/hashicorp/terraform-plugin-test v1.3.0 h1:hU5LoxrOn9qvOo+LTKN6mSav2J+dAMprbdxJPEQvp4U= -github.com/hashicorp/terraform-plugin-test v1.3.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= -github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= -github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= +github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= +github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= +github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= +github.com/hashicorp/terraform-plugin-docs v0.16.0 h1:UmxFr3AScl6Wged84jndJIfFccGyBZn52KtMNsS12dI= +github.com/hashicorp/terraform-plugin-docs v0.16.0/go.mod h1:M3ZrlKBJAbPMtNOPwHicGi1c+hZUh7/g0ifT/z7TVfA= +github.com/hashicorp/terraform-plugin-go v0.16.0 h1:DSOQ0rz5FUiVO4NUzMs8ln9gsPgHMTsfns7Nk+6gPuE= +github.com/hashicorp/terraform-plugin-go v0.16.0/go.mod h1:4sn8bFuDbt+2+Yztt35IbOrvZc0zyEi87gJzsTgCES8= +github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= +github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 h1:I8efBnjuDrgPjNF1MEypHy48VgcTIUY4X6rOFunrR3Y= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0/go.mod h1:cUEP4ly/nxlHy5HzD6YRrHydtlheGvGRJDhiWqqVik4= +github.com/hashicorp/terraform-registry-address v0.2.1 h1:QuTf6oJ1+WSflJw6WYOHhLgwUiQ0FrROpHPYFtwTYWM= +github.com/hashicorp/terraform-registry-address v0.2.1/go.mod h1:BSE9fIFzp0qWsJUUyGquo4ldV9k2n+psif6NYkBRS3Y= +github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= +github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= -github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +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= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= -github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= -github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= -github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= -github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= +github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a h1:lRlI5zu6AFy3iU/F8YWyNrAmn/tPCnhiTxfwhWb76eU= -google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/grpc v1.56.0 h1:+y7Bs8rtMd07LeXmL3NxcTLn7mUkbKZqEpPhMNkwJEE= +google.golang.org/grpc v1.56.0/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index 730ab2a..a6ec930 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,12 @@ -package main // import "src.techknowlogick.com/terraform-provider-gitea" +package main // import "code.gitea.ioterraform-provider-gitea" import ( "code.gitea.io/terraform-provider-gitea/gitea" - "github.com/hashicorp/terraform-plugin-sdk/plugin" + "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" ) +var Version = "development" + func main() { plugin.Serve(&plugin.ServeOpts{ ProviderFunc: gitea.Provider}) diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 0000000..41d3686 --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,5 @@ +package tools + +import ( + _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs" +)