(* Module: Pg_Hba Parses PostgreSQL's pg_hba.conf Author: Aurelien Bompard About: Reference The file format is described in PostgreSQL's documentation: http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html About: License This file is licensed under the LGPL v2+, like the rest of Augeas. About: Configuration files This lens applies to pg_hba.conf. See for exact locations. *) module Pg_Hba = autoload xfm (* Group: Generic primitives *) let eol = Util.eol let word = Rx.neg1 (* Variable: ipaddr CIDR or ip+netmask *) let ipaddr = /[0-9a-fA-F:.]+(\/[0-9]+|[ \t]+[0-9.]+)/ (* Variable: hostname Hostname, FQDN or part of an FQDN possibly starting with a dot. Taken from the syslog lens. *) let hostname = /\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/ let comma_sep_list (l:string) = let lns = [ label l . store word ] in Build.opt_list lns Sep.comma (* Group: Columns definitions *) (* View: ipaddr_or_hostname *) let ipaddr_or_hostname = ipaddr | hostname (* View: database TODO: support for quoted strings *) let database = comma_sep_list "database" (* View: user TODO: support for quoted strings *) let user = comma_sep_list "user" (* View: address *) let address = [ label "address" . store ipaddr_or_hostname ] (* View: option part of *) let option = let value_start = label "value" . Sep.equal in [ label "option" . store Rx.word . (Quote.quote_spaces value_start)? ] (* View: method can contain an