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

httpconsole

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package httpconsole is lockhttp's console backend for lockkit: the methods the gate calls (http.approve, policy.get) and the policy read from the console account's config file. lockkit's console holds the terminal, the approval screens, the modes, the policy review and the audit log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sanitizer

func Sanitizer() *sanitize.Sanitizer

Sanitizer scrubs lockhttp's error text: URL userinfo and Authorization or Proxy-Authorization headers.

Types

type Backend

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

Backend implements console.Backend.

func New

func New(o Options) *Backend

New returns the backend of o.Profile.

func (*Backend) Checks

Checks implements console.Backend.

func (*Backend) Connect

Connect implements console.Backend: the console guards no backend connection of its own (the gate sends the requests), so there is nothing to log in to.

func (*Backend) LoadPolicy

func (b *Backend) LoadPolicy() (console.Policy, error)

LoadPolicy implements console.Backend: the profile from the config file.

func (*Backend) Methods

func (b *Backend) Methods() map[string]console.Handler

Methods implements console.Backend.

func (*Backend) Status

func (b *Backend) Status(console.Session) any

Status implements console.Backend.

type Options

type Options struct {
	Profile string
	// Config is the config file (the console account's
	// ~/.config/lockhttp/config.toml).
	Config string
	// Now defaults to time.Now.
	Now func() time.Time
}

Options locate the profile a console serves.

Jump to

Keyboard shortcuts

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