How ikkun1222/trustless works
trustless is a credential-broker CLI: an agent or operator names credentials, and the broker resolves them for a subprocess or HTTP proxy without exposing plaintext to the agent. The main paths are command dispatch, backend resolution, and sanitized command execution or proxy forwarding; OAuth adds token refresh, while DLP redacts outbound requests and can scrub local history. Setup, health checks, configuration, and audit logging support these runtime paths. Some subsystem links are documented rather than source-verified because their implementation excerpts were not provided.
Main entry points: main.go Command dispatcher · audit.go Structured audit · serve.go Combined proxy service · command.go Credentialed command
Components 27
CLI and configuration
- Command dispatcher
main.go - Configuration
internal/config/config.go
Credential backends
- Backend interface
internal/backend/backend.go - pass backend
internal/backend/pass.go - Bitwarden backend
internal/backend/bitwarden.go - Environment backend
internal/backend/env.go - OAuth commands
internal/oauth/command.go - OAuth token resolver
internal/oauth/backend.go - Device authorization
internal/oauth/device.go
Injection and execution
- Credentialed command
internal/run/command.go - Output sanitizer
internal/scanner/scanner.go - Injection proxy
internal/proxy/command.go - Combined proxy service
internal/serve/serve.go
DLP protection
- DLP service
internal/dlp/server.go - Outbound redaction proxy
internal/dlp/proxy/proxy.go - Secret pattern redaction
internal/dlp/redact/redact.go - History scrub commands
internal/dlp/scrubcmd.go - SQLite history scrubber
internal/dlp/scrub/scrub.go - Text file scrubber
internal/dlp/scrub/textfiles.go
Operations and audit
- Health diagnostics
internal/doctor/doctor.go - System checks
internal/doctor/checks.go - Environment file scanner
internal/envscan/envscan.go - Initial setup
internal/setup/setup.go - Structured audit
internal/audit/audit.go - File audit sink
internal/audit/file.go - Journald audit sink
internal/audit/journald.go
Other components
- Operator or agent
Connections 39
- Operator or agent → Command dispatcher: invokes
main.go - Command dispatcher → Configuration: loads
main.go - Command dispatcher → Credentialed command: dispatches
main.go - Command dispatcher → Injection proxy: dispatches
main.go - Command dispatcher → Combined proxy service: dispatches
main.go - Command dispatcher → OAuth commands: dispatches
main.go - Command dispatcher → Health diagnostics: dispatches
main.go - Command dispatcher → Initial setup: dispatches
main.go - Command dispatcher → pass backend: selects backend
main.go - Command dispatcher → Environment backend: selects backend
main.go - Command dispatcher → Bitwarden backend: selects backend
main.go - Credentialed command → Backend interface: resolves credentials
internal/run/command.go - Credentialed command → Output sanitizer: sanitizes output
internal/run/command.go - Credentialed command → Structured audit: emits events
internal/run/command.go - Injection proxy → Backend interface: resolves credentials
internal/proxy/command.go - Injection proxy → Structured audit: emits events
internal/proxy/command.go - OAuth commands → Device authorization: starts device flow
internal/oauth/command.go - OAuth commands → OAuth token resolver: stores OAuth entry
internal/oauth/command.go - OAuth token resolver → Backend interface: delegates storage
internal/oauth/backend.go - OAuth token resolver → Structured audit: records refresh
internal/oauth/backend.go - Combined proxy service → Backend interface: creates shared backend
internal/serve/serve.go - Combined proxy service → OAuth token resolver: wraps backend
internal/serve/serve.go - Combined proxy service → Injection proxy: starts injection proxy
internal/serve/serve.go - Combined proxy service → DLP service: starts DLP service
internal/serve/serve.go - Combined proxy service → Structured audit: creates sink
internal/serve/serve.go - DLP service → Backend interface: loads secrets
internal/dlp/server.go - DLP service → Outbound redaction proxy: builds handler
internal/dlp/server.go - Outbound redaction proxy → Secret pattern redaction: scans requests
internal/dlp/proxy/proxy.go - Outbound redaction proxy → Structured audit: emits redaction events
internal/dlp/proxy/proxy.go - History scrub commands → SQLite history scrubber: invokes database scrub
internal/dlp/scrubcmd.go - History scrub commands → Text file scrubber: invokes text scrub
internal/dlp/scrubcmd.go - History scrub commands → Secret pattern redaction: uses patterns
internal/dlp/scrubcmd.go - Health diagnostics → Configuration: reads settings
internal/doctor/doctor.go - Health diagnostics → System checks: runs checks
internal/doctor/doctor.go - System checks → Environment file scanner: scans environment files
internal/doctor/checks.go - Credentialed command → Configuration: reads policy
internal/run/command.go - Injection proxy → Configuration: reads proxy settings
internal/proxy/command.go - Structured audit → File audit sink: supports file sink
- Structured audit → Journald audit sink: supports journald sink