Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lb): add support for http_header_match #1950

Merged
merged 4 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/scw/testdata/test-all-usage-lbacl-create-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ ARGS:
name=<generated> Name of your ACL ressource
[action.type] The action type (allow | deny)
[match.ip-subnet.{index}] A list of IPs or CIDR v4/v6 addresses of the client of the session to match
[match.http-filter] The HTTP filter to match (acl_http_filter_none | path_begin | path_end | regex)
[match.http-filter] The HTTP filter to match (acl_http_filter_none | path_begin | path_end | regex | http_header_match)
[match.http-filter-value.{index}] A list of possible values to match for the given HTTP filter
[match.http-filter-option] A exra parameter. You can use this field with http_header_match acl type to set the header name to filter
[match.invert] If set to `true`, the ACL matching condition will be of type "UNLESS"
index Order between your Acls (ascending order, 0 is first acl executed)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1 | pl-waw-1)
Expand Down
3 changes: 2 additions & 1 deletion cmd/scw/testdata/test-all-usage-lbacl-update-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ ARGS:
name Name of your ACL ressource
[action.type] The action type (allow | deny)
[match.ip-subnet.{index}] A list of IPs or CIDR v4/v6 addresses of the client of the session to match
[match.http-filter] The HTTP filter to match (acl_http_filter_none | path_begin | path_end | regex)
[match.http-filter] The HTTP filter to match (acl_http_filter_none | path_begin | path_end | regex | http_header_match)
[match.http-filter-value.{index}] A list of possible values to match for the given HTTP filter
[match.http-filter-option] A exra parameter. You can use this field with http_header_match acl type to set the header name to filter
[match.invert] If set to `true`, the ACL matching condition will be of type "UNLESS"
index Order between your Acls (ascending order, 0 is first acl executed)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1 | pl-waw-1)
Expand Down
6 changes: 4 additions & 2 deletions docs/commands/lb.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ scw lb acl create [arg=value ...]
| name | Required<br />Default: `<generated>` | Name of your ACL ressource |
| action.type | One of: `allow`, `deny` | The action type |
| match.ip-subnet.{index} | | A list of IPs or CIDR v4/v6 addresses of the client of the session to match |
| match.http-filter | One of: `acl_http_filter_none`, `path_begin`, `path_end`, `regex` | The HTTP filter to match |
| match.http-filter | One of: `acl_http_filter_none`, `path_begin`, `path_end`, `regex`, `http_header_match` | The HTTP filter to match |
| match.http-filter-value.{index} | | A list of possible values to match for the given HTTP filter |
| match.http-filter-option | | A exra parameter. You can use this field with http_header_match acl type to set the header name to filter |
| match.invert | | If set to `true`, the ACL matching condition will be of type "UNLESS" |
| index | Required | Order between your Acls (ascending order, 0 is first acl executed) |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config |
Expand Down Expand Up @@ -162,8 +163,9 @@ scw lb acl update <acl-id ...> [arg=value ...]
| name | Required | Name of your ACL ressource |
| action.type | One of: `allow`, `deny` | The action type |
| match.ip-subnet.{index} | | A list of IPs or CIDR v4/v6 addresses of the client of the session to match |
| match.http-filter | One of: `acl_http_filter_none`, `path_begin`, `path_end`, `regex` | The HTTP filter to match |
| match.http-filter | One of: `acl_http_filter_none`, `path_begin`, `path_end`, `regex`, `http_header_match` | The HTTP filter to match |
| match.http-filter-value.{index} | | A list of possible values to match for the given HTTP filter |
| match.http-filter-option | | A exra parameter. You can use this field with http_header_match acl type to set the header name to filter |
| match.invert | | If set to `true`, the ACL matching condition will be of type "UNLESS" |
| index | Required | Order between your Acls (ascending order, 0 is first acl executed) |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config |
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/karrick/tparse v2.4.2+incompatible
github.com/mattn/go-colorable v0.1.8
github.com/mattn/go-isatty v0.0.13
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210510090404-0b46577f308f
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210707121459-c4899e298c98
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210510090404-0b46577f308f h1:AkxRIEQ413mDXYlXFQ317j2JjIQaBIVhJbMgm4CRsL8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210510090404-0b46577f308f/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210707121459-c4899e298c98 h1:2VLw+nHp0U3R1VQApoDRUY45f+o4Knu9CMk/0hgSy+k=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210707121459-c4899e298c98/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
Expand Down
Loading