Skip to content

Commit

Permalink
Merge pull request #28 from permitio/raz/per-8703-fix-terraform-tests
Browse files Browse the repository at this point in the history
Raz/per 8703 fix terraform tests
  • Loading branch information
RazcoDev committed Jan 10, 2024
2 parents 488c258 + 0cac239 commit eefb808
Show file tree
Hide file tree
Showing 12 changed files with 300 additions and 187 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,18 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go build -v .
- name: Run linters
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
with:
version: latest
- uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0

generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
cache: true
Expand All @@ -67,8 +62,8 @@ jobs:
- '1.3.*'
- '1.4.*'
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
cache: true
Expand All @@ -81,5 +76,6 @@ jobs:
- env:
TF_ACC: "1"
PERMITIO_API_KEY: ${{ fromJson(secrets.PERMITIO_API_KEY)[matrix.terraform] }}
PERMITIO_TIMEOUT: 20
run: go test -v -cover ./internal/provider/
timeout-minutes: 10
18 changes: 9 additions & 9 deletions docs/resources/permitio_condition_set_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "permitio_condition_set_rule Resource - terraform-provider-permit-io"
subcategory: ""
description: |-
See our documentation https://api.permit.io/v2/redoc#tag/Condition-Set-Rules for more information on condition sets rules.
---

# permitio_condition_set_rule (Resource)


See [our documentation](https://api.permit.io/v2/redoc#tag/Condition-Set-Rules) for more information on condition sets rules.



Expand All @@ -17,13 +17,13 @@ description: |-

### Required

- `permission` (String)
- `resource_set` (String)
- `user_set` (String)
- `permission` (String) The permission that will be granted to the userset on the resourceset. The permission can be either a resource action id, or {resource_key}:{action_key}, i.e: the "permission name".
- `resource_set` (String) The resourceset that represents the resources that are granted for access, i.e: all the resources matching this rule can be accessed by the userset to perform the granted permission
- `user_set` (String) The userset that will be given permission, i.e: all the users matching this rule will be given the specified permission

### Read-Only

- `environment_id` (String)
- `id` (String) The ID of this resource.
- `organization_id` (String)
- `project_id` (String)
- `environment_id` (String) Unique id of the environment that owns the condition set rule
- `id` (String) Unique id of the condition set rule
- `organization_id` (String) Unique id of the organization that owns the condition set rule
- `project_id` (String) Unique id of the project that owns the condition set rule
30 changes: 19 additions & 11 deletions docs/resources/permitio_proxy_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "permitio_proxy_config Resource - terraform-provider-permit-io"
subcategory: ""
description: |-
See the documentation https://api.permit.io/v2/redoc#tag/Proxy-Config/operation/create_proxy_config for more information about proxy configs.
---

# permitio_proxy_config (Resource)


See [the documentation](https://api.permit.io/v2/redoc#tag/Proxy-Config/operation/create_proxy_config) for more information about proxy configs.



Expand All @@ -17,18 +17,26 @@ description: |-

### Required

- `auth_mechanism` (String)
- `auth_secret` (Attributes) (see [below for nested schema](#nestedatt--auth_secret))
- `key` (String)
- `mapping_rules` (Attributes List) (see [below for nested schema](#nestedatt--mapping_rules))
- `name` (String)
- `auth_mechanism` (String) Default: "Bearer"
Enum: "Bearer" "Basic" "Headers"
Proxy config auth mechanism will define the authentication mechanism that will be used to authenticate the request.

Bearer injects the secret into the Authorization header as a Bearer token,

Basic injects the secret into the Authorization header as a Basic user:password,

Headers injects plain headers into the request.
- `auth_secret` (Attributes) Proxy config secret is set to enable the Permit Proxy to make proxied requests to the backend service. (see [below for nested schema](#nestedatt--auth_secret))
- `key` (String) Proxy Config is set to enable the Permit Proxy to make proxied requests as part of the Frontend AuthZ.
- `mapping_rules` (Attributes List) Proxy config mapping rules will include the rules that will be used to map the request to the backend service by a URL and a http method. (see [below for nested schema](#nestedatt--mapping_rules))
- `name` (String) The name of the proxy config, for example: 'Stripe API

### Read-Only

- `environment_id` (String)
- `id` (String) The ID of this resource.
- `organization_id` (String)
- `project_id` (String)
- `environment_id` (String) Unique id of the environment that owns the proxy config
- `id` (String) Unique id of the proxy config
- `organization_id` (String) Unique id of the organization that owns the proxy config
- `project_id` (String) Unique id of the project that owns the proxy config

<a id="nestedatt--auth_secret"></a>
### Nested Schema for `auth_secret`
Expand Down
30 changes: 15 additions & 15 deletions docs/resources/permitio_relation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "permitio_relation Resource - terraform-provider-permit-io"
subcategory: ""
description: |-
See the documentation https://api.permit.io/v2/redoc#tag/Resource-Relations/operation/create_resource_relation for more information about Relations
---

# permitio_relation (Resource)


See [the documentation](https://api.permit.io/v2/redoc#tag/Resource-Relations/operation/create_resource_relation) for more information about Relations



Expand All @@ -17,22 +17,22 @@ description: |-

### Required

- `key` (String)
- `name` (String)
- `object_resource` (String)
- `subject_resource` (String)
- `key` (String) The key. This is a unique identifier.
- `name` (String) The name. This is a human-readable name for the object.
- `object_resource` (String) The object resource ID or key
- `subject_resource` (String) The subject resource ID or key

### Optional

- `description` (String)
- `updated_at` (String)
- `description` (String) The description. This is a human-readable description for the object.
- `updated_at` (String) The update timestamp. This is a timestamp for when the object was last updated.

### Read-Only

- `created_at` (String)
- `environment_id` (String)
- `id` (String) The ID of this resource.
- `object_resource_id` (String)
- `organization_id` (String)
- `project_id` (String)
- `subject_resource_id` (String)
- `created_at` (String) The creation timestamp. This is a timestamp for when the object was created.
- `environment_id` (String) The environment ID. This is a unique identifier for the environment.
- `id` (String) The resource ID. This is a unique identifier for the resource.
- `object_resource_id` (String) The object resource ID
- `organization_id` (String) The organization ID. This is a unique identifier for the organization.
- `project_id` (String) The project ID. This is a unique identifier for the project.
- `subject_resource_id` (String) The subject resource ID
29 changes: 15 additions & 14 deletions docs/resources/permitio_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "permitio_resource Resource - terraform-provider-permit-io"
subcategory: ""
description: |-
See the documentation https://api.permit.io/v2/redoc#tag/Resources/operation/create_resource for more information about resources.
---

# permitio_resource (Resource)


See [the documentation](https://api.permit.io/v2/redoc#tag/Resources/operation/create_resource) for more information about resources.



Expand All @@ -17,24 +17,25 @@ description: |-

### Required

- `actions` (Attributes Map) (see [below for nested schema](#nestedatt--actions))
- `key` (String)
- `name` (String)
- `actions` (Attributes Map) A actions definition block, typically contained within a resource type definition block.
The actions represents the ways you can interact with a protected resource. (see [below for nested schema](#nestedatt--actions))
- `key` (String) A URL-friendly name of the resource (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the resource.
- `name` (String) The name of the resource

### Optional

- `attributes` (Attributes Map) (see [below for nested schema](#nestedatt--attributes))
- `description` (String)
- `updated_at` (String)
- `urn` (String)
- `attributes` (Attributes Map) Attributes that each resource of this type defines, and can be used in your ABAC policies. (see [below for nested schema](#nestedatt--attributes))
- `description` (String) An optional longer description of what this resource respresents in your system
- `updated_at` (String) Timestamp when the resource was last updated
- `urn` (String) The URN (Uniform Resource Name) of the resource

### Read-Only

- `created_at` (String)
- `environment_id` (String)
- `id` (String) The ID of this resource.
- `organization_id` (String)
- `project_id` (String)
- `created_at` (String) Timestamp when the resource was created
- `environment_id` (String) Unique id of the environment that owns the resource
- `id` (String) Unique id of the resource
- `organization_id` (String) Unique id of the organization that owns the resource
- `project_id` (String) Unique id of the project that owns the resource

<a id="nestedatt--actions"></a>
### Nested Schema for `actions`
Expand Down
20 changes: 10 additions & 10 deletions docs/resources/permitio_resource_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "permitio_resource_set Resource - terraform-provider-permit-io"
subcategory: ""
description: |-
See the our documentation https://api.permit.io/v2/redoc#tag/Condition-Sets/operation/create_condition_set for more information on condition sets.
---

# permitio_resource_set (Resource)


See the [our documentation](https://api.permit.io/v2/redoc#tag/Condition-Sets/operation/create_condition_set) for more information on condition sets.



Expand All @@ -17,18 +17,18 @@ description: |-

### Required

- `conditions` (String)
- `key` (String)
- `name` (String)
- `conditions` (String) a boolean expression that consists of multiple conditions, with and/or logic.
- `key` (String) A unique id by which Permit will identify the condition set. The key will be used as the generated rego rule name.
- `name` (String) A descriptive name for the set, i.e: 'US based employees' or 'Users behind VPN'
- `resource` (String)

### Optional

- `description` (String)
- `description` (String) an optional longer description of the set

### Read-Only

- `environment_id` (String)
- `id` (String) The ID of this resource.
- `organization_id` (String)
- `project_id` (String)
- `environment_id` (String) The id of the environment to which the condition set belongs.
- `id` (String) A unique id by which Permit will identify the condition set. The key will be used as the generated rego rule name.
- `organization_id` (String) The id of the organization to which the condition set belongs.
- `project_id` (String) The id of the project to which the condition set belongs.
32 changes: 17 additions & 15 deletions docs/resources/permitio_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
page_title: "permitio_role Resource - terraform-provider-permit-io"
subcategory: ""
description: |-
See the documentation https://api.permit.io/v2/redoc#tag/Resources/operation/create_resource for more information about roles.
You can also read about Resource Roles here https://api.permit.io/v2/redoc#tag/Resource-Roles/operation/create_resource_role.
---

# permitio_role (Resource)


See [the documentation](https://api.permit.io/v2/redoc#tag/Resources/operation/create_resource) for more information about roles.
You can also read about Resource Roles [here](https://api.permit.io/v2/redoc#tag/Resource-Roles/operation/create_resource_role).



Expand All @@ -17,22 +19,22 @@ description: |-

### Required

- `key` (String)
- `name` (String)
- `key` (String) The key. This is a unique identifier.
- `name` (String) The name. This is a human-readable name for the object.

### Optional

- `description` (String)
- `extends` (Set of String)
- `permissions` (Set of String)
- `resource` (String)
- `updated_at` (String)
- `description` (String) The description. This is a human-readable description for the object.
- `extends` (Set of String) list of role keys that define what roles this role extends. In other words: this role will automatically inherit all the permissions of the given roles in this list.
- `permissions` (Set of String) list of action keys that define what actions this resource role is permitted to do
- `resource` (String) The unique resource key that the role belongs to.
- `updated_at` (String) The update timestamp. This is a timestamp for when the object was last updated.

### Read-Only

- `created_at` (String)
- `environment_id` (String)
- `id` (String) The ID of this resource.
- `organization_id` (String)
- `project_id` (String)
- `resource_id` (String)
- `created_at` (String) The creation timestamp. This is a timestamp for when the object was created.
- `environment_id` (String) The environment ID. This is a unique identifier for the environment.
- `id` (String) The resource ID. This is a unique identifier for the resource.
- `organization_id` (String) The organization ID. This is a unique identifier for the organization.
- `project_id` (String) The project ID. This is a unique identifier for the project.
- `resource_id` (String) The unique resource ID that the role belongs to.
14 changes: 7 additions & 7 deletions docs/resources/permitio_role_derivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "permitio_role_derivation Resource - terraform-provider-permit-io"
subcategory: ""
description: |-
See the documentation https://api.permit.io/v2/redoc#tag/Implicit-Grants/operation/create_implicit_grant for more information on role derivations.
---

# permitio_role_derivation (Resource)


See [the documentation](https://api.permit.io/v2/redoc#tag/Implicit-Grants/operation/create_implicit_grant) for more information on role derivations.



Expand All @@ -17,8 +17,8 @@ description: |-

### Required

- `linked_by` (String)
- `on_resource` (String)
- `resource` (String)
- `role` (String)
- `to_role` (String)
- `linked_by` (String) The relation that links the resource to the role.
- `on_resource` (String) The resource that the user will derive the role on.
- `resource` (String) Either the unique id of the resource, or the URL-friendly key of the resource that you want to create role derivation for.
- `role` (String) The role that the user will derive.
- `to_role` (String) The role that you want to create role derivation for.
Loading

0 comments on commit eefb808

Please sign in to comment.