# README
Classification extractors
(formerly known as "YAML classification policies")
Companion package for github.com/fluxninja/aperture/api/gen/proto/go/aperture/classification/v1
Label extractors (shortly – extractors) are a high-level way to specify how to extract a flow label given http request metadata, without a need to write rego code.
Eg.:
extractor:
json:
from: request.http.body
pointer: /query
Internally, multiple extractors will be compiled to a single rego module.
# Functions
CompileToRego compiles the extractors into a rego.
IsRegoIdent checks if string is a valid rego identifier – not a rego keyword and composed of allowed characters - alphanumeric and underscore.
ParseAttributePath parses a string into an attribute path.
ParseJSONPointer parses a pointer into a JSONPointer.
ParsePathTemplate parses a path template string into a PathTemplate.
# Variables
BadExtractor occurs when extractor is invalid.
BadLabelName is an error occurring when label name is invalid.
BadPackageName occurs when package name is invalid.
# Structs
JSONPointer represents a parsed JSON pointer
https://datatracker.ietf.org/doc/html/rfc6901.
PathTemplate is an OpenAPI-inspired path template
See github.com/fluxninja/aperture/api/gen/proto/go/aperture/classification/v1.PathTemplateMatcher.
# Type aliases
AttributePath is a dot-separated path to attribute to extract data from
Should be either: * one of the fields of [Attribute Context][ctx], or * a special "request.http.bearer" pseudo-attribute.