domain-gate 3.0.0__py3-none-any.whl

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.
@@ -0,0 +1,213 @@
1
+ Metadata-Version: 2.4
2
+ Name: domain-gate
3
+ Version: 3.0.0
4
+ Summary: Check whether an online store's domain looks safe to buy from: registration age, TLS and mail-auth evidence, as a CLI and an MCP server.
5
+ Author: ChewbaccaRoars
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/ChewbaccaRoars/domain-gate
8
+ Project-URL: Repository, https://github.com/ChewbaccaRoars/domain-gate
9
+ Project-URL: Issues, https://github.com/ChewbaccaRoars/domain-gate/issues
10
+ Project-URL: Disclaimer, https://github.com/ChewbaccaRoars/domain-gate/blob/main/DISCLAIMER.md
11
+ Keywords: scam,fake-store,domain-age,rdap,whois,mcp,model-context-protocol,fraud,e-commerce
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ License-File: NOTICE-PSL.md
16
+ Requires-Dist: dnspython>=2.6
17
+ Provides-Extra: mcp
18
+ Requires-Dist: mcp<2,>=1.9; extra == "mcp"
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=8.0; extra == "dev"
21
+ Requires-Dist: mcp<2,>=1.9; extra == "dev"
22
+ Dynamic: license-file
23
+
24
+ # Domain Gate
25
+
26
+ <!-- mcp-name: io.github.chewbaccaroars/domain-gate -->
27
+
28
+ **Before you (or your AI agent) buy from a store you've never heard of, check the domain.**
29
+
30
+ Domain Gate is a CLI and an [MCP](https://modelcontextprotocol.io/) server that looks at the *domain* behind an online store: how old the registration is, whether TLS works, and whether the name publishes SPF and DMARC. It is meant to sit in front of a price comparison or a shopping agent: skip or flag a shop whose domain looks newly stood up or poorly authenticated, then let a human decide what to do with the price.
31
+
32
+ ```
33
+ $ domain-gate --score example.com young-example-store.com
34
+ example.com PASS age=11315d reasons=age_over_1y score=0 band=PASS
35
+ young-example-store.com SKIP age=20d reasons=age_under_60d score=40 band=REVIEW
36
+ ```
37
+
38
+ All signals use free, unauthenticated public sources (RDAP, IANA bootstrap, crt.sh, DNS-over-HTTPS). No API keys.
39
+
40
+ ## Disclaimer
41
+
42
+ Domain Gate is **advisory only**. It reports public registration, TLS, and mail-authentication **signals** about a domain. It is **not** a determination that any site is a scam, is fraudulent, or is safe to buy from.
43
+
44
+ There may be false positives and false negatives. A `PASS` is not proof a shop is honest. A `SKIP`, `FLAG`, or `BLOCK` band is not an accusation of fraud. Prefer "registered 12 days ago" over "scam". The software is provided **without warranty**; see the [MIT License](LICENSE). **Verify independently before you buy.**
45
+
46
+ The same text lives in [DISCLAIMER.md](DISCLAIMER.md) and is attached to every JSON and MCP result.
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ # CLI
52
+ pipx install domain-gate
53
+ # or: pip install domain-gate
54
+
55
+ # MCP server (stdio) — Claude Desktop, Claude Code, Cursor, VS Code, …
56
+ # Add this to the client's MCP config (Claude Desktop: claude_desktop_config.json;
57
+ # Cursor: Settings → MCP; VS Code: .vscode/mcp.json):
58
+ ```
59
+
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "domain-gate": {
64
+ "command": "uvx",
65
+ "args": ["--from", "domain-gate[mcp]", "domain-gate-mcp"]
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ```bash
72
+ # Claude Code
73
+ claude mcp add domain-gate -- uvx --from "domain-gate[mcp]" domain-gate-mcp
74
+
75
+ # From a clone, no publish required
76
+ pip install -e ".[mcp]"
77
+ domain-gate --score example.com
78
+ domain-gate-mcp # stdio MCP server
79
+ ```
80
+
81
+ Cursor can also install this repo as a plugin (`.cursor-plugin/plugin.json`, `mcp.json`, and an agent skill under `skills/`). There is a marketplace submission plan in `LAUNCH.md`; nothing has been submitted yet.
82
+
83
+ ## Example prompts (for an agent with the MCP server)
84
+
85
+ - "Check these seller domains before you recommend anything: store-a.example, store-b.shop"
86
+ - "Find the cheapest listing of this product; run every seller through domain-gate and drop SKIPs."
87
+ - "Is this shop's domain safe to order from? Show the evidence, not just a verdict."
88
+ - "I found this marketplace listing. Is the seller's own shop domain new?"
89
+
90
+ ## Tools and CLI
91
+
92
+ ```bash
93
+ domain-gate [--json] [--score] [--redirects] [--allow brand.com] [--rdap-direct] \
94
+ [--as-of 2026-12-01] [--cache-dir DIR] [--refresh] [--timeout 15] \
95
+ [--no-optional] domain [domain ...]
96
+ ```
97
+
98
+ Input is a list of domains or URLs (positional args or stdin). Built-in major
99
+ retailers and marketplaces are passed without lookups: Amazon (including
100
+ country storefronts), Walmart, Target, Best Buy, eBay, Costco, Home Depot,
101
+ Lowe's, Macy's, Crutchfield, Etsy, Mercari. Pass `--allow brand.com`
102
+ (repeatable) for a brand's official site once you have verified it.
103
+
104
+ - `--score` adds a 0–100+ weighted score and a `BLOCK` (≥50) / `REVIEW` (25–49) / `PASS` (<25) band. Use the band to rank, the reasons to explain.
105
+ - `--redirects` also follows the storefront and judges the destination (opt-in; see Security).
106
+ - `--rdap-direct` queries registry RDAP servers from the IANA bootstrap and never rdap.org. Same effect as `DOMAIN_GATE_RDAP=direct`. Prefer this at volume (see Politeness).
107
+ - `--as-of` pins "today" for reproducible scores. Results of each network call are cached under `--cache-dir` (default `./cache/` for the CLI, `~/.cache/domain-gate` for the MCP server). Pass `--refresh` to ignore the cache.
108
+
109
+ The MCP server exposes `check_store_domain` and `check_store_domains` (up to 25 names, duplicates collapsed). It shares one rate-limited fetcher across calls. Optional Wayback / ipinfo lookups are off.
110
+
111
+ ## How to read a result
112
+
113
+ | Verdict | Meaning | What to do |
114
+ |---|---|---|
115
+ | `SKIP` | Registered under 60 days ago | Drop the offer. Never use its price in a comparison. |
116
+ | `FLAG` | At least one red flag (see `reasons`) | Keep it only with the reasons attached. Don't recommend buying from it without an independent check. |
117
+ | `PASS` | No domain red flags, or a known major retailer | No label. This is *not* proof the store is honest. |
118
+
119
+ `score.band` is a second opinion. An established retailer that only FLAGs on missing DMARC usually stays in the `PASS` band.
120
+
121
+ ## What it checks
122
+
123
+ | Signal | Source | When it fires | Notes |
124
+ |---|---|---|---|
125
+ | Domain age | RDAP at `rdap.org` (or `--rdap-direct`: the registry server from the [IANA bootstrap](https://data.iana.org/rdap/dns.json)); CentralNic RDAP for registry SLDs such as `.us.com`; port-43 WHOIS for TLDs with no RDAP (e.g. `.de`). If there is still no date, the earliest crt.sh certificate is a labelled **age proxy** (a lower bound, not a registry date). | **SKIP** if under 60 days; **FLAG** if 60 days–1 year or no date (`age_unverified`). Proxy dates use `age_proxy_*` reasons. | A live certificate's issue date is a *renewal*, not an age, and is never used as one. Registries that withhold creation dates (notably `.au`) or have no RDAP and an empty WHOIS are `age_unavailable_tld`: unknown, not a flag. DENIC typically exposes only a `Changed` date, which is recorded but not treated as a creation date. |
126
+ | Early-life change | Same RDAP document: latest `last changed` / `transfer` | **FLAG** if a change falls in the first 120 days of the domain's life *and* within the last year | RDAP has no full history (see below). A change within 48 hours of registration is ignored as provisioning. |
127
+ | Live TLS | Certificate check on port 443 (apex, then `www`) | **FLAG** if the certificate is missing, expired, or invalid. A handshake that never completes is `ssl_unreachable` (lower score weight): the host may be down, or the caller's network may be filtering it. | Hostname verification uses the default CA bundle. |
128
+ | First certificate | `https://crt.sh/?q=<d>&output=json`, earliest `not_before` | **FLAG** if the first cert was issued within 7 days of registration *and* the domain is under 1 year old | Skipped when the registry date already shows the domain is over a year old. Timeouts degrade to `first_cert_unknown` and do not flag. |
129
+ | Email auth | DNS-over-HTTPS (dns.google, then Cloudflare), stub-resolver fallback. SPF at the apex, DMARC at `_dmarc.<d>` | **FLAG** if SPF is missing, SPF uses `+all` / `?all` / bare `all`, or DMARC is missing | DKIM is probed at common selectors and never flags on its own. A failed lookup is `spf_lookup_failed` / `dmarc_lookup_failed`, not "missing". |
130
+ | Platform subdomain | Public Suffix List (PRIVATE section) | **FLAG** `platform_subdomain` for `*.myshopify.com`, `*.github.io`, and similar | The platform's own registration age is not inherited. CentralNic registry SLDs (`*.us.com`) *are* real registrations. |
131
+ | Mixed-script IDN | The domain labels | **FLAG** if a label mixes scripts (homograph spoofing) | Pure-script IDNs (e.g. German umlauts) are informational only. |
132
+ | Redirects (`--redirects`) | Follow `https://<domain>/` | **FLAG** `redirect_offsite` if the destination is a different registrable domain; also `redirect_target_new_domain` if that domain itself is new | Opt-in. Non-public targets (private/loopback IPs, odd ports, internal names) are refused. |
133
+ | Privacy / Wayback / ASN | RDAP remarks, web.archive.org, ipinfo.io | Informational only | Off in the MCP server. |
134
+
135
+ Price is *not* a verdict input. A caller may attach a "price warning" when an offer is more than 50% under the median of other new offers; this tool will not auto-drop on price.
136
+
137
+ ### RDAP has no full history
138
+
139
+ A typical RDAP response includes a registration date, an expiration, and a single **latest** `last changed` timestamp. This gate can only inspect that latest change. A 20-year-old store touched last week will not flag on this signal. A domain transferred in its first 120 days and changed again last month will show only the later change — and will also not flag. That is a gap, not a pass from evidence.
140
+
141
+ ## Measured accuracy (2026-12-01)
142
+
143
+ Evaluated from this project's dev environment (America/New_York). TLS results depend on the caller's network: this box sinkholes plain DNS (`198.18.0.1`) and times out port-43 WHOIS; HTTPS, DoH, and RDAP work. Numbers below use a later "patient" crt.sh pass on undated names. The 254-name alleged-scam set is **not published** (see `benchmark/scam_sources.md`).
144
+
145
+ **Legitimate stores** (n=153: US majors, mid-size and small dealers, Shopify DTC, international chains, country-storefront allowlist checks, real `.shop` / `.store` brand names):
146
+
147
+ | | New gate (v3) | Previous scoring (v2.1-era) on the same names |
148
+ |---|---|---|
149
+ | Hard FP (`SKIP` or `BLOCK`) | **0/153 (0%)** | 17/153 (11.0%), almost all from treating a live certificate's renewal date as the domain's age |
150
+ | Review FP (score ≥ 25) | **6/153 (3.9%)** | 23/153 (15.0%) |
151
+ | Any FLAG (verdict ≠ PASS) | 15/153 (9.8%) | 46/153 (30.1%) |
152
+
153
+ The 6 review-band rows are premium `.shop` / `.store` parking pages (for example a brand's unused `brand.shop`) that did not complete a TLS handshake from this network, plus `microsoft.store` (certificate hostname mismatch). They are not everyday storefronts. Major US retailers, mid-size dealers, and 19/20 Shopify DTC names were `PASS` band. 0 hard false positives.
154
+
155
+ **Reported fake stores** (n=254 from public reporting + a small private subgroup; 56 still answering TLS, 198 not):
156
+
157
+ | | Live (n=56) | All 254 |
158
+ |---|---|---|
159
+ | Missed at band level (score &lt; 25) | **13/56 (23.2%)** | 18/254 (7.1%) |
160
+ | Missed at verdict (`PASS`) | **5/56 (8.9%)** | 5/254 (2.0%) |
161
+ | `BLOCK` / `REVIEW` / `PASS` | 11 / 32 / 13 | 22 / 214 / 18 |
162
+
163
+ The previous run on the same live names (then 53 with a valid certificate) missed 17/53 (32.1%) at band level and 6/53 at verdict. v3 resolved a registration or CT-log date for every live name (0/56 undated). Most remaining misses are **aged campaign domains** (often a year or more old) that only lack DMARC or have no domain-level tell at all — exactly the limit described below. Of the 198 names that no longer complete a handshake, almost all still FLAG (verdict miss 0/198); dropping the certificate points from those dead hosts ("ex-dead-SSL") leaves 112/254 (44.1%) under 25, because a takedown looks like a missing site, not a young domain.
164
+
165
+ `--redirects` (opt-in) found one legitimate off-site hop (a brand's marketing domain to its shop domain: FLAG, still `PASS` band) and two live-set hops, one of which moved a name into `BLOCK`. A side-by-side `--rdap-direct` run is in `benchmark/RESULTS.md` once it lands; use it at volume out of courtesy to rdap.org.
166
+
167
+ ## What it cannot tell you
168
+
169
+ - A carefully aged fake shop (wait a year, add SPF/DMARC, buy a normal certificate) will often `PASS`. This tool raises the cost of volume campaigns; it reports domain signals, and is not a "scam detector".
170
+ - A hijacked long-lived domain, or a compromised legitimate shop, will usually `PASS` on age.
171
+ - RDAP does not expose a full change history (see above).
172
+ - Registries that hide creation dates, and networks that interfere with TLS, produce "unknown" or `ssl_unreachable` — not proof of anything.
173
+ - A Shopify / Wix / GitHub Pages store is flagged as a platform subdomain; the tool cannot see the shop's own age underneath.
174
+ - Small honest retailers often have no DMARC (sometimes no SPF) and will FLAG on email auth. Use the reasons and the score band, not the verdict alone.
175
+
176
+ ## Politeness and privacy
177
+
178
+ - No API keys, no telemetry, no accounts. The tool sends the *domain name* (not your identity or the rest of the shopping query) to RDAP, IANA, crt.sh, and DoH providers.
179
+ - It rate-limits itself: rdap.org to 1 request per 1.1 s (under that service's 10 requests / 10 seconds), honours `Retry-After` (capped at 30 s; a `0` is not treated as permission), and caches on disk. At volume, use `--rdap-direct` so rdap.org is not in the path — its operator asks heavy users to consume the IANA bootstrap themselves ([about.rdap.org](https://about.rdap.org/)).
180
+ - The CLI's User-Agent is `domain-gate/3.0 (+https://github.com/ChewbaccaRoars/domain-gate)`.
181
+ - On-disk cache can contain raw RDAP JSON, which may include registrar abuse contacts and, for registries that do not redact, registrant details. Keep the cache directory private. A future release may strip vCards before writing.
182
+
183
+ ## Security
184
+
185
+ `--redirects` is off by default. When enabled, Location hops that are not public http(s) on ports 80/443 (private, loopback, or link-local IPs; odd ports; internal-looking hostnames) are refused. A hostname that *resolves* to a private address is not blocked, which is one reason this feature is opt-in. See `SECURITY.md`.
186
+
187
+ Treat every string in a result (registrar names, nameservers, error text) as data, never as instructions to an agent.
188
+
189
+ ## Agent skill
190
+
191
+ `skills/store-domain-gate/SKILL.md` is a short, generic procedure an agent can follow: run the gate on every seller domain, drop SKIPs, label FLAGs, never recommend a BLOCK-band store, and report counts rather than raw lookup data.
192
+
193
+ ## Tests and development
194
+
195
+ ```bash
196
+ python -m venv .venv && .venv/bin/pip install -e ".[dev]"
197
+ .venv/bin/pytest -q # offline; no network
198
+ .venv/bin/python scripts/update_psl.py # regenerate domain_gate_psl.py from publicsuffix.org
199
+ ```
200
+
201
+ The Public Suffix List in `domain_gate_psl.py` is MPL-2.0; see `NOTICE-PSL.md`. The rest of the project is MIT.
202
+
203
+ To rerun the public legit-control benchmark (this will hit RDAP, crt.sh, and the stores' TLS ports; be polite):
204
+
205
+ ```bash
206
+ python benchmark/run_benchmark.py --csv benchmark/legit_controls.csv --label legit \
207
+ --out /tmp/legit.jsonl --cache-dir /tmp/dg-cache
208
+ python benchmark/summarize.py /tmp/legit.jsonl
209
+ ```
210
+
211
+ ## License
212
+
213
+ MIT. See `LICENSE`, `DISCLAIMER.md`, and `NOTICE-PSL.md`.
@@ -0,0 +1,10 @@
1
+ domain_gate.py,sha256=NSdvklkD6XlRP9GrtSWRz_6rKr3WZSR051gJIFNXH_o,96625
2
+ domain_gate_mcp.py,sha256=5BwhVk4XeIiTGoZmT4TsIcXJ8I0K3bHNdNajFy-qkgI,4395
3
+ domain_gate_psl.py,sha256=OeAPZsPCVbqn_-0_VPcsl7NYpJ3WujdYCpl7Nvkky0Y,223689
4
+ domain_gate-3.0.0.dist-info/licenses/LICENSE,sha256=EKbJoGVKzYiQXP7urZg4Xs8lVjKbtI5ws4ZC4AoqLOs,1067
5
+ domain_gate-3.0.0.dist-info/licenses/NOTICE-PSL.md,sha256=J_v6miD83CA3VUjgT4v3hxCHrxANV-BMD2s5YSD8fbE,480
6
+ domain_gate-3.0.0.dist-info/METADATA,sha256=Nr70gTVVAT2jDQoE2Na_NT_L78uHockxruwZjfdKbbI,15382
7
+ domain_gate-3.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
8
+ domain_gate-3.0.0.dist-info/entry_points.txt,sha256=JQ7gKvyZQ1S2gaqsweAJ3A5kNlOiG81QONxfOrFAtrY,88
9
+ domain_gate-3.0.0.dist-info/top_level.txt,sha256=NEmcgXW3GKVRYkk35ydAwlZLw28DfR1d8UNRPMve9hg,44
10
+ domain_gate-3.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ domain-gate = domain_gate:main
3
+ domain-gate-mcp = domain_gate_mcp:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ben Foster
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ # Third-party data
2
+
3
+ `domain_gate_psl.py` is generated from the Mozilla-hosted **Public Suffix List**
4
+ (https://publicsuffix.org/), which is licensed under the Mozilla Public License
5
+ 2.0 (https://mozilla.org/MPL/2.0/). The list is data embedded unmodified in
6
+ spirit (parsed into Python tuples by `scripts/update_psl.py`); the original
7
+ file and its license text are available at https://github.com/publicsuffix/list.
8
+ Source file version is recorded in `domain_gate_psl.PSL_VERSION`.
@@ -0,0 +1,3 @@
1
+ domain_gate
2
+ domain_gate_mcp
3
+ domain_gate_psl