fabric

package
v0.0.0-...-35e30c1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IngressesV1ClusterURI      = "/apis/networking.k8s.io/v1/ingresses"
	ServicesClusterURI         = "/api/v1/services"
	EndpointsClusterURI        = "/api/v1/endpoints"
	ZalandoResourcesClusterURI = "/apis/zalando.org/v1"
	FabricGatewayName          = "fabricgateways"
	FabricGatewayURI           = ZalandoResourcesClusterURI + "/fabricgateways"
	FabricGatewayFmt           = ZalandoResourcesClusterURI + "/namespaces/%s/fabricgateways"
)

Variables

This section is empty.

Functions

func ValidateFabricResource

func ValidateFabricResource(fg *Fabric) error

Types

type Fabric

type Fabric struct {
	Metadata *Metadata     `json:"metadata"`
	Spec     *FabricSpec   `json:"spec"`
	Status   *FabricStatus `json:"status"`
}

type FabricAllowList

type FabricAllowList struct {
	State string
	UIDs  []string
}

type FabricCompression

type FabricCompression struct {
	Factor   int    `json:"compressionFactor"` // TODO(sszuecs): maybe limit to 0..9
	Encoding string `json:"encoding"`
}

type FabricCorsSupport

type FabricCorsSupport struct {
	AllowedHeaders []string `json:"allowedHeaders"`
	AllowedOrigins []string `json:"allowedOrigins"`
}

type FabricDataClient

type FabricDataClient struct {
	ClusterClient *clusterClient
	// contains filtered or unexported fields
}

func NewFabricDataClient

func NewFabricDataClient(o Options) (*FabricDataClient, error)

func (*FabricDataClient) Close

func (fdc *FabricDataClient) Close()

func (*FabricDataClient) LoadAll

func (fdc *FabricDataClient) LoadAll() ([]*eskip.Route, error)

func (*FabricDataClient) LoadUpdate

func (fdc *FabricDataClient) LoadUpdate() ([]*eskip.Route, []string, error)

type FabricEmployeeAccess

type FabricEmployeeAccess struct {
	Type     string   `json:"type"` // <allow_list|allow_all|deny_all> if allow_list-> user-list must be populated, otherwise scope uid with realm /employee
	UserList []string `json:"user-list"`
}

type FabricExternalServiceProvider

type FabricExternalServiceProvider struct {
	Hosts    []string `json:"hosts"`
	StackSet string   `json:"stackSetName"`
}

type FabricList

type FabricList struct {
	Items []*Fabric `json:"items"`
}

type FabricMethod

type FabricMethod struct {
	Method         string
	EmployeeAccess *FabricEmployeeAccess `json:"x-fabric-employee-access"`
	Privileges     []string              `json:"x-fabric-privileges"`
	Ratelimit      *FabricRatelimit      `json:"x-fabric-ratelimits"`
	Response       *FabricResponse       `json:"x-fabric-static-response"`
	AllowList      *FabricAllowList      `json:"x-fabric-whitelist"`
}

type FabricPath

type FabricPath struct {
	Path    string
	Methods []*FabricMethod
}

func (FabricPath) String

func (fp FabricPath) String() string

type FabricPaths

type FabricPaths struct {
	PathData map[string]interface{} `json:"-"`
	Path     []*FabricPath
}

func (FabricPaths) String

func (fps FabricPaths) String() string

func (*FabricPaths) UnmarshalJSON

func (fps *FabricPaths) UnmarshalJSON(value []byte) error

type FabricRatelimit

type FabricRatelimit struct {
	DefaultRate int             `json:"default-rate"`
	Period      time.Duration   `json:"period"`
	Target      []*FabricTarget `json:"target"`
}

type FabricResponse

type FabricResponse struct {
	Title      string            `json:"title"`
	StatusCode int               `json:"status"`
	Headers    map[string]string `json:"headers"`
	Body       string            `json:"body"`
}

type FabricService

type FabricService struct {
	Host        string `json:"host"`
	ServiceName string `json:"serviceName"` // TODO(sszuecs): not ing V1 compliant
	ServicePort string `json:"servicePort"` // TODO(sszuecs): not ing V1 compliant
}

type FabricSpec

type FabricSpec struct {
	Paths                   *FabricPaths                   `json:"paths"`
	Admins                  []string                       `json:"x-fabric-admins"`
	Compression             *FabricCompression             `json:"x-fabric-compression-support"`
	Cors                    *FabricCorsSupport             `json:"x-fabric-cors-support"`
	EmployeeAccess          *FabricEmployeeAccess          `json:"x-fabric-employee-access"`
	Service                 []*FabricService               `json:"x-fabric-service"`
	ExternalServiceProvider *FabricExternalServiceProvider `json:"x-external-service-provider"`
	AllowList               []string                       `json:"x-fabric-whitelist"`
}

type FabricStatus

type FabricStatus struct {
	NumberOfOwnedIngress int      `json:"num_owned_ingress"`
	ObservedGeneration   int      `json:"observedGeneration"`
	OwnedIngressNames    []string `json:"owned_ingress_names"`
}

type FabricTarget

type FabricTarget struct {
	//Key  string // default "uid" and right now the only value
	UID  string
	Rate int
}

type Metadata

type Metadata struct {
	Namespace   string            `json:"namespace"`
	Name        string            `json:"name"`
	Created     time.Time         `json:"creationTimestamp"`
	UID         string            `json:"uid"`
	Annotations map[string]string `json:"annotations"`
}

type Options

type Options struct {
	KubernetesURL       string
	KubernetesInCluster bool

	// filter + args
	CheckEmployeeFilter          string
	CheckServiceFilter           string
	CheckEmployeeOrServiceFilter string
	CheckCommonScopeFilter       string
	ForwardTokenServiceFilter    string
	ForwardTokenEmployeeFilter   string
	LogServiceFilter             string
	LogUserFilter                string
	FlowIDFilter                 string

	// ClusterClientRatelimitHeader is used for identifying a
	// client in a given request
	ClusterClientRatelimitHeader string
	// UidKey is used in x-fabric-admins and
	// x-fabric-employee-access to identify the user Claim to
	// match the value against an allow list and to identify the
	// user in the LogUserFilter.
	UidKey string
	// UserListPredicate is the predicate name used in
	// x-fabric-admins and x-fabric-employee-access to identify a
	// user in the "allow_list"
	UserListPredicate string
	// UserRealmPredicate is the predicate name used in
	// x-fabric-employee-access to identify "allow_all" or
	// "deny_all" and in x-fabric-admins if it's a user
	UserRealmPredicate string
}

Directories

Path Synopsis
stackset
v1

Jump to

Keyboard shortcuts

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