mirror of https://github.com/status-im/consul.git
45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
//go:build !consulent
|
|
|
|
package structs
|
|
|
|
import _ "embed"
|
|
|
|
//go:embed acltemplatedpolicy/policies/ce/service.hcl
|
|
var ACLTemplatedPolicyService string
|
|
|
|
//go:embed acltemplatedpolicy/policies/ce/node.hcl
|
|
var ACLTemplatedPolicyNode string
|
|
|
|
//go:embed acltemplatedpolicy/policies/ce/dns.hcl
|
|
var ACLTemplatedPolicyDNS string
|
|
|
|
//go:embed acltemplatedpolicy/policies/ce/nomad-server.hcl
|
|
var ACLTemplatedPolicyNomadServer string
|
|
|
|
func (t *ACLToken) TemplatedPolicyList() []*ACLTemplatedPolicy {
|
|
if len(t.TemplatedPolicies) == 0 {
|
|
return nil
|
|
}
|
|
|
|
out := make([]*ACLTemplatedPolicy, 0, len(t.TemplatedPolicies))
|
|
for _, n := range t.TemplatedPolicies {
|
|
out = append(out, n.Clone())
|
|
}
|
|
return out
|
|
}
|
|
|
|
func (t *ACLRole) TemplatedPolicyList() []*ACLTemplatedPolicy {
|
|
if len(t.TemplatedPolicies) == 0 {
|
|
return nil
|
|
}
|
|
|
|
out := make([]*ACLTemplatedPolicy, 0, len(t.TemplatedPolicies))
|
|
for _, n := range t.TemplatedPolicies {
|
|
out = append(out, n.Clone())
|
|
}
|
|
return out
|
|
}
|