api

package
v0.0.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api holds typed subsets of the Istio security.istio.io and networking.istio.io resources the Istio projector reads. Types decode only the fields projection interprets; field meaning follows the upstream Istio API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationPolicy

type AuthorizationPolicy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AuthorizationPolicySpec `json:"spec,omitempty"`
}

AuthorizationPolicy is a security.istio.io/v1 AuthorizationPolicy.

type AuthorizationPolicySpec

type AuthorizationPolicySpec struct {
	Selector   *WorkloadSelector       `json:"selector,omitempty"`
	TargetRefs []PolicyTargetReference `json:"targetRefs,omitempty"`
	Action     string                  `json:"action,omitempty"`
	Provider   *ExtensionProvider      `json:"provider,omitempty"`
	Rules      *[]json.RawMessage      `json:"rules,omitempty"`
}

AuthorizationPolicySpec decodes scope and action. Rules stay raw; projection derives only their count, digest, and coarse breadth.

func (*AuthorizationPolicySpec) UnmarshalJSON

func (spec *AuthorizationPolicySpec) UnmarshalJSON(data []byte) error

UnmarshalJSON folds the deprecated singular targetRef into TargetRefs so projection handles one form.

type Decoded

type Decoded[T any] struct {
	Value    T
	SpecJSON json.RawMessage
}

Decoded wraps a typed provider object and, when present, its raw spec. The raw spec feeds configuration digests so fields the typed subset omits still change the digest.

func AuthorizationPolicyObject

func AuthorizationPolicyObject(object *unstructured.Unstructured) (Decoded[AuthorizationPolicy], error)

AuthorizationPolicyObject decodes an AuthorizationPolicy.

func Decode

func Decode[T any](object *unstructured.Unstructured) (Decoded[T], error)

Decode round-trips object through JSON into T and captures the raw spec. Unknown fields are ignored; a field with the wrong JSON type is an error.

func PeerAuthenticationObject

func PeerAuthenticationObject(object *unstructured.Unstructured) (Decoded[PeerAuthentication], error)

PeerAuthenticationObject decodes a PeerAuthentication.

func ServiceEntryObject

func ServiceEntryObject(object *unstructured.Unstructured) (Decoded[ServiceEntry], error)

ServiceEntryObject decodes a ServiceEntry.

func VirtualServiceObject

func VirtualServiceObject(object *unstructured.Unstructured) (Decoded[VirtualService], error)

VirtualServiceObject decodes a VirtualService.

type Destination

type Destination struct {
	Host   string        `json:"host"`
	Subset string        `json:"subset,omitempty"`
	Port   *PortSelector `json:"port,omitempty"`
}

Destination names a registry host, optional subset, and port.

type ExtensionProvider

type ExtensionProvider struct {
	Name string `json:"name"`
}

ExtensionProvider names the external authorizer for CUSTOM policies.

type HTTPRoute

type HTTPRoute struct {
	Route   []HTTPRouteDestination `json:"route,omitempty"`
	Mirror  *Destination           `json:"mirror,omitempty"`
	Mirrors []MirrorPolicy         `json:"mirrors,omitempty"`
}

HTTPRoute is one VirtualService HTTP route; match conditions are not decoded.

type HTTPRouteDestination

type HTTPRouteDestination struct {
	Destination *Destination `json:"destination,omitempty"`
	Weight      *int32       `json:"weight,omitempty"`
}

HTTPRouteDestination is a weighted HTTP destination.

type L4Route

type L4Route struct {
	Route []RouteDestination `json:"route,omitempty"`
}

L4Route is one VirtualService TCP or TLS route.

type MirrorPolicy

type MirrorPolicy struct {
	Destination *Destination    `json:"destination,omitempty"`
	Percentage  json.RawMessage `json:"percentage,omitempty"`
}

MirrorPolicy is one HTTP mirror target. Mirrors receive traffic copies and are projected as destinations.

type MutualTLS

type MutualTLS struct {
	Mode string `json:"mode,omitempty"`
}

MutualTLS is a PeerAuthentication mode: UNSET, DISABLE, PERMISSIVE, or STRICT.

type PeerAuthentication

type PeerAuthentication struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              PeerAuthenticationSpec `json:"spec,omitempty"`
}

PeerAuthentication is a security.istio.io/v1 PeerAuthentication.

type PeerAuthenticationSpec

type PeerAuthenticationSpec struct {
	Selector      *WorkloadSelector    `json:"selector,omitempty"`
	Mtls          *MutualTLS           `json:"mtls,omitempty"`
	PortLevelMtls map[string]MutualTLS `json:"portLevelMtls,omitempty"`
}

PeerAuthenticationSpec decodes scope and mTLS modes, including per-port overrides.

type PolicyTargetReference

type PolicyTargetReference struct {
	Group     string `json:"group,omitempty"`
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`
}

PolicyTargetReference attaches a policy to a named resource, such as a Gateway or waypoint Service, instead of a label selector.

type PortSelector

type PortSelector struct {
	Number uint32 `json:"number,omitempty"`
}

PortSelector selects a destination port by number.

type RouteDestination

type RouteDestination struct {
	Destination *Destination `json:"destination,omitempty"`
	Weight      *int32       `json:"weight,omitempty"`
}

RouteDestination is a weighted TCP or TLS destination.

type ServiceEntry

type ServiceEntry struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ServiceEntrySpec `json:"spec,omitempty"`
}

ServiceEntry is a networking.istio.io/v1 ServiceEntry.

type ServiceEntryEndpoint

type ServiceEntryEndpoint struct {
	Address  string            `json:"address,omitempty"`
	Ports    map[string]uint32 `json:"ports,omitempty"`
	Labels   map[string]string `json:"labels,omitempty"`
	Network  string            `json:"network,omitempty"`
	Locality string            `json:"locality,omitempty"`
	Weight   uint32            `json:"weight,omitempty"`
}

ServiceEntryEndpoint is one static ServiceEntry endpoint.

type ServiceEntrySpec

type ServiceEntrySpec struct {
	Hosts      []string               `json:"hosts,omitempty"`
	ExportTo   []string               `json:"exportTo,omitempty"`
	Ports      []ServicePort          `json:"ports,omitempty"`
	Endpoints  []ServiceEntryEndpoint `json:"endpoints,omitempty"`
	Location   string                 `json:"location,omitempty"`
	Resolution string                 `json:"resolution,omitempty"`
}

ServiceEntrySpec decodes the hosts, ports, endpoints, location, resolution, and visibility that determine registry bindings.

type ServicePort

type ServicePort struct {
	Number   uint32 `json:"number,omitempty"`
	Name     string `json:"name,omitempty"`
	Protocol string `json:"protocol,omitempty"`
}

ServicePort is one ServiceEntry port.

type VirtualService

type VirtualService struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              VirtualServiceSpec `json:"spec,omitempty"`
}

VirtualService is a networking.istio.io/v1 VirtualService.

type VirtualServiceSpec

type VirtualServiceSpec struct {
	Hosts    []string    `json:"hosts,omitempty"`
	Gateways []string    `json:"gateways,omitempty"`
	ExportTo []string    `json:"exportTo,omitempty"`
	HTTP     []HTTPRoute `json:"http,omitempty"`
	TLS      []L4Route   `json:"tls,omitempty"`
	TCP      []L4Route   `json:"tcp,omitempty"`
}

VirtualServiceSpec decodes hosts, gateways, visibility, and route destinations.

type WorkloadSelector

type WorkloadSelector struct {
	MatchLabels map[string]string `json:"matchLabels,omitempty"`
}

WorkloadSelector selects workloads by exact label match.

Jump to

Keyboard shortcuts

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