dockernaming

package
v0.39.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package dockernaming centralises the rule for turning an MCPProxy server name into the sanitized token used inside a Docker container name (mcpproxy-<sanitized>-<suffix>).

It exists so the component that NAMES a container at launch (internal/upstream/core) and the component that LOOKS UP a running container by name (internal/security/scanner) share one source of truth. They used to carry independent sanitizers that disagreed on '.': the launcher preserved it (Docker allows '.') while the scanner mapped it to '-'. For official-registry servers — whose names are a dotted namespace plus a slash, e.g. "com.pulsemcp/google-flights" — that mismatch meant the scanner's `docker ps --filter name=mcpproxy-<sanitized>-` prefix never matched the real container, so source extraction silently fell through to "No Source Available" (MCP-2123). Keeping the rule in one leaf package makes that drift impossible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeServerName

func SanitizeServerName(name string) string

SanitizeServerName converts a server name into a valid Docker container-name token. Docker container names may contain [a-zA-Z0-9][a-zA-Z0-9_.-]*, so this preserves letters, digits, '_', '.', and '-' and replaces any other run of characters with a single '-'. It then collapses consecutive hyphens, ensures the result starts with an alphanumeric character, trims trailing '-'/'.', and truncates to a safe length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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