Documentation
¶
Overview ¶
Package platformgateway contains platform-gateway-specific integration steps.
Package platformgateway contains platform-gateway-specific integration steps.
Index ¶
- Constants
- func AwaitDeletionApplied(ctx context.Context, client *httpx.Client, ...) error
- func BasicAuthHeader(user, pass string) string
- func CleanupKindForResource(kind string) (cleanup.Kind, error)
- func ControllerEndpoints(topo *runtime.Topology) (management, admin string, err error)
- func ManagementBasePathForVersion(version string) string
- func Register(sc *godog.ScenarioContext, base Base, topo *runtime.Topology, ...)
- func RegisterDeleters(reg *cleanup.Registry, topo *runtime.Topology)
- func RenderResourceTemplate(ctx context.Context, topo *frameworkruntime.Topology, ...) (string, error)
- type Base
- type Gateway
- type Steps
Constants ¶
const (
ManagementBasePath = "/api/management/v1"
)
API base paths, kept in sync with the gateway's OpenAPI documents.
Variables ¶
This section is empty.
Functions ¶
func AwaitDeletionApplied ¶
func AwaitDeletionApplied( ctx context.Context, client *httpx.Client, adminURL, version, authorization, handle string, ) error
AwaitDeletionApplied waits, on a Gateway release with the xDS snapshot race, until the controller has applied the deletion of handle, so the next change reaches it in a later poll.
Releases before 1.2.0 apply each change from an event the controller polls for every three seconds, and rebuild the route snapshot on a goroutine per event, without a lock (fixed in 1.2.0 by "fix(xds): add mutex to SnapshotManager.UpdateSnapshot"). A deletion and a creation applied in the same poll race, and the deletion's rebuild can publish last, leaving the new resource without a route. The controller's config dump drops the handle when its poll applies the deletion, so once the handle is gone a later creation is applied in a later poll. A kind the dump does not list never rebuilds the route snapshot, so it passes at once. Later releases are not polled.
func BasicAuthHeader ¶
BasicAuthHeader returns the Authorization header value carrying the supplied credentials as HTTP Basic authentication.
func CleanupKindForResource ¶ added in v0.3.0
CleanupKindForResource returns the cleanup kind that deletes a resource of the kind a step names ("API", "MCP proxy", ...).
func ControllerEndpoints ¶ added in v0.3.0
ControllerEndpoints returns the management and admin API base URLs of the topology's gateway controller, in the base paths of the Gateway release under test. They are what a client outside the suite, such as the ap CLI, is configured with.
func ManagementBasePathForVersion ¶
ManagementBasePathForVersion returns the management API base path for a Gateway release.
func RegisterDeleters ¶
RegisterDeleters registers how the cleanup sweep deletes each resource kind a gateway scenario creates, through the management API of the topology's platform-gateway. A resource that is already gone counts as deleted. On releases where the next scenario's resource could lose its route to the controller's snapshot race, the sweep also waits until the controller has applied the deletion.
func RenderResourceTemplate ¶ added in v0.3.0
func RenderResourceTemplate( ctx context.Context, topo *frameworkruntime.Topology, featureRoot, kind, templateName string, table *godog.Table, ) (string, error)
RenderResourceTemplate renders the canonical template of a resource kind ("API", "MCP proxy", ...) with a scenario's values table, in the request contract of the Gateway release under test. It is for steps that hand the document to another client, such as the ap CLI, instead of posting it to the management API themselves.
Types ¶
type Base ¶
type Base interface {
FeatureRoot() string
GatewayURL(path string) (string, error)
GatewayURLAt(ordinalWord, path string) (string, error)
ScenarioHeaders(ctx context.Context) map[string]string
InvokeWith(ctx context.Context, method, path string, headers map[string]string, body []byte) error
RequestHost(ctx context.Context) string
ResetRequest(ctx context.Context) error
SendUntilHeader(ctx context.Context, method, path, name, want string) error
}
Base provides the suite-wide request and scenario mechanics used by gateway steps.
Source Files
¶
- a2a_client.go
- agent.go
- cleanup.go
- controllers.go
- gateway.go
- health.go
- helpers.go
- management.go
- mtls.go
- mtls_default_identity.go
- mtls_default_identity_backend.go
- mtls_header_bypass.go
- mtls_hostnames.go
- mtls_listener.go
- mtls_observability.go
- mtls_outbound.go
- mtls_pool.go
- mtls_relay.go
- mtls_settle.go
- raw_http.go
- register.go
- resource_template.go
- template_literal.go
- waits.go