Help us shape the future of Go! Take the 2026 Go Developer Survey

policy

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	LocalHost  string         `json:"localHost"`
	RemoteHost string         `json:"remoteHost"`
	RemoteUser string         `json:"remoteUser"`
	Port       uint           `json:"port"`
	ProxyJump  string         `json:"proxyJump"`
	Hash       ConnectionHash `json:"hash"` // %C - hash of connection tuple
}

Connection represents the complete tuple of SSH connection parameters. This matches the parameters available in OpenSSH Match exec via %C hash: local hostname (%l), remote hostname (%h), port (%p), remote user (%r), and ProxyJump (%j). The Hash field contains the %C hash value computed by OpenSSH from these parameters.

type ConnectionHash

type ConnectionHash string

ConnectionHash is the OpenSSH %C hash value that uniquely identifies a connection. This is computed by OpenSSH from the connection parameters (local host, remote host, port, user, ProxyJump).

type Policy

type Policy struct {
	// HostUsers maps host patterns to allowed users for that host
	// Example: {"*.example.com": ["arch", "deploy"], "prod-*": ["root"]}
	HostUsers map[string][]string `json:"hostUsers"`
}

Policy represents the policy rules for certificate usage

func (*Policy) Matches

func (p *Policy) Matches(conn Connection) bool

Matches checks if this policy matches the given connection's host AND user

Jump to

Keyboard shortcuts

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