Documentation
¶
Index ¶
- func Initialize(bootstrapToken, machineID string, ipStrategy string, trustedHeader string, ...) error
- type BootstrapClaims
- type EDLUpdater
- type Manager
- func (m *Manager) CheckConfigUpdates(ctx context.Context)
- func (m *Manager) GetDeviceID() string
- func (m *Manager) GetEDLMode() string
- func (m *Manager) IsDeploymentEnabled() bool
- func (m *Manager) IsIPAllowed(clientIP string) (bool, error)
- func (m *Manager) IsIPAllowedWithStats(clientIP string) (bool, bool, error)
- func (m *Manager) SendBlockEvent(event *logs.BlockEvent)
- func (m *Manager) Stop()
- type TokenManager
- func (tm *TokenManager) GetConfigURL() string
- func (tm *TokenManager) GetLogsURL() string
- func (tm *TokenManager) GetToken() string
- func (tm *TokenManager) Initialize(ctx context.Context) error
- func (tm *TokenManager) IsDeploymentActive() bool
- func (tm *TokenManager) ParseBootstrapToken() (*BootstrapClaims, error)
- func (tm *TokenManager) StartRefreshLoop(ctx context.Context)
- func (tm *TokenManager) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BootstrapClaims ¶
type BootstrapClaims struct {
ComponentType string `json:"component_type"`
DeploymentID string `json:"deployment_id"`
Issuer string `json:"iss"`
jwt.RegisteredClaims
}
BootstrapClaims represents the JWT claims in the bootstrap token Note: We manually parse these due to Yaegi's issues with jwt/v5 struct tags See: https://github.com/traefik/yaegi/discussions/1548
type EDLUpdater ¶
type EDLUpdater struct {
// contains filtered or unexported fields
}
EDLUpdater manages EDL fetching and updating
func NewEDLUpdater ¶
func NewEDLUpdater(url string, updateFrequency time.Duration, matcher *ipmatcher.Matcher, manager *Manager) *EDLUpdater
NewEDLUpdater creates a new EDL updater
func (*EDLUpdater) GetStatus ¶
func (u *EDLUpdater) GetStatus() (time.Time, error, int64)
GetStatus returns the current status
func (*EDLUpdater) Reconfigure ¶
func (u *EDLUpdater) Reconfigure(url string, updateFrequency time.Duration)
Reconfigure updates the EDL URL and update frequency
func (*EDLUpdater) Start ¶
func (u *EDLUpdater) Start(ctx context.Context) error
Start performs initial EDL fetch
func (*EDLUpdater) StartUpdateLoop ¶
func (u *EDLUpdater) StartUpdateLoop(ctx context.Context)
StartUpdateLoop starts the background update loop
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) CheckConfigUpdates ¶
CheckConfigUpdates fetches and applies any configuration changes
func (*Manager) GetDeviceID ¶
GetDeviceID returns the device ID
func (*Manager) GetEDLMode ¶
GetEDLMode returns the current EDL mode
func (*Manager) IsDeploymentEnabled ¶
IsDeploymentEnabled returns whether deployment is enabled
func (*Manager) IsIPAllowed ¶
IsIPAllowed checks if an IP is allowed based on EDL
func (*Manager) IsIPAllowedWithStats ¶
IsIPAllowedWithStats checks if an IP is allowed and returns timing stats
func (*Manager) SendBlockEvent ¶
func (m *Manager) SendBlockEvent(event *logs.BlockEvent)
SendBlockEvent sends a block event to the log shipper
type TokenManager ¶
type TokenManager struct {
// contains filtered or unexported fields
}
TokenManager manages JWT tokens and refreshing
func NewTokenManager ¶
func NewTokenManager(bootstrapToken string, machineID string) *TokenManager
NewTokenManager creates a new token manager
func (*TokenManager) GetConfigURL ¶
func (tm *TokenManager) GetConfigURL() string
GetConfigURL returns the config API URL
func (*TokenManager) GetLogsURL ¶
func (tm *TokenManager) GetLogsURL() string
GetLogsURL returns the logs URL
func (*TokenManager) GetToken ¶
func (tm *TokenManager) GetToken() string
GetToken returns the current access token
func (*TokenManager) Initialize ¶
func (tm *TokenManager) Initialize(ctx context.Context) error
Initialize performs initial bootstrap
func (*TokenManager) IsDeploymentActive ¶
func (tm *TokenManager) IsDeploymentActive() bool
IsDeploymentActive returns whether the deployment is active
func (*TokenManager) ParseBootstrapToken ¶
func (tm *TokenManager) ParseBootstrapToken() (*BootstrapClaims, error)
ParseBootstrapToken parses and validates the bootstrap token IMPORTANT: We use manual JWT parsing instead of jwt/v5's ParseUnverified because Yaegi (Traefik's Go interpreter) has issues with struct tags in jwt/v5, causing claims to be returned as empty. This is a known Yaegi limitation. See: https://github.com/traefik/yaegi/discussions/1548
func (*TokenManager) StartRefreshLoop ¶
func (tm *TokenManager) StartRefreshLoop(ctx context.Context)
StartRefreshLoop starts the background token refresh loop