Documentation
¶
Index ¶
- func EvaluateCleartextRPC(rpcURL string, opts CleartextPolicyOptions) (warnMsg string, blockErr error)
- func IsLoopbackHost(host string) bool
- func IsValidURL(rpcURL string) error
- func QueryEthChainID(rpcURL string) (uint64, error)
- func RedactURL(rawURL string) string
- func ValidateMatchesSelector(rpcURL string, expectedSelector uint64) error
- type CleartextPolicyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateCleartextRPC ¶ added in v1.24.0
func EvaluateCleartextRPC(rpcURL string, opts CleartextPolicyOptions) (warnMsg string, blockErr error)
EvaluateCleartextRPC blocks non-localhost HTTP RPC URLs unless explicitly opted in. Returns a warning when cleartext use is allowed via --allow-insecure-rpc.
func IsLoopbackHost ¶ added in v1.24.0
IsLoopbackHost reports whether host is a local loopback address (localhost, 127.0.0.1, ::1).
func IsValidURL ¶
IsValidURL checks that rpcURL has an http or https scheme and a non-empty host.
func QueryEthChainID ¶
QueryEthChainID dials rpcURL and returns the chain ID from eth_chainId.
func RedactURL ¶ added in v1.24.0
RedactURL returns a version of the URL with credentials masked to avoid leaking secrets that may have been resolved from environment variables.
func ValidateMatchesSelector ¶
ValidateMatchesSelector verifies the RPC's eth_chainId matches expectedSelector.
Types ¶
type CleartextPolicyOptions ¶ added in v1.24.0
type CleartextPolicyOptions struct {
AllowInsecure bool
}
CleartextPolicyOptions controls cleartext RPC policy evaluation.