mtlspolicyutil

package
v0.0.0-...-e408518 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DestRuleIsMtls

func DestRuleIsMtls(rule *istioClientNet.DestinationRule) bool

DestRuleIsMtls returns true if mTLS is enabled for the Destination Rule

func PortDestRuleIsMtls

func PortDestRuleIsMtls(rule *PortDestRule) bool

PortDestRuleIsMtls returns true if mTLS is enabled for the PortDestRule

Types

type DestRules

type DestRules struct {
	// contains filtered or unexported fields
}

DestRules holds maps of Istio destination rules by port, name, and namespace

func LoadDestRules

func LoadDestRules(rules []*istioClientNet.DestinationRule) (*DestRules, error)

LoadDestRules is passed a list of Destination Rules and returns a DestRules with each of the Destination Rules mapped by port, name, and namespace

func NewDestRules

func NewDestRules() *DestRules

NewDestRules initializes the maps for a DestRules to be loaded by LoadDestRules

func (*DestRules) AddByName

func (dr *DestRules) AddByName(s Service, rule *istioClientNet.DestinationRule)

AddByName adds a Destination Rule to the DestRules name map

func (*DestRules) AddByNamespace

func (dr *DestRules) AddByNamespace(namespace string, rule *istioClientNet.DestinationRule)

AddByNamespace adds a Destination Rule to the DestRules namespace map

func (*DestRules) AddByPort

AddByPort adds a Destination Rule to the DestRules port map

func (*DestRules) ByName

ByName is passed a Service and returns the Destination Rule in the DestRules name map for the name of that Service

func (*DestRules) ByNamespace

func (dr *DestRules) ByNamespace(namespace string) []*istioClientNet.DestinationRule

ByNamespace is passed a namespace and returns the Destination Rule in the DestRules namespace map for that namespace

func (*DestRules) ByPort

func (dr *DestRules) ByPort(s Service, port uint32) []*PortDestRule

ByPort is passed a Service and a port number and returns the Destination Rule in the DestRules port map for that port number

func (*DestRules) ForEachByName

func (dr *DestRules) ForEachByName(cb func(s Service, rule *istioClientNet.DestinationRule))

ForEachByName examines all Destination Rules for a Service based off of a Destination Rule that is passed

func (*DestRules) ForEachByPort

func (dr *DestRules) ForEachByPort(cb func(s Service, port uint32, rule *PortDestRule))

ForEachByPort examines all Destination Rules for a Service and port number based off of a PortDestRule that is passed

func (*DestRules) TLSByName

func (dr *DestRules) TLSByName(s Service) (bool, *istioClientNet.DestinationRule, error)

TLSByName returns true if mTLS is enabled for the Destination Rule

func (*DestRules) TLSByPort

func (dr *DestRules) TLSByPort(s Service, port uint32) (bool, *PortDestRule, error)

TLSByPort returns true if mTLS is enabled for the PortDestination rule of the port number passed

type PortDestRule

type PortDestRule struct {
	Rule     *istioClientNet.DestinationRule
	PortRule *istioNet.TrafficPolicy_PortTrafficPolicy
}

PortDestRule stores the Istio destination rule and port traffic policy for a port

type Service

type Service struct {
	Name      string
	Namespace string
}

Service is the necesary components of a kubernetes service to look at auth policies and destination rules

func ServiceFromFqdn

func ServiceFromFqdn(fqdn string) (Service, error)

ServiceFromFqdn validates a kubernetes FQDN and returns a service with the name and namespace from a validated FQDN

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL