Skip to content

Commit

Permalink
g3proxy: add user audit CI testcase (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b authored Nov 25, 2024
1 parent 90b8626 commit 4bea3a5
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

log: stdout
log: journal

stat:
target:
Expand Down
2 changes: 1 addition & 1 deletion scripts/coverage/g3proxy/0021_audit_icap/g3proxy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

log: journal
log: stdout

stat:
target:
Expand Down
91 changes: 91 additions & 0 deletions scripts/coverage/g3proxy/0022_audit_user/g3proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---

log: stdout

stat:
target:
udp: 127.0.0.1:8125

resolver:
- name: default
type: c-ares
server:
- 127.0.0.1

escaper:
- name: default
type: direct_fixed
resolver: default
egress_net_filter:
default: allow
allow: 127.0.0.1

auditor:
- name: default
protocol_inspection: { }
tls_cert_generator: { }
tls_ticketer: { }
tls_stream_dump: { }

user-group:
- name: default
static_users:
- name: t1
token:
salt: 4e8f8a4e37f0fa1b
md5: d9d963915b9815d4cc39c196c2868900
sha1: c28640e7b1a3d9db98187632aeba99c0cff0ffd4
audit:
enable_protocol_inspection: false
- name: t2
token: '$1$rnfSARNK$DJNIbbMpjjSmral92rE3k1'
audit:
enable_protocol_inspection: true
task_audit_ratio: 0
- name: t3
token:
salt: 113323bdab6fd2cc
md5: 5c81f2becadde7fa5fde9026652ccc84
sha1: ff9d5c1a14328dd85ee95d4e574bd0558a1dfa96
audit:
enable_protocol_inspection: true
explicit_sites:
- id: httpbin.local
exact_match:
- httpbin.local
emit_stats: true
tls_client:
ca-certificate: ../rootCA.pem

server:
- name: rss
type: http_rproxy
listen: 127.0.0.1:9443
escaper: default
enable_tls_server: true
global_tls_server:
cert_pairs:
certificate: ../httpbin.local.pem
private-key: ../httpbin.local-key.pem
hosts:
- exact_match: httpbin.local
upstream: 127.0.0.1:80
tls_server:
cert_pairs:
certificate: ../httpbin.local.pem
private-key: ../httpbin.local-key.pem
- name: http
type: http_proxy
escaper: default
auditor: default
user-group: default
listen:
address: "[::]:8080"
tls_client: { }
- name: socks
type: socks_proxy
escaper: default
auditor: default
user-group: default
listen:
address: "[::]:1080"
17 changes: 17 additions & 0 deletions scripts/coverage/g3proxy/0022_audit_user/testcases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh


for user in t1:toor t2:toor t3:toor
do
HTTP_PROXY="http://${user}@127.0.0.1:8080"
test_http_proxy_http_forward
# test_http_proxy_ftp_over_http
test_http_proxy_https_connect
test_http_proxy_https_forward
test_http_proxy_h2


SOCKS5_PROXY="socks5h://${user}@127.0.0.1:1080"
test_socks5_proxy_http
# test_socks5_proxy_dns
done

0 comments on commit 4bea3a5

Please sign in to comment.