api

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowAllDisableHandler added in v0.4.0

func AllowAllDisableHandler(s *Shared) gin.HandlerFunc

func AllowAllEnableHandler added in v0.4.0

func AllowAllEnableHandler(s *Shared) gin.HandlerFunc

func AllowAllStatusHandler added in v0.4.0

func AllowAllStatusHandler(s *Shared) gin.HandlerFunc

func CertDownloadHandler added in v0.3.0

func CertDownloadHandler(s *Shared) gin.HandlerFunc

func CertGenerateHandler added in v0.3.0

func CertGenerateHandler(s *Shared) gin.HandlerFunc

func CertReloadHandler added in v0.4.0

func CertReloadHandler(s *Shared) gin.HandlerFunc

CertReloadHandler triggers a live reload of the MITM CA certificate. It is a no-op if the cert file has not changed since the last reload.

func CertStatusHandler added in v0.3.0

func CertStatusHandler(s *Shared) gin.HandlerFunc

func ConversationsDetailHandler added in v0.3.0

func ConversationsDetailHandler(s *Shared) gin.HandlerFunc

ConversationsDetailHandler returns a single conversation with turns.

func ConversationsListHandler added in v0.3.0

func ConversationsListHandler(s *Shared) gin.HandlerFunc

ConversationsListHandler returns paginated conversation list (top-level only).

func ConversationsSubagentsHandler added in v0.3.0

func ConversationsSubagentsHandler(s *Shared) gin.HandlerFunc

ConversationsSubagentsHandler returns subagents of a conversation.

func CredentialsCreateHandler added in v0.4.0

func CredentialsCreateHandler(s *Shared) gin.HandlerFunc

CredentialsCreateHandler registers a new global credential.

func CredentialsDeleteHandler added in v0.4.0

func CredentialsDeleteHandler(s *Shared) gin.HandlerFunc

CredentialsDeleteHandler removes a global credential.

func CredentialsListHandler added in v0.4.0

func CredentialsListHandler(s *Shared) gin.HandlerFunc

CredentialsListHandler returns all global credentials (labels + previews only).

func DashboardHandler

func DashboardHandler(s *Shared) gin.HandlerFunc

func DissectorsListHandler added in v0.4.1

func DissectorsListHandler() gin.HandlerFunc

DissectorsListHandler returns metadata about all registered dissectors.

func EndpointRulesCreateHandler added in v0.4.1

func EndpointRulesCreateHandler(s *Shared) gin.HandlerFunc

EndpointRulesCreateHandler creates a user-defined endpoint rule.

func EndpointRulesDeleteHandler added in v0.4.1

func EndpointRulesDeleteHandler(s *Shared) gin.HandlerFunc

EndpointRulesDeleteHandler deletes a user-defined endpoint rule.

func EndpointRulesListHandler added in v0.4.1

func EndpointRulesListHandler(s *Shared) gin.HandlerFunc

EndpointRulesListHandler returns all endpoint rules.

func EndpointRulesUpdateHandler added in v0.4.1

func EndpointRulesUpdateHandler(s *Shared) gin.HandlerFunc

EndpointRulesUpdateHandler updates a user-defined endpoint rule.

func HealthHandler added in v0.2.0

func HealthHandler(s *Shared) gin.HandlerFunc

func LogsListHandler

func LogsListHandler(s *Shared) gin.HandlerFunc

func LogsStatsHandler

func LogsStatsHandler(s *Shared) gin.HandlerFunc

func MaintenanceStatusHandler added in v0.3.0

func MaintenanceStatusHandler(s *Shared) gin.HandlerFunc

func MiddlewaresListHandler added in v0.4.3

func MiddlewaresListHandler(s *Shared) gin.HandlerFunc

MiddlewaresListHandler returns the live status of every configured middleware client (connection state, hooks, agreed protocol version, timeout / on_disconnect policy). Read-only; no mutation endpoints here because middleware configuration is owned by CLI flags and greyproxy.yml, not the runtime store.

If no middlewares are configured, returns an empty list rather than 404 — the UI uses the empty case to render a "no middlewares configured" hint.

func NewRouter

func NewRouter(s *Shared, pathPrefix string) (*gin.Engine, *gin.RouterGroup)

NewRouter creates the Gin router with all routes. It returns the engine and the router group for the given pathPrefix, so callers can register additional routes under the same group without double-nesting the prefix.

func NotificationsStatusHandler added in v0.2.7

func NotificationsStatusHandler(s *Shared) gin.HandlerFunc

func NotificationsToggleHandler added in v0.2.7

func NotificationsToggleHandler(s *Shared) gin.HandlerFunc

func PendingAllowHandler

func PendingAllowHandler(s *Shared) gin.HandlerFunc

func PendingBulkAllowHandler

func PendingBulkAllowHandler(s *Shared) gin.HandlerFunc

func PendingBulkDismissHandler

func PendingBulkDismissHandler(s *Shared) gin.HandlerFunc

func PendingCountHandler

func PendingCountHandler(s *Shared) gin.HandlerFunc

func PendingDeleteHandler

func PendingDeleteHandler(s *Shared) gin.HandlerFunc

func PendingDenyHandler

func PendingDenyHandler(s *Shared) gin.HandlerFunc

func PendingListHandler

func PendingListHandler(s *Shared) gin.HandlerFunc

func RebuildConversationsHandler added in v0.3.0

func RebuildConversationsHandler(s *Shared) gin.HandlerFunc

func RedactHeadersHandler added in v0.3.3

func RedactHeadersHandler(s *Shared) gin.HandlerFunc

func RulesCreateHandler

func RulesCreateHandler(s *Shared) gin.HandlerFunc

func RulesDeleteHandler

func RulesDeleteHandler(s *Shared) gin.HandlerFunc

func RulesIngestHandler

func RulesIngestHandler(s *Shared) gin.HandlerFunc

func RulesListHandler

func RulesListHandler(s *Shared) gin.HandlerFunc

func RulesUpdateHandler

func RulesUpdateHandler(s *Shared) gin.HandlerFunc

func SessionsCreateHandler added in v0.4.0

func SessionsCreateHandler(s *Shared) gin.HandlerFunc

SessionsCreateHandler creates or upserts a credential substitution session.

If `global_credentials` is provided (list of labels), the handler resolves each label to its stored placeholder and includes it in the response. Greywall uses the returned placeholders to set environment variables and rewrite .env files in the sandbox. The placeholder-to-real-value mapping is merged into the session so the proxy can substitute on the wire.

func SessionsDeleteHandler added in v0.4.0

func SessionsDeleteHandler(s *Shared) gin.HandlerFunc

SessionsDeleteHandler removes a session and wipes credentials from DB and memory.

func SessionsHeartbeatHandler added in v0.4.0

func SessionsHeartbeatHandler(s *Shared) gin.HandlerFunc

SessionsHeartbeatHandler resets the TTL for an active session.

func SessionsListHandler added in v0.4.0

func SessionsListHandler(s *Shared) gin.HandlerFunc

SessionsListHandler returns all active sessions (without credential values).

func SettingsGetHandler added in v0.2.7

func SettingsGetHandler(s *Shared) gin.HandlerFunc

func SettingsUpdateHandler added in v0.2.7

func SettingsUpdateHandler(s *Shared) gin.HandlerFunc

func TransactionsDetailHandler added in v0.3.0

func TransactionsDetailHandler(s *Shared) gin.HandlerFunc

func TransactionsListHandler added in v0.3.0

func TransactionsListHandler(s *Shared) gin.HandlerFunc

func WebSocketHandler

func WebSocketHandler(s *Shared) gin.HandlerFunc

Types

type AllowAllController added in v0.4.0

type AllowAllController interface {
	Status() greyproxy.AllowAllStatus
	Enable(duration time.Duration, mode string)
	Disable()
}

AllowAllController is the subset of AllowAllManager used by the API.

type Shared

type Shared struct {
	DB              *greyproxy.DB
	Cache           *greyproxy.DNSCache
	Bus             *greyproxy.EventBus
	Waiters         *greyproxy.WaiterTracker
	ConnTracker     *greyproxy.ConnTracker
	Notifier        *greyproxy.Notifier
	Settings        *greyproxy.SettingsManager
	Assembler       *greyproxy.ConversationAssembler
	CredentialStore *greyproxy.CredentialStore
	AllowAll        AllowAllController
	EncryptionKey   []byte
	Version         string
	Ports           map[string]int
	DataHome        string
	ReloadCertFn    func() error
	CertMtimeFn     func() time.Time
	// MiddlewareStatusesFn returns a live snapshot of the connected
	// middleware clients for the /api/middlewares endpoint. It's a func
	// (set by cmd/greyproxy after the clients are created) rather than a
	// concrete list so the api package doesn't import the middleware
	// package, which would produce an import cycle.
	MiddlewareStatusesFn func() []greyproxy.MiddlewareStatus
}

Shared holds shared state passed to all handlers.

Jump to

Keyboard shortcuts

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