Wardrik.Egress (wardrik v0.1.0-rc.1)

Copy Markdown

Decides which URLs users may point Wardrik at, such as when an org adds an MCP server.

Wardrik.start_link(name: MyApp.AgentRuntime, egress: &Wardrik.Egress.public/1)

A URL is checked when it's given and when each connection to it starts, not on each request. A host that resolves somewhere else between checks is reached where it resolves then.

Summary

Functions

Returns :ok for every URL. Use it when only the operator names URLs, as in a daemon.

Returns :ok if url is https and every address of its host is public. The default.

Returns whether address is public. Checks the IPv4 address inside IPv6 forms that wrap one.

Functions

any(url)

@spec any(String.t()) :: :ok

Returns :ok for every URL. Use it when only the operator names URLs, as in a daemon.

public(url)

@spec public(String.t()) :: :ok | {:error, String.t()}

Returns :ok if url is https and every address of its host is public. The default.

Wardrik.Egress.public("https://10.0.0.5/mcp")
#=> {:error, "10.0.0.5 is a private address"}

public?(address)

@spec public?(:inet.ip_address()) :: boolean()

Returns whether address is public. Checks the IPv4 address inside IPv6 forms that wrap one.