2020-01-13 20:51:40 +00:00
|
|
|
// +build !consulent
|
|
|
|
|
|
|
|
package structs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/consul/acl"
|
|
|
|
)
|
|
|
|
|
2020-08-27 17:20:58 +00:00
|
|
|
func (ixn *Intention) SourceEnterpriseMeta() *EnterpriseMeta {
|
|
|
|
return DefaultEnterpriseMeta()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ixn *Intention) DestinationEnterpriseMeta() *EnterpriseMeta {
|
|
|
|
return DefaultEnterpriseMeta()
|
|
|
|
}
|
|
|
|
|
2020-01-13 20:51:40 +00:00
|
|
|
// FillAuthzContext can fill in an acl.AuthorizerContext object to setup
|
|
|
|
// extra parameters for ACL enforcement. In OSS there is currently nothing
|
|
|
|
// extra to be done.
|
|
|
|
func (_ *Intention) FillAuthzContext(_ *acl.AuthorizerContext, _ bool) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
// FillAuthzContext can fill in an acl.AuthorizerContext object to setup
|
|
|
|
// extra parameters for ACL enforcement. In OSS there is currently nothing
|
|
|
|
// extra to be done.
|
|
|
|
func (_ *IntentionMatchEntry) FillAuthzContext(_ *acl.AuthorizerContext) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
// FillAuthzContext can fill in an acl.AuthorizerContext object to setup
|
|
|
|
// extra parameters for ACL enforcement. In OSS there is currently nothing
|
|
|
|
// extra to be done.
|
|
|
|
func (_ *IntentionQueryCheck) FillAuthzContext(_ *acl.AuthorizerContext) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultNamespaces will populate both the SourceNS and DestinationNS fields
|
|
|
|
// if they are empty with the proper defaults.
|
|
|
|
func (ixn *Intention) DefaultNamespaces(_ *EnterpriseMeta) {
|
|
|
|
// Until we support namespaces, we force all namespaces to be default
|
|
|
|
if ixn.SourceNS == "" {
|
|
|
|
ixn.SourceNS = IntentionDefaultNamespace
|
|
|
|
}
|
|
|
|
if ixn.DestinationNS == "" {
|
|
|
|
ixn.DestinationNS = IntentionDefaultNamespace
|
|
|
|
}
|
|
|
|
}
|
2020-06-26 21:59:15 +00:00
|
|
|
|
|
|
|
// FillNonDefaultNamespaces will populate the SourceNS and DestinationNS fields
|
|
|
|
// if they are empty with the proper defaults, but only if the proper defaults
|
|
|
|
// are themselves not "default".
|
|
|
|
func (ixn *Intention) FillNonDefaultNamespaces(_ *EnterpriseMeta) {
|
|
|
|
// do nothing
|
|
|
|
}
|