Skip to content

Commit 251b059

Browse files
committed
add require: syntax to -x509-pat option
1 parent 0ec5cf4 commit 251b059

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

auth_cert.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ func NewAuthX509Pat(sni, action string) (ret AuthX509Pattern, err error) {
5656
if strings.HasPrefix(action, "!") {
5757
ret.require = true
5858
action = action[1:]
59+
} else if strings.HasPrefix(action, "require:") {
60+
ret.require = true
61+
action = action[len("require:"):]
5962
}
6063
switch action {
6164
case "none":

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func main() {
5555
var x509Pat AuthX509PatFlag
5656
flag.Var(&authFlag, "auth", "alias to 'role'")
5757
flag.Var(&authFlag, "role", "[<role>[+<role2>]=]<method>:<auth> (multi-arg)")
58-
flag.Var(&x509Pat, "x509-pat", "{'*'|'*.'<domain>|<servername>}={'none'|[!]'any'} (multi-arg, default '*=any' if have cert auth or '*=none' otherwise)")
58+
flag.Var(&x509Pat, "x509-pat", "{'*'|'*.'<domain>|<servername>}={'none'|['require:']'any'} (multi-arg, default '*=any' if have cert auth or '*=none' otherwise)")
5959
flag.Var(&aclFlag, "acl", "[{host:<vhost..>|<method..>}]<path_regexp>=<role>[+<role2..>]:<role..> (multi-arg)")
6060
flag.Var(&urlMaps, "map", "[<vhost>]/<path>=<handler>:[<params>] (multi-arg, default '/=file:')")
6161
flag.Var(&corsMaps, "cors", "<path>=<allowed_origin> (multi-arg)")

0 commit comments

Comments
 (0)