cors

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CorsPolicyMergeSettings_MergeStrategy_name = map[int32]string{
		0: "DEFAULT",
		1: "UNION",
	}
	CorsPolicyMergeSettings_MergeStrategy_value = map[string]int32{
		"DEFAULT": 0,
		"UNION":   1,
	}
)

Enum value maps for CorsPolicyMergeSettings_MergeStrategy.

View Source
var File_github_com_solo_io_gloo_projects_gloo_api_v1_options_cors_cors_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CorsPolicy

type CorsPolicy struct {

	// Specifies the origins that will be allowed to make CORS requests.
	//
	// An origin is allowed if either allow_origin or allow_origin_regex match.
	AllowOrigin []string `protobuf:"bytes,1,rep,name=allow_origin,json=allowOrigin,proto3" json:"allow_origin,omitempty"`
	// Specifies regex patterns that match origins that will be allowed to make
	// CORS requests.
	//
	// An origin is allowed if either allow_origin or allow_origin_regex match.
	AllowOriginRegex []string `protobuf:"bytes,2,rep,name=allow_origin_regex,json=allowOriginRegex,proto3" json:"allow_origin_regex,omitempty"`
	// Specifies the content for the *access-control-allow-methods* header.
	AllowMethods []string `protobuf:"bytes,3,rep,name=allow_methods,json=allowMethods,proto3" json:"allow_methods,omitempty"`
	// Specifies the content for the *access-control-allow-headers* header.
	AllowHeaders []string `protobuf:"bytes,4,rep,name=allow_headers,json=allowHeaders,proto3" json:"allow_headers,omitempty"`
	// Specifies the content for the *access-control-expose-headers* header.
	ExposeHeaders []string `protobuf:"bytes,5,rep,name=expose_headers,json=exposeHeaders,proto3" json:"expose_headers,omitempty"`
	// Specifies the content for the *access-control-max-age* header.
	MaxAge string `protobuf:"bytes,6,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"`
	// Specifies whether the resource allows credentials.
	AllowCredentials bool `protobuf:"varint,7,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"`
	// Optional, only applies to route-specific CORS Policies, defaults to false.
	// If set, the CORS Policy (specified on the virtual host) will be disabled for this route.
	DisableForRoute bool `protobuf:"varint,8,opt,name=disable_for_route,json=disableForRoute,proto3" json:"disable_for_route,omitempty"`
	// contains filtered or unexported fields
}

CorsPolicy defines Cross-Origin Resource Sharing for a virtual service.

func (*CorsPolicy) Clone added in v1.8.24

func (m *CorsPolicy) Clone() proto.Message

Clone function

func (*CorsPolicy) Descriptor deprecated

func (*CorsPolicy) Descriptor() ([]byte, []int)

Deprecated: Use CorsPolicy.ProtoReflect.Descriptor instead.

func (*CorsPolicy) Equal

func (m *CorsPolicy) Equal(that interface{}) bool

Equal function

func (*CorsPolicy) GetAllowCredentials

func (x *CorsPolicy) GetAllowCredentials() bool

func (*CorsPolicy) GetAllowHeaders

func (x *CorsPolicy) GetAllowHeaders() []string

func (*CorsPolicy) GetAllowMethods

func (x *CorsPolicy) GetAllowMethods() []string

func (*CorsPolicy) GetAllowOrigin

func (x *CorsPolicy) GetAllowOrigin() []string

func (*CorsPolicy) GetAllowOriginRegex

func (x *CorsPolicy) GetAllowOriginRegex() []string

func (*CorsPolicy) GetDisableForRoute

func (x *CorsPolicy) GetDisableForRoute() bool

func (*CorsPolicy) GetExposeHeaders

func (x *CorsPolicy) GetExposeHeaders() []string

func (*CorsPolicy) GetMaxAge

func (x *CorsPolicy) GetMaxAge() string

func (*CorsPolicy) Hash deprecated added in v1.2.13

func (m *CorsPolicy) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*CorsPolicy) HashUnique added in v1.18.0

func (m *CorsPolicy) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*CorsPolicy) ProtoMessage

func (*CorsPolicy) ProtoMessage()

func (*CorsPolicy) ProtoReflect added in v1.6.0

func (x *CorsPolicy) ProtoReflect() protoreflect.Message

func (*CorsPolicy) Reset

func (x *CorsPolicy) Reset()

func (*CorsPolicy) String

func (x *CorsPolicy) String() string

type CorsPolicyMergeSettings added in v1.18.0

type CorsPolicyMergeSettings struct {
	ExposeHeaders CorsPolicyMergeSettings_MergeStrategy `` /* 170-byte string literal not displayed */
	// contains filtered or unexported fields
}

Settings to determine how to merge CORS settings when present on both the VirtualHost and Route. This option can be useful when different user personas or teams share ownership of a VirtualService. For example, you might not want CORS settings on each route to override the virtual host settings, but instead merge them with a `UNION` strategy.

func (*CorsPolicyMergeSettings) Clone added in v1.18.0

Clone function

func (*CorsPolicyMergeSettings) Descriptor deprecated added in v1.18.0

func (*CorsPolicyMergeSettings) Descriptor() ([]byte, []int)

Deprecated: Use CorsPolicyMergeSettings.ProtoReflect.Descriptor instead.

func (*CorsPolicyMergeSettings) Equal added in v1.18.0

func (m *CorsPolicyMergeSettings) Equal(that interface{}) bool

Equal function

func (*CorsPolicyMergeSettings) GetExposeHeaders added in v1.18.0

func (*CorsPolicyMergeSettings) Hash deprecated added in v1.18.0

func (m *CorsPolicyMergeSettings) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*CorsPolicyMergeSettings) HashUnique added in v1.18.0

func (m *CorsPolicyMergeSettings) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*CorsPolicyMergeSettings) ProtoMessage added in v1.18.0

func (*CorsPolicyMergeSettings) ProtoMessage()

func (*CorsPolicyMergeSettings) ProtoReflect added in v1.18.0

func (x *CorsPolicyMergeSettings) ProtoReflect() protoreflect.Message

func (*CorsPolicyMergeSettings) Reset added in v1.18.0

func (x *CorsPolicyMergeSettings) Reset()

func (*CorsPolicyMergeSettings) String added in v1.18.0

func (x *CorsPolicyMergeSettings) String() string

type CorsPolicyMergeSettings_MergeStrategy added in v1.18.0

type CorsPolicyMergeSettings_MergeStrategy int32
const (
	// Follow the default Envoy behavior, which is for Route settings to override VirtualHost settings if non-nil.
	CorsPolicyMergeSettings_DEFAULT CorsPolicyMergeSettings_MergeStrategy = 0
	// When a CORS policy is present on both VirtualHost and Route CORS policy, merge the settings. The merge is done
	// by concatenating for list fields and by ORing for boolean fields.
	CorsPolicyMergeSettings_UNION CorsPolicyMergeSettings_MergeStrategy = 1
)

func (CorsPolicyMergeSettings_MergeStrategy) Descriptor added in v1.18.0

func (CorsPolicyMergeSettings_MergeStrategy) Enum added in v1.18.0

func (CorsPolicyMergeSettings_MergeStrategy) EnumDescriptor deprecated added in v1.18.0

func (CorsPolicyMergeSettings_MergeStrategy) EnumDescriptor() ([]byte, []int)

Deprecated: Use CorsPolicyMergeSettings_MergeStrategy.Descriptor instead.

func (CorsPolicyMergeSettings_MergeStrategy) Number added in v1.18.0

func (CorsPolicyMergeSettings_MergeStrategy) String added in v1.18.0

func (CorsPolicyMergeSettings_MergeStrategy) Type added in v1.18.0

Jump to

Keyboard shortcuts

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