api/mock_config.yaml
Peter Kurfer 9236a38be0 Moved endpoint handling to new module
- introduce new endpoints module
- introduce Endpoint and EndpointManager
- introduce new Logging abstraction API to allow proper mocking
- add error return value to Start and Shutdown of endpoints
- add mocks of some internals to allow easier testing
- add generate target to take care of all code generation
2020-04-14 00:15:33 +02:00

81 lines
No EOL
1.8 KiB
YAML

x-response-rules: &httpResponseRules
rules:
- pattern: ".*\\.(?i)exe"
response: ./assets/fakeFiles/sample.exe
- pattern: ".*\\.(?i)(jpg|jpeg)"
response: ./assets/fakeFiles/default.jpg
- pattern: ".*\\.(?i)png"
response: ./assets/fakeFiles/default.png
- pattern: ".*\\.(?i)gif"
response: ./assets/fakeFiles/default.gif
- pattern: ".*\\.(?i)ico"
response: ./assets/fakeFiles/default.ico
- pattern: ".*\\.(?i)txt"
response: ./assets/fakeFiles/default.txt
- pattern: ".*"
response: ./assets/fakeFiles/default.html
x-tls-options: &tlsOptions
ecdsaCurve: P256
validity:
ca:
notBeforeRelative: 17520h
notAfterRelative: 17520h
domain:
notBeforeRelative: 168h
notAfterRelative: 168h
rootCaCert:
publicKey: ./ca.pem
privateKey: ./ca.key
certCachePath: /tmp/inetmock/
endpoints:
plainHttp:
handler: http_mock
listenAddress: 0.0.0.0
ports:
- 80
- 8080
options:
<<: *httpResponseRules
proxy:
handler: http_proxy
listenAddress: 0.0.0.0
port: 3128
options:
fallback: notfound
<<: *httpResponseRules
httpsDowngrade:
handler: tls_interceptor
listenAddress: 0.0.0.0
ports:
- 443
- 8443
options:
<<: *tlsOptions
target:
ipAddress: 127.0.0.1
port: 80
plainDns:
handler: dns_mock
listenAddress: 0.0.0.0
port: 53
options:
rules:
- pattern: ".*\\.google\\.com"
response: 1.1.1.1
- pattern: ".*\\.reddit\\.com"
response: 2.2.2.2
fallback:
strategy: incremental
args:
startIP: 10.0.10.0
dnsOverTlsDowngrade:
handler: tls_interceptor
listenAddress: 0.0.0.0
port: 853
options:
<<: *tlsOptions
target:
ipAddress: 127.0.0.1
port: 53