Skip to content

Commit 66b0d39

Browse files
Refactor and update various resource files for improved functionality and clarity
- Remove unnecessary comments and update descriptions in `.copywrite.hcl`, `.github/CODEOWNERS`, and `.github/CODE_OF_CONDUCT.md`. - Enhance `.gitignore` to include additional files. - Modify VSCode settings in `.vscode/settings.json` for explicit code actions on save. - Update acceptance test command in `GNUmakefile`. - Clarify application resource documentation in `docs/resources/application.md`. - Remove deprecated permissions from `docs/resources/organization_user.md` and update examples in `examples/resources/kinde_user_role/resource.tf`. - Improve error handling in `internal/provider/api_resource.go`, `internal/provider/role_resource.go`, and `internal/provider/user_resource.go`. - Add pagination handling for permissions in `internal/provider/permission_resource.go`. - Refactor user identity management in `internal/provider/user_resource.go`.
1 parent f341ce4 commit 66b0d39

28 files changed

+336
-247
lines changed

.copywrite.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# NOTE: This file is for HashiCorp specific licensing automation and can be deleted after creating a new repo with this template.
21
schema_version = 1
32

43
project {

.github/CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
* @hashicorp/terraform-devex
1+
* @kinde-oss/giants-kinde
2+
package.json @kinde-oss/sdk-engineers
3+
**/package.json @kinde-oss/sdk-engineers

.github/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code.
44

5-
Please read the full text at https://www.hashicorp.com/community-guidelines
5+
Please read the full text at [HashiCorp Community Guidelines](https://www.hashicorp.com/community-guidelines).

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@ coverage/
2121
# System files
2222
.DS_Store
2323

24+
# Serena mcp
25+
.serena
26+
project.yml
27+
2428
# ---------------------------------------------------------------------
2529
# Add specific rules here…

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.codeActionsOnSave": {"source.fixAll": true},
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll": "explicit"
5+
},
46
"editor.formatOnSave": true,
57
"files.trimTrailingWhitespace": true,
68
"markdown.extension.italic.indicator": "_",

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default: testacc
33
# Run acceptance tests
44
.PHONY: testacc
55
testacc:
6-
set -a && source .env && set +a && TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
6+
set -a && . .env && set +a && TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
77

88
# Run unit tests
99
.PHONY: test

docs/resources/application.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ description: |-
1010

1111
Applications facilitates the interface for users to authenticate against. See [documentation](https://docs.kinde.com/build/applications/about-applications/) for more details.
1212

13-
14-
1513
<!-- schema generated by tfplugindocs -->
1614
## Schema
1715

1816
### Required
1917

20-
- `name` (String) Name of the application. Currently, there is no way to change this via the management application.
18+
- `name` (String) Name of the application. Currently, there is no way to change this via the management application, so changing this value forces creation of a new application.
2119
- `type` (String) Type of the application
2220

2321
### Optional

docs/resources/organization_user.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ description: |-
1010

1111
Manages a user's membership and roles in a Kinde organization.
1212

13+
> Note: The Kinde Management API currently supports attaching users to organizations and assigning roles. Direct permission assignments on memberships are not exposed by the API, so this resource only manages roles.
14+
1315
## Example Usage
1416

1517
```terraform
@@ -29,16 +31,6 @@ resource "kinde_organization_user" "with_roles" {
2931
]
3032
}
3133
32-
# Organization user with permissions
33-
resource "kinde_organization_user" "with_permissions" {
34-
organization_code = "org_123" # Replace with your organization code
35-
user_id = kinde_user.example.id
36-
permissions = [
37-
kinde_permission.read_users.id,
38-
kinde_permission.write_users.id
39-
]
40-
}
41-
4234
# Full example with user creation and organization membership
4335
resource "kinde_user" "example" {
4436
first_name = "John"
@@ -55,7 +47,6 @@ resource "kinde_organization_user" "full_example" {
5547
organization_code = "org_123" # Replace with your organization code
5648
user_id = kinde_user.example.id
5749
roles = [kinde_role.admin.id]
58-
permissions = [kinde_permission.read_users.id]
5950
}
6051
```
6152

@@ -69,7 +60,6 @@ resource "kinde_organization_user" "full_example" {
6960

7061
### Optional
7162

72-
- `permissions` (List of String) The list of permission IDs to assign to the user.
7363
- `roles` (List of String) The list of role IDs to assign to the user.
7464

7565
### Read-Only

docs/resources/role.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Roles represent collections of permissions that can be assigned to users. See [d
1717
resource "kinde_role" "basic" {
1818
name = "basic_role"
1919
key = "basic_role"
20+
description = "Basic role description"
2021
}
2122
2223
# Role with description

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
This directory contains examples that are mostly used for documentation, but can also be run/tested manually via the Terraform CLI.
44

5-
The document generation tool looks for files in the following locations by default. All other *.tf files besides the ones mentioned below are ignored by the documentation tool. This is useful for creating examples that can run and/or ar testable even if some parts are not relevant for the documentation.
5+
The document generation tool looks for files in the following locations by default. All other *.tf files besides the ones mentioned below are ignored by the documentation tool. This is useful for creating examples that can run and/or are testable even if some parts are not relevant for the documentation.
66

77
* **provider/provider.tf** example file for the provider index page
88
* **data-sources/`full data source name`/data-source.tf** example file for the named data source page
9-
* **resources/`full resource name`/resource.tf** example file for the named data source page
9+
* **resources/`full resource name`/resource.tf** example file for the named resource page

0 commit comments

Comments
 (0)