layercall 1.2.1__tar.gz → 1.2.4__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.1 → layercall-1.2.4}/PKG-INFO +1 -1
- {layercall-1.2.1 → layercall-1.2.4}/layercall/__init__.py +18 -2
- {layercall-1.2.1 → layercall-1.2.4}/layercall.egg-info/PKG-INFO +1 -1
- {layercall-1.2.1 → layercall-1.2.4}/pyproject.toml +1 -1
- {layercall-1.2.1 → layercall-1.2.4}/README.md +0 -0
- {layercall-1.2.1 → layercall-1.2.4}/layercall.egg-info/SOURCES.txt +0 -0
- {layercall-1.2.1 → layercall-1.2.4}/layercall.egg-info/dependency_links.txt +0 -0
- {layercall-1.2.1 → layercall-1.2.4}/layercall.egg-info/top_level.txt +0 -0
- {layercall-1.2.1 → layercall-1.2.4}/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",
|
|
@@ -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.4"
|
|
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
|