converter

package
v0.0.0-...-a3054f2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unset      mTLSMode = 0
	Strict     mTLSMode = 1
	Permissive mTLSMode = 2
)

Unset, Strict and Permissive for the mTLS mode.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	RootNamespace string
	Service       *ServiceStore
}

Converter includes general mesh wide settings.

func NewConverter

func NewConverter(rootNamespace string, svcList *corev1.ServiceList) *Converter

NewConverter constructs a Converter.

func (*Converter) Convert

func (mc *Converter) Convert(input *InputPolicy) ([]*OutputPolicy, *ResultSummary)

Convert converts an v1alpha1 authentication policy to the v1beta1 policies.

type InputPolicy

type InputPolicy struct {
	Name      string
	Namespace string
	Policy    *authnpb.Policy
}

InputPolicy includes a v1alpha1 authentication policy.

func ConvertToPolicy

func ConvertToPolicy(item unstructured.Unstructured) (*InputPolicy, error)

ConvertToPolicy converts unstructured object to InputPolicy.

type ObjectStruct

type ObjectStruct struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              map[string]interface{} `json:"spec,omitempty"`
}

type OutputPolicy

type OutputPolicy struct {
	Name         string
	Namespace    string
	Comment      string // Could be added to the annotation, e.g. security.istio.io/autoConversionResult: "..."
	PeerAuthN    *betapb.PeerAuthentication
	RequestAuthN *betapb.RequestAuthentication
	Authz        *betapb.AuthorizationPolicy
}

OutputPolicy includes the v1beta1 policy converted from v1alpha authentication policy.

func (*OutputPolicy) ToYAML

func (output *OutputPolicy) ToYAML() string

ToYAML converts output to yaml.

type ResultSummary

type ResultSummary struct {
	Errors []string
}

ResultSummary includes the conversion summary.

type ServiceStore

type ServiceStore struct {
	Services map[string]*corev1.Service
}

ServiceStore represents all services in the cluster.

Jump to

Keyboard shortcuts

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