Skip to content

Commit

Permalink
Merge pull request #1541 from jrha/metaconfig_httpd_negate
Browse files Browse the repository at this point in the history
ncm-metaconfig/httpd: Don't render negate if set
  • Loading branch information
ned21 authored Oct 8, 2022
2 parents d2b3c27 + e7a8ad0 commit 083ee42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ multiline
^\s{8}sslrequiressl$
^\s{8}require not all granted$
^\s{8}require not ip 1.2.3.4$
^\s{8}require not negate 1$
^\s{8}require all denied$
^\s{8}require env VARX VARY$
^\s{8}require expr some valid expression$
Expand Down
12 changes: 7 additions & 5 deletions ncm-metaconfig/src/main/metaconfig/httpd/config/authz.tt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[%- FOR authz IN desc -%]
[%- FOR pair IN authz.pairs -%]
[%- IF pair.key != 'negate' -%]
require [% authz.negate ? 'not ' : '' -%][%- pair.key -%]
[%- SWITCH pair.key -%]
[%- CASE ['not', 'valid-user'] -%]
[%- CASE -%]
[%- -%] [% CCM.is_list(pair.value) ? pair.value.join(' ') : pair.value -%]
[%- END %]
[%- SWITCH pair.key -%]
[%- CASE ['not', 'valid-user'] -%]
[%- CASE -%]
[%- -%] [% CCM.is_list(pair.value) ? pair.value.join(' ') : pair.value -%]
[%- END %]
[% END %]
[% END %]
[% END -%]

0 comments on commit 083ee42

Please sign in to comment.