2019-10-15 20:58:50 +00:00
|
|
|
// +build !consulent
|
|
|
|
|
|
|
|
package structs
|
|
|
|
|
2019-10-24 18:38:09 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/acl"
|
|
|
|
)
|
|
|
|
|
2019-10-15 20:58:50 +00:00
|
|
|
const (
|
|
|
|
EnterpriseACLPolicyGlobalManagement = ""
|
2019-10-24 18:38:09 +00:00
|
|
|
|
|
|
|
// aclPolicyTemplateServiceIdentity is the template used for synthesizing
|
|
|
|
// policies for service identities.
|
|
|
|
aclPolicyTemplateServiceIdentity = `
|
|
|
|
service "%[1]s" {
|
|
|
|
policy = "write"
|
|
|
|
}
|
|
|
|
service "%[1]s-sidecar-proxy" {
|
|
|
|
policy = "write"
|
|
|
|
}
|
|
|
|
service_prefix "" {
|
|
|
|
policy = "read"
|
|
|
|
}
|
|
|
|
node_prefix "" {
|
|
|
|
policy = "read"
|
|
|
|
}`
|
2019-10-15 20:58:50 +00:00
|
|
|
)
|
2019-10-24 18:38:09 +00:00
|
|
|
|
2020-01-14 15:09:29 +00:00
|
|
|
type ACLAuthMethodEnterpriseMeta struct{}
|
|
|
|
|
|
|
|
func (_ *ACLAuthMethodEnterpriseMeta) FillWithEnterpriseMeta(_ *EnterpriseMeta) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (_ *ACLAuthMethodEnterpriseMeta) ToEnterpriseMeta() *EnterpriseMeta {
|
|
|
|
return DefaultEnterpriseMeta()
|
|
|
|
}
|
|
|
|
|
2019-10-24 18:38:09 +00:00
|
|
|
func aclServiceIdentityRules(svc string, _ *EnterpriseMeta) string {
|
|
|
|
return fmt.Sprintf(aclPolicyTemplateServiceIdentity, svc)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *ACLPolicy) EnterprisePolicyMeta() *acl.EnterprisePolicyMeta {
|
|
|
|
return nil
|
|
|
|
}
|
2020-01-14 15:09:29 +00:00
|
|
|
|
|
|
|
func (m *ACLAuthMethod) TargetEnterpriseMeta(_ *EnterpriseMeta) *EnterpriseMeta {
|
|
|
|
return &m.EnterpriseMeta
|
|
|
|
}
|