2023-03-28 20:12:41 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2021-11-16 18:04:01 +00:00
|
|
|
//go:build !consulent
|
2019-10-15 20:58:50 +00:00
|
|
|
// +build !consulent
|
|
|
|
|
|
|
|
package acl
|
|
|
|
|
2019-10-24 18:38:09 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/hashicorp/hcl"
|
|
|
|
)
|
|
|
|
|
|
|
|
// EnterprisePolicyMeta stub
|
|
|
|
type EnterprisePolicyMeta struct{}
|
|
|
|
|
2019-10-15 20:58:50 +00:00
|
|
|
// EnterpriseRule stub
|
|
|
|
type EnterpriseRule struct{}
|
|
|
|
|
2019-12-18 18:44:32 +00:00
|
|
|
func (r *EnterpriseRule) Validate(string, *Config) error {
|
2019-10-15 20:58:50 +00:00
|
|
|
// nothing to validate
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// EnterprisePolicyRules stub
|
|
|
|
type EnterprisePolicyRules struct{}
|
|
|
|
|
2019-12-18 18:44:32 +00:00
|
|
|
func (r *EnterprisePolicyRules) Validate(*Config) error {
|
2019-10-15 20:58:50 +00:00
|
|
|
// nothing to validate
|
|
|
|
return nil
|
|
|
|
}
|
2019-10-24 18:38:09 +00:00
|
|
|
|
2019-12-18 18:44:32 +00:00
|
|
|
func decodeRules(rules string, _ *Config, _ *EnterprisePolicyMeta) (*Policy, error) {
|
2019-10-24 18:38:09 +00:00
|
|
|
p := &Policy{}
|
|
|
|
|
|
|
|
if err := hcl.Decode(p, rules); err != nil {
|
|
|
|
return nil, fmt.Errorf("Failed to parse ACL rules: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return p, nil
|
|
|
|
}
|