platform

package
v0.0.0-...-32f485c Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestAccessLog uint16 = iota
	TestAddHeaders
	TestAsymmetricKeys
	TestAuthAllowMissing
	TestAuthJwksAsyncFetch
	TestAuthJwksCache
	TestAuthWithMethodOverride
	TestBackendAddressOverride
	TestBackendAuthDisableAuth
	TestBackendAuthPerPlatform
	TestBackendAuthUsingIamIdTokenWithDelegates
	TestBackendAuthWithIamIdToken
	TestBackendAuthWithIamIdTokenRetries
	TestBackendAuthWithIamIdTokenTimeouts
	TestBackendAuthWithImdsIdToken
	TestBackendAuthWithImdsIdTokenRetries
	TestBackendAuthWithImdsIdTokenWhileAllowCors
	TestBackendCircuitBreaker
	TestBackendHttpProtocol
	TestBackendPerTryTimeout
	TestBackendRetry
	TestCancellationReport
	TestCompressionTranscoded
	TestDeadlinesForDynamicRouting
	TestDeadlinesForGrpcCatchAllBackend
	TestDeadlinesForGrpcDynamicRouting
	TestDeadlinesForLocalBackend
	TestDnsResolver
	TestDownstreamMTLS
	TestDynamicBackendRoutingMutualTLS
	TestDynamicBackendRoutingTLS
	TestDynamicGrpcBackendTLS
	TestDynamicRouting
	TestDynamicRoutingCorsByEnvoy
	TestDynamicRoutingEscapeSlashes
	TestDynamicRoutingPathPreprocessing
	TestDynamicRoutingWithAllowCors
	TestEnvoyDnsLookupPolicy
	TestExtractClientIPFromForwardedHeader
	TestFrontendAndBackendAuthHeaders
	TestGeneratedHeaders
	TestGRPC
	TestGrpcBackendPreflightCors
	TestGrpcBackendSimpleCors
	TestGrpcConnectionBufferLimit
	TestGRPCErrors
	TestGRPCFallback
	TestGRPCInteropMiniStress
	TestGRPCInterops
	TestGRPCJwt
	TestGRPCMetadata
	TestGRPCMinistress
	TestGRPCStreaming
	TestGRPCWeb
	TestHealthCheckGrpcBackend
	TestHSTS
	TestHttp1Basic
	TestHttp1JWT
	TestHttpHeaders
	TestIamImdsDataPath
	TestIdleTimeoutsForGrpcStreaming
	TestIdleTimeoutsForUnaryRPCs
	TestInvalidOpenIDConnectDiscovery
	TestJWTDisabledAudCheck
	TestJwtLocations
	TestManagedServiceConfig
	TestMetadataRequestsPerPlatform
	TestMetadataRequestsWithBackendAuthPerPlatform
	TestMethodOverrideBackendBody
	TestMethodOverrideBackendMethod
	TestMethodOverrideScReport
	TestMultiGrpcServices
	TestOperationNameHeader
	TestPreflightRequestWithAllowCors
	TestProxyHandleCorsSimpleRequestsBasic
	TestProxyHandleCorsSimpleRequestsRegex
	TestProxyHandlesCorsPreflightRequestsBasic
	TestProxyHandlesCorsPreflightWithDefaultAllowOrigin
	TestReportGCPAttributes
	TestReportGCPAttributesPerPlatform
	TestReportTraceId
	TestRetryCallServiceManagement
	TestServiceControlAccessTokenFromIam
	TestServiceControlAccessTokenFromTokenAgent
	TestServiceControlAllHTTPMethod
	TestServiceControlAllHTTPPath
	TestServiceControlAPIKeyCustomLocation
	TestServiceControlAPIKeyDefaultLocation
	TestServiceControlAPIKeyIpRestriction
	TestServiceControlAPIKeyRestriction
	TestServiceControlBasic
	TestServiceControlCache
	TestServiceControlCheckError
	TestServiceControlCheckRetry
	TestServiceControlCheckServerFail
	TestServiceControlCheckTimeout
	TestServiceControlCheckWrongServerName
	TestServiceControlCredentialId
	TestServiceControlFailedRequestReport
	TestServiceControlJwtAuthFail
	TestServiceControlLogHeaders
	TestServiceControlLogJwtPayloads
	TestServiceControlNetworkFailFlagForTimeout
	TestServiceControlNetworkFailFlagForUnavailableCheckResponse
	TestServiceControlProtocolWithGRPCBackend
	TestServiceControlProtocolWithHTTPBackend
	TestServiceControlQuota
	TestServiceControlQuotaExhausted
	TestServiceControlQuotaRetry
	TestServiceControlQuotaUnavailable
	TestServiceControlReportNetworkFail
	TestServiceControlReportResponseCode
	TestServiceControlReportRetry
	TestServiceControlRequestForDynamicRouting
	TestServiceControlRequestWithAllowCors
	TestServiceControlRequestWithoutAllowCors
	TestServiceControlSkipUsage
	TestServiceControlTLSWithValidCert
	TestServiceManagementWithInvalidCert
	TestServiceManagementWithValidCert
	TestStartupDuplicatedPathsWithAllowCors
	TestStatistics
	TestStatisticsServiceControlCallStatus
	TestTraceContextPropagationHeaders
	TestTraceContextPropagationHeadersForScCheck
	TestTracesDynamicRouting
	TestTracesFetchingJwks
	TestTracesServiceControlCheckWithRetry
	TestTracesServiceControlSkipUsage
	TestTracingSampleRate
	TestTranscodingBackendUnavailableError
	TestTranscodingBindings
	TestTranscodingBindingsForCustomVerb
	TestTranscodingUnescapePlus
	TestTranscodingErrors
	TestTranscodingIgnoreQueryParameters
	TestTranscodingPrintOptions
	TestWebsocket
)

All integration tests should be listed here to get their test ids

View Source
const (
	WorkingBackendPort string = "-1"
	InvalidBackendPort string = "6"
)

Variables

This section is empty.

Functions

func GetAnyAddress

func GetAnyAddress() string

Returns the meta-address that resolves to any address.

func GetDnsFamily

func GetDnsFamily() string

Returns the DNS family that should be resolved.

func GetFilePath

func GetFilePath(file RuntimeFile) string

Get the runtime file path for the specified file.

func GetIpProtocol

func GetIpProtocol() string

Returns the IP protocol these addresses are for.

func GetLocalhost

func GetLocalhost() string

Returns localhost. Encouraged not to use this, as it doesn't provide guarantees on ipv4 vs ipv6 addresses.

func GetLoopbackAddress

func GetLoopbackAddress() string

Returns the loopback address in a form that can be used with URLs.

func GetLoopbackHost

func GetLoopbackHost() string

Returns the loopback hostname. Not safe to use in URLs.

func GetLoopbackIPv6Address

func GetLoopbackIPv6Address() string

Returns the loopback IPv6 address. Need to embrace it with brackets to be used with URLs, e.g. [::1].

func GetNetworkProtocol

func GetNetworkProtocol() string

Returns the network protocol, accepted by `net.Listen`.

func IsPortUsed

func IsPortUsed(port uint16) bool

IsPortUsed checks if a port is used

Types

type Backend

type Backend int

Keys for all backends. In general, any backend that requires a new service config should be added here.

const (
	// Run in sidecar mode (GKE).
	GrpcBookstoreSidecar Backend = iota
	EchoSidecar
	GrpcEchoSidecar
	GrpcInteropSidecar

	// Run in API gateway mode for dynamic routing (Cloud Run).
	EchoRemote
	GrpcBookstoreRemote
	GrpcEchoRemote
)

type Ports

type Ports struct {
	BackendServerPort         uint16
	DynamicRoutingBackendPort uint16
	ListenerPort              uint16
	AdminPort                 uint16
	FakeStackdriverPort       uint16
	DnsResolverPort           uint16
	JwtRangeBase              uint16
	TokenAgentPort            uint16
	TestId                    uint16
}

Ports stores all used ports and other ids for shared resources

func NewPorts

func NewPorts(testId uint16) *Ports

NewPorts allocate all ports based on test id.

type RuntimeFile

type RuntimeFile int

Keys for all files

const (
	// Javascript files
	GrpcBookstore RuntimeFile = iota

	// Binaries
	Bootstrapper
	ConfigManager
	Echo
	Envoy
	GrpcEchoClient
	GrpcEchoServer
	GrpcInteropClient
	GrpcInteropServer
	GrpcInteropStressClient

	// Proto descriptors
	FakeGrpcEchoDescriptor
	FakeGrpcInteropDescriptor
	FakeGrpcBookstoreDescriptor

	// Other files
	ServerCert
	ServerKey
	ProxyCert
	ProxyKey
	DownstreamClientCert
	DownstreamClientKey
	MismatchCert
	MismatchKey
	LogMetrics
	Version
	AccessLog
	ServiceAccountFile
	TestRootCaCerts
	TestDataFolder

	// Configurations from examples directory
	AuthServiceConfig
	AuthEnvoyConfig
	ScServiceConfig
	ScEnvoyConfig
	DrServiceConfig
	DrEnvoyConfig
	RmServiceConfig
	RmEnvoyConfig
	SbServiceConfig
	SbEnvoyConfig
	GrpcEchoServiceConfig
	GrpcEchoEnvoyConfig

	// Other configurations for testing
	FixedDrServiceConfig
	FakeServiceAccountFile
)

Jump to

Keyboard shortcuts

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