upstream

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 3 Imported by: 0 modules, 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 upstream validates provider endpoints before any customer-owned credential is attached to a request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPPolicy

type HTTPPolicy struct {
	// contains filtered or unexported fields
}

HTTPPolicy is the HTTPS counterpart of WebSocketPolicy: an immutable host allowlist that a batch adapter checks before attaching a credential to a request. Unlike the WebSocket policy it accepts a path, because REST endpoints are path-addressed; it still refuses a preexisting query, user info, and fragment so an adapter always owns the parameters it sends.

func NewHTTPPolicy

func NewHTTPPolicy(officialHost string, additionalHosts []string, allowInsecure bool) (HTTPPolicy, error)

NewHTTPPolicy builds a policy for an official provider hostname plus any additional exact hosts. A host beginning with "*." is a suffix pattern ("*.asr.api.speechmatics.com") for providers whose regional endpoints share a documented domain; the wildcard covers exactly one label.

func (HTTPPolicy) Parse

func (p HTTPPolicy) Parse(raw string) (*url.URL, error)

Parse validates the scheme, host, port, user info, query and fragment of a REST endpoint before an adapter adds authentication or parameters.

type WebSocketPolicy

type WebSocketPolicy struct {
	// contains filtered or unexported fields
}

WebSocketPolicy is an immutable allowlist for one provider adapter.

func NewWebSocketPolicy

func NewWebSocketPolicy(officialHost string, additionalHosts []string, allowInsecure bool) (WebSocketPolicy, error)

NewWebSocketPolicy builds a policy for an official provider hostname. Additional hosts are intended for dedicated provider deployments. A host beginning with "*." is a one-label suffix pattern, exactly as in NewHTTPPolicy, for providers that serve every customer resource on its own subdomain of a documented domain ("*.services.ai.azure.com"). Insecure WebSockets are available only as an explicit test/development override.

func (WebSocketPolicy) Parse

func (p WebSocketPolicy) Parse(raw string) (*url.URL, error)

Parse validates the scheme, hostname, port, userinfo, and preexisting query before an adapter adds authentication or provider parameters.

Jump to

Keyboard shortcuts

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