consolestatus

package
v1.8.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package consolestatus fetches the live state of an engine's link to the CrowdSec console (CAPI/PAPI): enrollment, plan, and decision-management state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecisionManagementActive

func DecisionManagementActive(subscriptionType string) bool

DecisionManagementActive reports whether the console pushes decisions to this engine, from PAPI.

Types

type CAPIStatus

type CAPIStatus struct {
	Authenticated    bool
	Enrolled         bool
	SubscriptionType string
}

CAPIStatus is what an authentication round-trip to CAPI tells us about the engine.

func QueryCAPIStatus

func QueryCAPIStatus(ctx context.Context, db *database.Client, hub *cwhub.Hub, credURL string, login string, password string) (CAPIStatus, error)

QueryCAPIStatus authenticates against the Central API and reads enrollment and subscription type from the returned JWT.

type PAPIInfo

type PAPIInfo struct {
	Plan       string
	Categories []string
	LastOrder  string
}

PAPIInfo is the plan detail exposed by the PAPI /permissions endpoint plus the timestamp of the last order the engine pulled.

func QueryPAPIInfo

func QueryPAPIInfo(ctx context.Context, serverCfg *csconfig.LocalApiServerCfg, db *database.Client) (PAPIInfo, error)

QueryPAPIInfo asks PAPI for the plan/categories the engine is entitled to

Jump to

Keyboard shortcuts

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