Documentation
¶
Overview ¶
Package api provides the canonical Image Factory OpenAPI contract.
Index ¶
- func Load(ctx context.Context) (*openapi3.T, error)
- func NewRouter(ctx context.Context) (routers.Router, error)
- func Specification() ([]byte, error)
- type Contract
- func (contract *Contract) ValidateRequest(ctx context.Context, request *http.Request) (*routers.Route, map[string]string, error)
- func (contract *Contract) ValidateRuntimeDispatcher(method, runtimePath string, operationIDs []string) error
- func (contract *Contract) ValidateRuntimeOperation(method, runtimePath, operationID string) error
- func (contract *Contract) ValidateRuntimeRoute(method, runtimePath string) error
- type ContractOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Specification ¶
Specification returns an isolated, self-contained copy of the canonical OpenAPI YAML document.
Types ¶
type Contract ¶
Contract binds the canonical document to its request router and validator.
func NewContract ¶
func NewContract(ctx context.Context, options ...ContractOption) (*Contract, error)
NewContract loads the canonical document and builds its request router.
func (*Contract) ValidateRequest ¶
func (contract *Contract) ValidateRequest( ctx context.Context, request *http.Request, ) (*routers.Route, map[string]string, error)
ValidateRequest matches and validates a request against the contract. Authentication remains the responsibility of the HTTP frontend.
func (*Contract) ValidateRuntimeDispatcher ¶ added in v1.7.2
func (contract *Contract) ValidateRuntimeDispatcher(method, runtimePath string, operationIDs []string) error
ValidateRuntimeDispatcher verifies that a broad runtime dispatcher declares exactly the finite set of canonical OpenAPI operations it can serve.
func (*Contract) ValidateRuntimeOperation ¶ added in v1.7.2
ValidateRuntimeOperation verifies that a runtime router pattern maps to the named operation in the canonical OpenAPI contract.
func (*Contract) ValidateRuntimeRoute ¶
ValidateRuntimeRoute verifies that a runtime router pattern maps to an operation declared by the canonical OpenAPI contract. It remains as a compatibility shim while runtime registrations migrate to operation-ID-aware descriptors.
type ContractOption ¶ added in v1.7.2
type ContractOption func(*contractOptions)
ContractOption configures a deployment's runtime contract.
func WithBrowserCallbackPath ¶ added in v1.7.2
func WithBrowserCallbackPath(callbackPath string) ContractOption
WithBrowserCallbackPath relocates only the browser login callback operation. The path must be a literal absolute URL path, without escaping or router patterns, and must not overlap another operation. The embedded specification is unchanged.