consul/proto-public/pbmesh/v1alpha1/pbproxystate/traffic_permissions.go

21 lines
368 B
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package pbproxystate
func (s *L4Principal) ToL7Principal() *L7Principal {
out := &L7Principal{
Spiffe: &Spiffe{
Regex: s.SpiffeRegex,
},
}
for _, regex := range s.ExcludeSpiffeRegexes {
out.ExcludeSpiffes = append(out.ExcludeSpiffes, &Spiffe{
Regex: regex,
})
}
return out
}