Skip to content

Commit 7b88a36

Browse files
authored
Merge pull request #14 from authzed/barakmich/small-review
Small review for some lints, clean up some examples, and some tighter constraints
2 parents 96d2387 + 8bfbdb6 commit 7b88a36

17 files changed

+17
-55
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ dist/
1111
*.dylib
1212
*.test
1313
*.out
14+
# Terraform state
15+
*.tfstate
16+
*.tfstate.backup

examples/provider/terraform.tfstate

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/provider/terraform.tfstate.backup

Lines changed: 0 additions & 9 deletions
This file was deleted.

internal/client/cloud_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewCloudClient(cfg *CloudClientConfig) *CloudClient {
4848
}
4949

5050
// NewRequest creates a new HTTP request with the necessary headers
51-
func (c *CloudClient) NewRequest(method, path string, body interface{}) (*http.Request, error) {
51+
func (c *CloudClient) NewRequest(method, path string, body any) (*http.Request, error) {
5252
// Fix URL construction to handle trailing slashes properly
5353
host := c.Host
5454
// Remove trailing slash from host if path starts with slash

internal/client/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func NewAPIError(resp *http.Response) *APIError {
2828

2929
var errMsg string
3030
// Try to parse as JSON if possible
31-
var jsonErr map[string]interface{}
31+
var jsonErr map[string]any
3232
if err := json.Unmarshal(body, &jsonErr); err == nil {
3333
if msg, ok := jsonErr["message"].(string); ok {
3434
errMsg = msg

internal/client/platform_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewPlatformClient(cfg *PlatformClientConfig) *PlatformClient {
4848
}
4949

5050
// NewRequest creates a new HTTP request with the necessary headers
51-
func (c *PlatformClient) NewRequest(method, path string, body interface{}) (*http.Request, error) {
51+
func (c *PlatformClient) NewRequest(method, path string, body any) (*http.Request, error) {
5252
url := fmt.Sprintf("%s%s", c.Host, path)
5353

5454
var bodyReader io.Reader

internal/provider/permission_system_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/hashicorp/terraform-plugin-framework/types"
1313
)
1414

15-
var _ datasource.DataSource = &permissionsSystemDataSource{}
15+
var _ datasource.DataSourceWithConfigure = &permissionsSystemDataSource{}
1616

1717
func NewPermissionsSystemDataSource() datasource.DataSource {
1818
return &permissionsSystemDataSource{}

internal/provider/permission_systems_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/hashicorp/terraform-plugin-framework/types"
1212
)
1313

14-
var _ datasource.DataSource = &permissionsSystemsDataSource{}
14+
var _ datasource.DataSourceWithConfigure = &permissionsSystemsDataSource{}
1515

1616
func NewPermissionsSystemsDataSource() datasource.DataSource {
1717
return &permissionsSystemsDataSource{}

internal/provider/policies_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/hashicorp/terraform-plugin-framework/types"
1212
)
1313

14-
var _ datasource.DataSource = &policiesDataSource{}
14+
var _ datasource.DataSourceWithConfigure = &policiesDataSource{}
1515

1616
func NewPoliciesDataSource() datasource.DataSource {
1717
return &policiesDataSource{}

internal/provider/policy_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/hashicorp/terraform-plugin-framework/types"
1212
)
1313

14-
var _ datasource.DataSource = &policyDataSource{}
14+
var _ datasource.DataSourceWithConfigure = &policyDataSource{}
1515

1616
func NewPolicyDataSource() datasource.DataSource {
1717
return &policyDataSource{}

0 commit comments

Comments
 (0)