proxy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proxy is the Infisical/OneCLI inject path: HTTP(S)_PROXY with goproxy MITM. CONNECT is goproxy. Credentials attach at the edge. Unknown hosts fail closed. The agent never receives a secret.

CA wiring follows the official customca example: https://github.com/elazarl/goproxy/blob/master/examples/customca/main.go

Index

Constants

View Source
const DummySecret = "veil-inject"

DummySecret is the Infisical-style placeholder in a child env. Origin run never copies vault material onto the laptop. HTTPS_PROXY substitutes.

Variables

This section is empty.

Functions

func CACertPath

func CACertPath(dir string) string

func DummyEnv

func DummyEnv(items []protocol.Item) []string

DummyEnv is origin vault-run env: placeholders, never secrets.

func GenerateCA

func GenerateCA() (certPEM, keyPEM []byte, err error)

GenerateCA makes a local-only ECDSA P-256 CA. Used for goproxy MITM. Source: crypto/x509; MITM CONNECT handling stays in elazarl/goproxy.

func LoadOrCreateCA

func LoadOrCreateCA(dir string) (tls.Certificate, []byte, error)

Types

type OriginResult

type OriginResult struct {
	Decision protocol.Decision
	Reason   string
	Status   int
	Header   http.Header
	Body     []byte
}

OriginResult is POST /v1/use unwrapped for MITM. Not a GetSecret.

type OriginUse

type OriginUse func(ctx context.Context, item, method, rawURL string, header http.Header, body []byte) (OriginResult, error)

OriginUse fetches via origin. The laptop never receives the vault secret.

type Server

type Server struct {
	App         *app.App
	Agent       protocol.Principal
	Token       string
	Dir         string
	CA          tls.Certificate
	CAPEM       []byte
	ListenAddr  string
	OutboundTLS *tls.Config
	Now         func() time.Time
	OriginItems []protocol.Item
	OriginUse   OriginUse
	// contains filtered or unexported fields
}

func New

func New(a *app.App, agentID, dir string) (*Server, error)

func NewOrigin

func NewOrigin(agentID, dir string, items []protocol.Item, use OriginUse) (*Server, error)

NewOrigin is HTTPS_PROXY against VEIL_ORIGIN. Dummy env lives in DummyEnv.

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) Close

func (s *Server) Close() error

func (*Server) Env

func (s *Server) Env() []string

func (*Server) ProxyURL

func (s *Server) ProxyURL() *url.URL

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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