workerpeer

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package workerpeer authenticates local worker process identity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

Peer owns a kernel reference to one connected worker process. Its identity does not grant job authority: verify the durable claim, current grants and effective service configuration before accepting worker operations.

func Open

func Open(ctx context.Context, connection *net.UnixConn, key id.ID) (*Peer, error)

Open captures the connected process from a Linux Unix stream socket and verifies its job subgroup. It never resolves identity from a caller-supplied PID or falls back to a numeric-PID handle. The caller retains socket ownership.

func (*Peer) Check

func (p *Peer) Check(ctx context.Context, key id.ID) (uint32, error)

Check verifies liveness around the procfs reads, current root credentials and exact job subgroup. The returned PID is only valid alongside this live handle; never cache it as an authorization decision or reopen identity by numeric PID.

func (*Peer) Close

func (p *Peer) Close() error

Close releases the peer reference.

Jump to

Keyboard shortcuts

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