rules

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package rules contains all rules related logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine is the access control engine that checks if a given query is allowed by the rules.

func NewEngine

func NewEngine(config *config.AccessControl) *Engine

NewEngine creates a new access control engine for the given access control configuration.

func (*Engine) Authorize

func (e *Engine) Authorize(query *Query) bool

Authorize checks if the given query is allowed by the engine's rules. The engine will return true if the query is allowed, false otherwise.

func (*Engine) UpdateConfig

func (e *Engine) UpdateConfig(config *config.AccessControl)

UpdateConfig updates the engine's configuration with the given access control configuration.

type Query

type Query struct {
	RequestedDomain string
	RequestedMethod string
	SourceIP        netip.Addr
	SourceCountry   string
	SourceASN       uint32
}

Query represents a query to be checked by the access control engine.

Jump to

Keyboard shortcuts

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