Skip to content

Commit

Permalink
metaconfig: haproxy: support acl in backend
Browse files Browse the repository at this point in the history
  • Loading branch information
stdweird committed Apr 13, 2023
1 parent 842153e commit 868b903
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ncm-metaconfig/src/main/metaconfig/haproxy/backend.tt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ mode [% bke.mode %]
[% FOREACH option IN bke.options -%]
option [% option %]
[% END -%]
[% FOREACH aclline IN bke.acl.pairs -%]
acl [% aclline.key %] [% aclline.value %]
[% END -%]
[% FOREACH httpr IN bke.item('http-request') -%]
http-request [% httpr %]
[% END -%]
Expand Down
1 change: 1 addition & 0 deletions ncm-metaconfig/src/main/metaconfig/haproxy/pan/schema.pan
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ type haproxy_service_backend = {
'servers' : haproxy_service_backend_server[]
'reqrep' ? haproxy_service_reqrep[]
'http-request' ? string[]
'acl' ? dict()
};

@documentation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ prefix 'backends/irods-bk';
"options/0" = "tcp-check";
"tcpchecks" = list("connect", "send PING\n", 'expect string <MsgHeader_PI>\n<type>RODS_VERSION</type>');
"http-request/0" = "hello";
"acl/whatif" = "match";
"reqrep/0" = dict(
"pattern", 'abc\ def', # need escaped space, so single quotes
"replace", '\1 \2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Test for config
^\s{4}default_backend\sirods-bk$
^backend\sirods-bk$
^\s{4}option\stcp-check$
^\s{4}acl\swhatif\smatch$
^\s{4}http-request\shello$
^\s{4}tcp-check\sconnect$
^\s{4}tcp-check\ssend\sPING$
Expand Down

0 comments on commit 868b903

Please sign in to comment.