Expand description
URL and origin normalization helpers.
This module contains product-neutral URL rules shared by Aster services. It normalizes HTTP origins for CORS and public-site matching, validates HTTP base URLs used by integrations, and exposes small predicates for OAuth-style redirect and endpoint checks. Callers still decide whether failures are configuration errors, validation errors, or domain-specific errors.
Structs§
- Http
Base UrlOptions - Options for
normalize_http_base_url.
Functions§
- has_
http_ scheme - Returns whether
urluseshttporhttps. - is_
https_ or_ loopback_ http - Returns whether
urlis HTTPS or an HTTP loopback URL. - join_
origin_ and_ path - Joins an origin and an application path.
- normalize_
http_ base_ url - Normalizes an HTTP base URL.
- normalize_
origin - Normalizes an HTTP origin for CORS and public-site comparisons.
- normalize_
origin_ with_ additional_ schemes - Normalizes an origin while accepting explicitly selected non-HTTP schemes.
- normalize_
public_ site_ origin - Normalizes a public site origin.
- normalize_
public_ site_ origins_ config_ value - Normalizes a public-site URL config value into canonical JSON.
- parse_
absolute_ url - Parses an absolute URL and maps parser failures into
UtilsError. - parse_
http_ url - Parses a required absolute HTTP or HTTPS URL with a host.
- parse_
public_ site_ origin_ entries - Parses a JSON array of public site origins.
- parse_
public_ site_ origins - Parses, normalizes, and de-duplicates configured public site origins while preserving order.
- parse_
url - Parses a URL and maps parser failures into
UtilsError. - public_
site_ origin_ for_ request - Selects the configured public-site origin that matches the current request, falling back to the first configured origin.
- runtime_
public_ site_ origins_ with - Parses runtime public-site origins, ignoring invalid entries individually.