unitysvc-data 0.1.4__tar.gz → 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unitysvc_data-0.1.4/src/unitysvc_data.egg-info → unitysvc_data-0.1.5}/PKG-INFO +1 -1
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/pyproject.toml +1 -1
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/_manifest.json +15 -1
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/smtp/connectivity/README.md +12 -0
- unitysvc_data-0.1.5/src/unitysvc_data/examples/smtp/connectivity/connectivity-v2.sh.j2 +45 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5/src/unitysvc_data.egg-info}/PKG-INFO +1 -1
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data.egg-info/SOURCES.txt +1 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/LICENSE +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/README.md +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/setup.cfg +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/__init__.py +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/_registry.py +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/_version.py +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/cli.py +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/api/connectivity/README.md +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/api/connectivity/connectivity-v1.sh.j2 +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/llm/request-template/README.md +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/llm/request-template/request-template-v1.json +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/code-example/README.md +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/code-example/code-example-v1.py.j2 +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/connectivity/README.md +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/connectivity/connectivity-v1.py.j2 +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/description/README.md +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/description/description-v1.md +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/smtp/connectivity/connectivity-v1.sh.j2 +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/presets.py +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/py.typed +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data.egg-info/dependency_links.txt +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data.egg-info/entry_points.txt +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data.egg-info/requires.txt +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data.egg-info/top_level.txt +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/tests/test_build.py +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/tests/test_cli.py +0 -0
- {unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/tests/test_presets.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "unitysvc-data"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
description = "Standard examples and presets for UnitySVC data packages"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Bo Peng", email = "bo.peng@unitysvc.com" }]
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"s3_code_example": "s3_code_example_v1",
|
|
6
6
|
"s3_connectivity": "s3_connectivity_v1",
|
|
7
7
|
"s3_description": "s3_description_v1",
|
|
8
|
-
"smtp_connectivity": "
|
|
8
|
+
"smtp_connectivity": "smtp_connectivity_v2"
|
|
9
9
|
},
|
|
10
10
|
"presets": {
|
|
11
11
|
"api_connectivity_v1": {
|
|
@@ -93,6 +93,20 @@
|
|
|
93
93
|
"preset_name": "smtp_connectivity",
|
|
94
94
|
"source_readme": "smtp/connectivity/README.md",
|
|
95
95
|
"version": 1
|
|
96
|
+
},
|
|
97
|
+
"smtp_connectivity_v2": {
|
|
98
|
+
"category": "connectivity_test",
|
|
99
|
+
"description": "Verify SMTP server returns a 220 greeting on connect",
|
|
100
|
+
"example_file": "smtp/connectivity/connectivity-v2.sh.j2",
|
|
101
|
+
"is_active": true,
|
|
102
|
+
"is_public": false,
|
|
103
|
+
"meta": {
|
|
104
|
+
"output_contains": "connectivity ok"
|
|
105
|
+
},
|
|
106
|
+
"mime_type": "bash",
|
|
107
|
+
"preset_name": "smtp_connectivity",
|
|
108
|
+
"source_readme": "smtp/connectivity/README.md",
|
|
109
|
+
"version": 2
|
|
96
110
|
}
|
|
97
111
|
},
|
|
98
112
|
"version": "1"
|
{unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/smtp/connectivity/README.md
RENAMED
|
@@ -45,6 +45,18 @@ The script picks the mode by looking at which env var is set — no
|
|
|
45
45
|
|
|
46
46
|
## Versions
|
|
47
47
|
|
|
48
|
+
### v2 — TLS support
|
|
49
|
+
|
|
50
|
+
- Reads `$TLS` env var (local mode) and detects `smtps://` scheme (online
|
|
51
|
+
mode) to select the transport.
|
|
52
|
+
- When TLS is required, uses `openssl s_client -connect` instead of `nc`
|
|
53
|
+
so that implicit-TLS (SMTPS) upstreams complete the handshake before
|
|
54
|
+
the server sends the `220` banner.
|
|
55
|
+
- When TLS is not required, behaviour is identical to v1.
|
|
56
|
+
- Use v2 for any upstream with `tls: true` in `upstream_access_config`
|
|
57
|
+
or a `smtps://` gateway URL.
|
|
58
|
+
|
|
48
59
|
### v1 — initial release
|
|
49
60
|
|
|
50
61
|
- Uses `nc -w 5`; sends `QUIT`; accepts any `220 ...` banner.
|
|
62
|
+
- Plain SMTP only — does not handle implicit TLS (SMTPS).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Connectivity test for SMTP services. A healthy mail server sends a
|
|
3
|
+
# "220 ... ESMTP ..." greeting on connect; anything else (no response,
|
|
4
|
+
# timeout, or other greeting code) is treated as failure.
|
|
5
|
+
#
|
|
6
|
+
# Env var layout the harness provides:
|
|
7
|
+
# local mode — $HOST, $PORT, $TLS (from upstream_access_config)
|
|
8
|
+
# online mode — $SERVICE_BASE_URL (smtp://host:port or smtps://host:port)
|
|
9
|
+
# We branch on whichever is present so the same script works in both.
|
|
10
|
+
set -o pipefail
|
|
11
|
+
|
|
12
|
+
USE_TLS=false
|
|
13
|
+
|
|
14
|
+
if [ -n "${HOST:-}" ]; then
|
|
15
|
+
PORT="${PORT:-587}"
|
|
16
|
+
[ "${TLS:-False}" = "True" ] && USE_TLS=true
|
|
17
|
+
else
|
|
18
|
+
URL="${SERVICE_BASE_URL:?need HOST or SERVICE_BASE_URL}"
|
|
19
|
+
if [[ "$URL" == smtps://* ]]; then
|
|
20
|
+
USE_TLS=true
|
|
21
|
+
stripped="${URL#smtps://}"
|
|
22
|
+
else
|
|
23
|
+
stripped="${URL#smtp://}"
|
|
24
|
+
fi
|
|
25
|
+
HOST="${stripped%%:*}"
|
|
26
|
+
PORT="${stripped#*:}"
|
|
27
|
+
PORT="${PORT%%/*}"
|
|
28
|
+
PORT="${PORT:-587}"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Send QUIT so the server closes cleanly instead of timing out on us.
|
|
32
|
+
# Use openssl s_client for implicit TLS (SMTPS); nc for plain SMTP.
|
|
33
|
+
if [ "$USE_TLS" = "true" ]; then
|
|
34
|
+
greeting=$( (echo "QUIT"; sleep 1) | openssl s_client -connect "$HOST:$PORT" -quiet 2>/dev/null | head -1 )
|
|
35
|
+
else
|
|
36
|
+
greeting=$( (echo "QUIT"; sleep 1) | nc -w 5 "$HOST" "$PORT" 2>/dev/null | head -1 )
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
if [[ "$greeting" == "220 "* ]]; then
|
|
40
|
+
echo "connectivity ok ($greeting)"
|
|
41
|
+
exit 0
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
echo "connectivity failed: expected '220 ...' greeting from ${HOST}:${PORT}, got: ${greeting:-<no response>}" >&2
|
|
45
|
+
exit 1
|
|
@@ -26,6 +26,7 @@ src/unitysvc_data/examples/s3/description/README.md
|
|
|
26
26
|
src/unitysvc_data/examples/s3/description/description-v1.md
|
|
27
27
|
src/unitysvc_data/examples/smtp/connectivity/README.md
|
|
28
28
|
src/unitysvc_data/examples/smtp/connectivity/connectivity-v1.sh.j2
|
|
29
|
+
src/unitysvc_data/examples/smtp/connectivity/connectivity-v2.sh.j2
|
|
29
30
|
tests/test_build.py
|
|
30
31
|
tests/test_cli.py
|
|
31
32
|
tests/test_presets.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/api/connectivity/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/code-example/README.md
RENAMED
|
File without changes
|
|
File without changes
|
{unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/connectivity/README.md
RENAMED
|
File without changes
|
|
File without changes
|
{unitysvc_data-0.1.4 → unitysvc_data-0.1.5}/src/unitysvc_data/examples/s3/description/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|