Implement Secrets Manager ACL (#93)
* Add CIDR validator * Implement `syncACL`, add it to creation * Rename function * Rename variables * Add mapACLs * Implement instance update * Add ACLs to acc test * Add ACL to schema * Add new line * Fix not using the ACLs read from config * Add test case where ACLs aren't set * Fix lint * Generate docs * Add uniqueness check for ACLs * Add repeated ACLs test cases * Remove debug leftover * Change test cases * Rename data * Add ACL description * Generate docs * Change ACL attribute type * Remove test case --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
3c6748545d
commit
e1265578ce
10 changed files with 770 additions and 13 deletions
|
|
@ -137,3 +137,21 @@ func RFC3339SecondsOnly() *Validator {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
func CIDR() *Validator {
|
||||
description := "value must be in CIDR notation"
|
||||
|
||||
return &Validator{
|
||||
description: description,
|
||||
validate: func(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
|
||||
_, _, err := net.ParseCIDR(req.ConfigValue.ValueString())
|
||||
if err != nil {
|
||||
resp.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
|
||||
req.Path,
|
||||
fmt.Sprintf("parsing value in CIDR notation: %s", err.Error()),
|
||||
req.ConfigValue.ValueString(),
|
||||
))
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue