2023-09-08 12:45:24 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
|
|
//go:build !consulent
|
|
|
|
|
|
|
|
package structs
|
|
|
|
|
2023-09-18 21:10:35 +00:00
|
|
|
import _ "embed"
|
2023-09-08 12:45:24 +00:00
|
|
|
|
2023-09-18 21:10:35 +00:00
|
|
|
//go:embed acltemplatedpolicy/policies/ce/service.hcl
|
|
|
|
var ACLTemplatedPolicyService string
|
2023-09-08 12:45:24 +00:00
|
|
|
|
2023-09-18 21:10:35 +00:00
|
|
|
//go:embed acltemplatedpolicy/policies/ce/node.hcl
|
|
|
|
var ACLTemplatedPolicyNode string
|
|
|
|
|
|
|
|
//go:embed acltemplatedpolicy/policies/ce/dns.hcl
|
|
|
|
var ACLTemplatedPolicyDNS string
|
2023-09-08 12:45:24 +00:00
|
|
|
|
2023-09-20 16:10:55 +00:00
|
|
|
//go:embed acltemplatedpolicy/policies/ce/nomad-server.hcl
|
|
|
|
var ACLTemplatedPolicyNomadServer string
|
|
|
|
|
2023-10-05 19:45:41 +00:00
|
|
|
//go:embed acltemplatedpolicy/policies/ce/workload-identity.hcl
|
|
|
|
var ACLTemplatedPolicyWorkloadIdentity string
|
|
|
|
|
2023-11-24 17:55:05 +00:00
|
|
|
//go:embed acltemplatedpolicy/policies/ce/api-gateway.hcl
|
|
|
|
var ACLTemplatedPolicyAPIGateway string
|
|
|
|
|
2023-09-08 12:45:24 +00:00
|
|
|
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
|
|
|
|
}
|