Documentation
¶
Overview ¶
Package hostrules holds host-shape rules and artifact-registry tables that runtime governance paths depend on — approval write-back, egress substitution, site-config validation, and the artifact-redirect emitter. A leaf, stdlib-only package (extracted from internal/workspacescan) so both can depend on it without a cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitArtifactConfig ¶
EmitArtifactConfig turns operator-configured artifact-registry redirects (ecosystem -> corporate base URL) into the per-tool config each toolchain reads to use the corporate mirror. Returns files (path -> content, relative to HOME) and env (Go's GOPROXY/GOSUMDB, which has no config file).
Output is URL-ONLY, no secret: a registry token is injected proxy-side, never written to a committable/readable config file. Maven's settings.xml is MIRRORS-ONLY — no <proxies>, since the sandbox reaches the mirror through wardyn-proxy via MAVEN_OPTS. GOPRIVATE is deliberately NOT set (it would route modules to direct VCS and defeat the corp GOPROXY).
Injection safety: base URLs come from site-config, which validateSiteConfig already rejects if they contain shell/XML metacharacters, so embedding base verbatim into TOML/XML/ini here is safe.
func PublicRegistryHosts ¶
PublicRegistryHosts returns the public-registry hosts a corporate redirect replaces for an artifact ecosystem, or nil for an unknown key. The egress-substitution layer drops these and adds the corp host when the operator configures a redirect for that ecosystem.
func ValidApprovedHost ¶
ValidApprovedHost reports whether h is a plain lowercase dotted host of the exact shape the approved-egress API accepts (no scheme/port/path/wildcard; wildcards stay a policy-allowlist privilege).
Types ¶
This section is empty.