verifiers 0.3.2.dev155__py3-none-any.whl → 0.3.2.dev156__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.
@@ -16,6 +16,7 @@ import logging
16
16
  from abc import ABC, abstractmethod
17
17
  from collections.abc import Callable, Mapping
18
18
  from glob import has_magic
19
+ from ipaddress import ip_address
19
20
  from typing import Any, ClassVar, Generic, TypeVar
20
21
 
21
22
  from pydantic import AnyHttpUrl, BaseModel, ValidationError
@@ -129,10 +130,10 @@ class RequestFilter:
129
130
  def provider_domains(
130
131
  policy: NetworkPolicyConfig, requested: object = None
131
132
  ) -> list[str]:
132
- """Translate allow/block rules to provider filters without changing their scope.
133
+ """Translate host rules to the provider's native domain filters.
133
134
 
134
- Provider filters include subdomains, so exact hosts need a covering wildcard rule.
135
- Empty results mean the policy cannot be represented; never send an empty filter.
135
+ Strip leading wildcards and let the provider define domain/subdomain scope.
136
+ Empty results mean unsupported rules; never send an empty filter.
136
137
  """
137
138
  rules = policy.block or policy.allow
138
139
  if requested is not None and not isinstance(requested, list):
@@ -149,9 +150,7 @@ def provider_domains(
149
150
  url, host, port = parse_network_rule(rule)
150
151
  except ValueError:
151
152
  return []
152
- if is_filter and (
153
- url.username is not None or url.path or url.query or url.fragment
154
- ):
153
+ if url.username is not None or url.path or url.query or url.fragment:
155
154
  return []
156
155
  domain = host if is_filter else host.removeprefix("*.")
157
156
  if (
@@ -162,17 +161,12 @@ def provider_domains(
162
161
  or not domain.isascii()
163
162
  ):
164
163
  return []
165
- output.append(host)
166
- for host in hosts:
167
- if not host.startswith("*.") and not (
168
- policy.block
169
- and any(
170
- wildcard.startswith("*.")
171
- and intersect_network_hosts(wildcard, host) == host
172
- for wildcard in hosts
173
- )
174
- ):
175
- return []
164
+ try:
165
+ ip_address(domain)
166
+ except ValueError:
167
+ output.append(host)
168
+ else:
169
+ return []
176
170
  domains = list(dict.fromkeys(host.removeprefix("*.") for host in hosts))
177
171
  if requested is None:
178
172
  return domains
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev155
3
+ Version: 0.3.2.dev156
4
4
  Summary: Verifiers: Environments for LLM Reinforcement Learning
5
5
  Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
6
6
  Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
@@ -62,7 +62,7 @@ verifiers/v1/configs/cli/replay.py,sha256=vUCNs-9j1CXcAZhGozN1EaztcXK_dYVK3iN_fR
62
62
  verifiers/v1/configs/cli/validate.py,sha256=oc-SSot6-5a0vXC-yFEQxYbb1O4r8k0Or8d_ijmizkU,3581
63
63
  verifiers/v1/dialects/__init__.py,sha256=MNOYM2NdTlSxGK4VtoEjMtD5zya2MpjPDX5jMvZUWEo,736
64
64
  verifiers/v1/dialects/anthropic.py,sha256=rkxS8K4xvSTZwS86Mz_a4MfHzrkYf9Vvu8wCerzVNIw,26111
65
- verifiers/v1/dialects/base.py,sha256=7peaHJGdVT93G3erTnlAcRJi7tGvJ9BUkd_W5O4HGms,16140
65
+ verifiers/v1/dialects/base.py,sha256=BOqQFQU5ya80fp3Ny_miLHArtYTWlPpvxVC7z8UKaQ0,15909
66
66
  verifiers/v1/dialects/chat.py,sha256=KOrDW2f4WMLl37Pv2EilKddCXUUgRNjl4tQseMiPC-o,23775
67
67
  verifiers/v1/dialects/responses.py,sha256=GXI4xzvZWL5Dugi9uHPhrSdgV6RQ5zQuuPfzVztu2Go,30457
68
68
  verifiers/v1/envs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -193,8 +193,8 @@ verifiers/v1/utils/scope.py,sha256=bzUEiWDOVdbj7dXOwGOlzsQ_-Xu0j9NR5TalQB-8TS8,8
193
193
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
194
194
  verifiers/v1/utils/trace_store.py,sha256=RsCDonGR-bs-tvEstcppiJm3jFmAdIiG83fA5KtCbAw,2801
195
195
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
196
- verifiers-0.3.2.dev155.dist-info/METADATA,sha256=_8FL9NqqyE2TxMxg99xcayYl67d8IEYE_vwHoYGI6kY,4161
197
- verifiers-0.3.2.dev155.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
198
- verifiers-0.3.2.dev155.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
199
- verifiers-0.3.2.dev155.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
- verifiers-0.3.2.dev155.dist-info/RECORD,,
196
+ verifiers-0.3.2.dev156.dist-info/METADATA,sha256=siLTRPsZNEdrKeTcWP3JzhmhLsMG3Qmb7PgN4Cv-J34,4161
197
+ verifiers-0.3.2.dev156.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
198
+ verifiers-0.3.2.dev156.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
199
+ verifiers-0.3.2.dev156.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
+ verifiers-0.3.2.dev156.dist-info/RECORD,,