Skip to content

Commit

Permalink
address some PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
raskchanky committed Aug 30, 2023
1 parent d778f18 commit bb0290d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vault/resource_quota_lease_count.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func quotaLeaseCountResource() *schema.Resource {
Description: "The maximum number of leases to be allowed by the quota rule. The max_leases must be positive.",
ValidateFunc: validation.IntAtLeast(0),
},
"role": {
consts.FieldRole: {
Type: schema.TypeString,
Optional: true,
Description: "If set on a quota where path is set to an auth mount with a concept of roles (such as /auth/approle/), this will make the quota restrict login requests to that mount that are made with the specified role.",
Expand Down
2 changes: 2 additions & 0 deletions vault/resource_quota_lease_count_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func TestQuotaLeaseCountWithRole(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "name", name),
resource.TestCheckResourceAttr(resourceName, consts.FieldPath, fmt.Sprintf("auth/%s/", backend)),
resource.TestCheckResourceAttr(resourceName, "max_leases", leaseCount),
resource.TestCheckResourceAttr(resourceName, consts.FieldRole, role),
),
},
{
Expand All @@ -86,6 +87,7 @@ func TestQuotaLeaseCountWithRole(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "name", name),
resource.TestCheckResourceAttr(resourceName, consts.FieldPath, fmt.Sprintf("auth/%s/", backend)),
resource.TestCheckResourceAttr(resourceName, "max_leases", newLeaseCount),
resource.TestCheckResourceAttr(resourceName, consts.FieldRole, role),
),
},
},
Expand Down
3 changes: 2 additions & 1 deletion vault/resource_quota_rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/hashicorp/terraform-provider-vault/internal/consts"

"github.com/hashicorp/terraform-provider-vault/internal/provider"
)
Expand Down Expand Up @@ -60,7 +61,7 @@ func quotaRateLimitResource() *schema.Resource {
Description: "If set, when a client reaches a rate limit threshold, the client will be prohibited from any further requests until after the 'block_interval' in seconds has elapsed.",
ValidateFunc: validation.IntAtLeast(0),
},
"role": {
consts.FieldRole: {
Type: schema.TypeString,
Optional: true,
Description: "If set on a quota where path is set to an auth mount with a concept of roles (such as /auth/approle/), this will make the quota restrict login requests to that mount that are made with the specified role.",
Expand Down
2 changes: 1 addition & 1 deletion vault/resource_quota_rate_limit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestQuotaRateLimitWithRole(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "rate", rateLimit),
resource.TestCheckResourceAttr(resourceName, "interval", "1"),
resource.TestCheckResourceAttr(resourceName, "block_interval", "0"),
resource.TestCheckResourceAttr(resourceName, "role", role),
resource.TestCheckResourceAttr(resourceName, consts.FieldRole, role),
),
},
},
Expand Down

0 comments on commit bb0290d

Please sign in to comment.