Skip to content

Commit

Permalink
test: create 9520121 and 9520120 regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EsadCetiner authored Jan 8, 2024
1 parent fdabd00 commit 745ff4b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/sogo-rule-exclusions-before.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------------------------------------
# sogo rule exclusions plugin
# Copyright (c) 2023 Esad Cetiner
# Copyright (c) 2023-2024 Esad Cetiner
#
# This plugin is distributed under GPLv2
# Please see the included LICENSE file for full details
Expand Down Expand Up @@ -132,6 +132,7 @@ SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Preferences/save$" \
#

# When creating/modifying contacts
# Adding websites for contacts
SecRule REQUEST_FILENAME "@rx ^/SOGo/so/[^/]+/Contacts/[^/]+/[^/]+\.vcf/saveAsContact$" \
"id:9520120,\
phase:1,\
Expand Down
2 changes: 1 addition & 1 deletion plugins/sogo-rule-exclusions-config.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------------------------------------
# sogo rule exclusions plugin
# Copyright (c) 2023 Esad Cetiner
# Copyright (c) 2023-2024 Esad Cetiner
#
# This plugin is distributed under GPLv2
# Please see the included LICENSE file for full details
Expand Down
22 changes: 22 additions & 0 deletions tests/regression/sogo-rule-exclusions-plugin/9520120.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
meta:
author: "Esad Cetiner"
description: "SOGo Rule Exclusions Plugin"
enabled: true
name: 9520120.yaml
tests:
- test_title: 9520120-1
desc: Disable 931130 for ARGS:json.urls.array_0.value
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: SOGo rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: GET
uri: /SOGo/so/[email protected]/Contacts/work-contacts/john-doe.vcf/saveAsContact?json.urls.array_0.value=https://example.com/
output:
no_log_contains: id "931130"
22 changes: 22 additions & 0 deletions tests/regression/sogo-rule-exclusions-plugin/9520121.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
meta:
author: "Esad Cetiner"
description: "SOGo Rule Exclusions Plugin"
enabled: true
name: 9520121.yaml
tests:
- test_title: 9520121-1
desc: Disable 931130 for ARGS:json.cardDavURL
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: SOGo rule exclusions plugin
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
port: 80
method: GET
uri: /SOGo/so/[email protected]/Contacts/work-contacts/save?json.cardDavURL=https://example.com/
output:
no_log_contains: id "931130"

0 comments on commit 745ff4b

Please sign in to comment.