layercall 1.2.0__tar.gz → 1.2.2__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.
- {layercall-1.2.0 → layercall-1.2.2}/PKG-INFO +1 -1
- {layercall-1.2.0 → layercall-1.2.2}/layercall/__init__.py +23 -5
- {layercall-1.2.0 → layercall-1.2.2}/layercall.egg-info/PKG-INFO +1 -1
- {layercall-1.2.0 → layercall-1.2.2}/pyproject.toml +1 -1
- {layercall-1.2.0 → layercall-1.2.2}/README.md +0 -0
- {layercall-1.2.0 → layercall-1.2.2}/layercall.egg-info/SOURCES.txt +0 -0
- {layercall-1.2.0 → layercall-1.2.2}/layercall.egg-info/dependency_links.txt +0 -0
- {layercall-1.2.0 → layercall-1.2.2}/layercall.egg-info/top_level.txt +0 -0
- {layercall-1.2.0 → layercall-1.2.2}/setup.cfg +0 -0
|
@@ -32,7 +32,7 @@ import urllib.parse
|
|
|
32
32
|
import urllib.request
|
|
33
33
|
from typing import Any, Literal, Mapping, Sequence
|
|
34
34
|
|
|
35
|
-
__version__ = "1.
|
|
35
|
+
__version__ = "1.2.2"
|
|
36
36
|
__all__ = ["LayerCall", "LayerCallError"]
|
|
37
37
|
|
|
38
38
|
Verdict = Literal["allow", "review", "block"]
|
|
@@ -105,7 +105,23 @@ class LayerCall:
|
|
|
105
105
|
*,
|
|
106
106
|
query: Mapping[str, Any] | None = None,
|
|
107
107
|
body: Mapping[str, Any] | None = None,
|
|
108
|
+
method: str | None = None,
|
|
108
109
|
) -> dict[str, Any]:
|
|
110
|
+
"""Send one request.
|
|
111
|
+
|
|
112
|
+
`method` exists because six public methods already passed it and this
|
|
113
|
+
signature did not accept it: score_device, verify_agent,
|
|
114
|
+
authorize_agent, set_agent_policy, report_outcome and report every one
|
|
115
|
+
raised TypeError before opening a socket. That is nearly half the
|
|
116
|
+
surface of a package published to PyPI, including the copy-paste
|
|
117
|
+
example in the agent docs.
|
|
118
|
+
|
|
119
|
+
It survived because the SDK's own smoke test exercised the working
|
|
120
|
+
seven, and the one method the docs headline with — score_user — is in
|
|
121
|
+
that set. Inferring the verb from body-presence was also not enough on
|
|
122
|
+
its own: set_agent_policy needs PUT, which no amount of body inspection
|
|
123
|
+
can produce.
|
|
124
|
+
"""
|
|
109
125
|
url = self._base + path
|
|
110
126
|
if query:
|
|
111
127
|
clean = {k: v for k, v in query.items() if v is not None}
|
|
@@ -119,7 +135,7 @@ class LayerCall:
|
|
|
119
135
|
req = urllib.request.Request(
|
|
120
136
|
url,
|
|
121
137
|
data=data,
|
|
122
|
-
method="POST" if data is not None else "GET",
|
|
138
|
+
method=method or ("POST" if data is not None else "GET"),
|
|
123
139
|
headers={
|
|
124
140
|
"X-Api-Key": self._key,
|
|
125
141
|
"Content-Type": "application/json",
|
|
@@ -316,9 +332,11 @@ class LayerCall:
|
|
|
316
332
|
) -> dict[str, Any]:
|
|
317
333
|
"""Score a whole signup, in one call.
|
|
318
334
|
|
|
319
|
-
Returns
|
|
320
|
-
|
|
321
|
-
|
|
335
|
+
Returns `summary` — one sentence describing the decision, for a Slack
|
|
336
|
+
alert or a review ticket — plus risk_score and verdict, `actor` (what
|
|
337
|
+
kind of thing this is, with `proven` true only for a verified
|
|
338
|
+
signature) and `linkage` (patterns across values that no single value
|
|
339
|
+
can show).
|
|
322
340
|
|
|
323
341
|
Pass `agent={"method", "url", "headers"}` — the signed request an AI
|
|
324
342
|
agent made to YOU — to get an authorization decision in the same call.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "layercall"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.2"
|
|
8
8
|
description = "Official LayerCall client — score an IP, email, phone, domain or a whole signup for fraud in one call. Zero dependencies."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|