Allow (+) or deny (-) access
let access = label "access" . store /[+-]/
let access_entry = [ label "user" . [ label "username" . store Rx.word ] . Sep.space . [ label "access" . store /(readonly|readwrite)/i ] . Util.eol ]
let address = [ label "address" . store ipaddr_or_hostname ]
let address_re = Rx.ip | Rx.hostname
let address_re = Rx.ip | /\*/ | Rx.hostname
let admin = [ label "admin" . store word ]
the admin_list is a comma separated list of users allowed to change the group’s password and the member_list
let admin_list = Build.opt_list admin comma
let alias = let modulename = [ label "modulename" . sto_no_spaces ] in Build.key_value_line_comment "alias" sep_space (sto_no_spaces . sep_space . modulename) comment
let alias = [ label "alias" . store word_re ]
Every kind of Alias entry, see user_alias, runas_alias, host_alias and cmnd_alias
let alias = user_alias | runas_alias | host_alias | cmnd_alias
Alias entry, a list of comma-separated alias_entry_single fields
let alias_entry (kw:string) (field:string) (sto:lens) = [ indent . key kw . sep_cont . alias_entry_single field sto . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]
Single alias_entry, named using alias_name and listing alias_list
let alias_entry_single (field:string) (sto:lens) = [ label "alias" . alias_name . sep_eq . alias_list field sto ]
Generic alias field to gather all Alias definitions
let alias_field (kw:string) (sto:lens) = [ label kw . sto ]
List of alias_fields, separated by commas
let alias_list (kw:string) (sto:lens) = Build.opt_list (alias_field kw sto) sep_com
Name of an alias_entry_single
let alias_name = [ label "name" . store /[A-Z][A-Z0-9_]*/ ]
match all flags using Build.flag_line
let all_flags = Build.flag_line flags
let alpha = /[A-Za-z]{3}/
let alphanum = (num|alpha) . ("-" . (num|alpha))?
let any = Rx.no_spaces
A quoted value
let any = let body = store /[^\n]*/ in do_quote body
let any = [ label "any" . Quote.any ]
An optionaly quoted value Double or single quotes are not allowed in value Value cannot begin or end with spaces
let any_opt = let body = store any_opt_re in do_quote_opt body
let any_opt = [ label "any_opt" . Quote.any_opt ]
The regexp to store when value is optionally single- or double-quoted
let any_opt_re = /[^\n\t "']([^\n"']*[^\n\t "'])?/
let apid = let codec = [ arroba . label "codec" . store Rx.integer ] in let options = equal . ( (langs . codec?) | codec ) in let apid_entry (lbl:string) = [ label lbl . store Rx.integer . options? ] in Build.opt_list (apid_entry "apid") comma . ( semicol . Build.opt_list (apid_entry "apid_dolby") comma )?
let application (name:regexp) (parameter:lens) = list name parameter
let arroba = Util.del_str "@"
let att_def1 = "<!ATTLIST termdef id ID #REQUIRED name CDATA #IMPLIED>"
let att_def2 = "<!ATTLIST list type (bullets|ordered|glossary) \"ordered\">"
let att_def3 = "<!ATTLIST form method CDATA #FIXED \"POST\">"
test Xml.att_list_def get att_def1 = { "!ATTLIST" = "termdef" { "1" { "#name" = "id" } { "#type" = "ID" } { "#REQUIRED" } } { "2" { "#name" = "name" } { "#type" = "CDATA" } { "#IMPLIED" } } }
let attr_changetype (t:regexp) = key /changeType/i . sep_colon . store t . eol
Attribute name, possibly with options
let attr_description = key attr_type . attr_option*
dn-spec = “dn:” (FILL distinguishedName / “:” FILL base64-distinguishedName)
let attr_dn = del /dn/i "dn" . ( attr_safe_string | attr_base64_string ) . eol
Parses an attribute line with a DN on the RHS Parameters: k:regexp - match attribute name as key
let attr_dn_value (k:regexp) = [ key k . ( attr_safe_string | attr_base64_string ) . eol ]
OpenLDAP extension, must be separated by blank lines
let attr_include = eol . [ key "include" . sep_colon . store /[^ \t\n][^\n]*/ . eol . comment* . eol ]
let attr_modspec = key /add|delete|replace/ . sep_colon . store attr_type . attr_option* . eol
options = option / (option “;” options)
let attr_option = Util.del_str ";" . [ label "@option" . store /[a-zA-Z0-9-]+/ ]
AttributeType = ldap-oid / (ALPHA *(attr-type-chars))
let attr_type = ldapoid_re | /[a-zA-Z][a-zA-Z0-9-]*/ - /dn/i - /changeType/i - /include/i
Generic attribute with a value
let attr_val_spec = [ attr_description . ( attr_safe_string | attr_base64_string | attr_url_string ) . eol ]
version-spec = “version:” FILL version-number
let attr_version = Build.key_value_line "version" sep_colon (store /[0-9]+/)
let attr1 = " attr1=\"value1\" attr2=\"value2\""
let attr2 = " attr2=\"foo\""
test Xml.attributes get attr1 = { "#attribute" { "attr1" = "value1" } { "attr2" = "value2" } }
An authentication stanza
let auth = [ Util.indent . Build.xchg /auth(enticated)?/ "auth" "auth" . Sep.space . store /yes|no|on|off|any/ . Util.comment_or_eol ]
let authorized_key = [ label "key" . (key_options . Sep.space)? . key_type . Sep.space . store Rx.no_spaces . (Sep.space . key_comment)? . Util.eol ]
test Authorized_Keys.lns get "tunnel=\"0\",no-agent-forwarding,command=\"sh /etc/netstart tun0\",permitopen=\"192.0.2.1:80\",permitopen=\"192.0.2.2:25\" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t/qyvOvnuqIrMNI9J8+1sEYv8Y/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS/YQG6u/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ== rpinson on rpinson\n" = { "key" = "AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t/qyvOvnuqIrMNI9J8+1sEYv8Y/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS/YQG6u/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ==" { "options" { "tunnel" = "0" } { "no-agent-forwarding" } { "command" = "sh /etc/netstart tun0" } { "permitopen" = "192.0.2.1:80" } { "permitopen" = "192.0.2.2:25" } } { "type" = "ssh-rsa" } { "comment" = "rpinson on rpinson" } }