Documentation
¶
Overview ¶
Package aclcsv provides pure CSV serialization/parsing of ACL bindings and a declarative sync (diff + apply) between a desired binding set and the cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Header = []string{"Principal", "ResourceType", "PatternType", "ResourceName", "Operation", "PermissionType", "Host"}
Header is the fixed CSV column order emitted by Marshal and accepted (optionally) by Parse.
Functions ¶
func Marshal ¶
Marshal serializes bindings as CSV with the fixed header. Fields containing commas (e.g. SSL DN principals) are quoted by the encoding/csv writer.
func Parse ¶
Parse reads CSV text into ACL bindings. It skips blank lines and an optional header (case-insensitive, spaces ignored), and rejects lines without exactly 7 columns, blank values, or unrecognized resource type / pattern type / operation / permission — reporting the offending line (and column).
Types ¶
type CSVParseError ¶
CSVParseError describes a malformed CSV line. Column is 1-based and 0 when the error applies to the whole line.
func (CSVParseError) Error ¶
func (e CSVParseError) Error() string
type SyncPlan ¶
SyncPlan is the set difference between a desired binding set and the cluster's current bindings, computed on full 7-field binding identity.
func SyncACLs ¶
SyncACLs fetches the current ACLs and computes the plan to reconcile them toward desired. It does not mutate the cluster — call SyncPlan.Apply for that.