sfq 0.0.39__py3-none-any.whl → 0.0.41__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.
sfq/__init__.py
CHANGED
@@ -45,7 +45,7 @@ __all__ = [
|
|
45
45
|
"__version__",
|
46
46
|
]
|
47
47
|
|
48
|
-
__version__ = "0.0.
|
48
|
+
__version__ = "0.0.41"
|
49
49
|
"""
|
50
50
|
### `__version__`
|
51
51
|
|
@@ -56,6 +56,44 @@ __version__ = "0.0.39"
|
|
56
56
|
"""
|
57
57
|
logger = get_logger("sfq")
|
58
58
|
|
59
|
+
class _SFTokenAuth:
|
60
|
+
def __init__(
|
61
|
+
self,
|
62
|
+
instance_url: str,
|
63
|
+
access_token: str,
|
64
|
+
api_version: str = "v64.0",
|
65
|
+
token_endpoint: str = "/services/oauth2/token",
|
66
|
+
user_agent: str = "sfq/0.0.41",
|
67
|
+
sforce_client: str = "_auto",
|
68
|
+
proxy: str = "_auto",
|
69
|
+
) -> None:
|
70
|
+
from . import SFAuth
|
71
|
+
|
72
|
+
self._sf_auth = SFAuth(
|
73
|
+
instance_url=instance_url,
|
74
|
+
client_id="_",
|
75
|
+
refresh_token="_",
|
76
|
+
client_secret=str("_").strip(),
|
77
|
+
api_version=api_version,
|
78
|
+
token_endpoint=token_endpoint,
|
79
|
+
access_token=access_token,
|
80
|
+
token_expiration_time=-1.0,
|
81
|
+
user_agent=user_agent,
|
82
|
+
sforce_client=sforce_client,
|
83
|
+
proxy=proxy,
|
84
|
+
)
|
85
|
+
|
86
|
+
self._sf_auth._auth_manager.access_token = access_token
|
87
|
+
self._sf_auth._auth_manager.token_expiration_time = -1.0
|
88
|
+
|
89
|
+
def __getattr__(self, name: str) -> Any:
|
90
|
+
return getattr(self._sf_auth, name)
|
91
|
+
|
92
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
93
|
+
if name == "_sf_auth":
|
94
|
+
super().__setattr__(name, value)
|
95
|
+
else:
|
96
|
+
setattr(self._sf_auth, name, value)
|
59
97
|
|
60
98
|
class SFAuth:
|
61
99
|
def __init__(
|
@@ -69,7 +107,7 @@ class SFAuth:
|
|
69
107
|
access_token: Optional[str] = None,
|
70
108
|
token_expiration_time: Optional[float] = None,
|
71
109
|
token_lifetime: int = 15 * 60,
|
72
|
-
user_agent: str = "sfq/0.0.
|
110
|
+
user_agent: str = "sfq/0.0.41",
|
73
111
|
sforce_client: str = "_auto",
|
74
112
|
proxy: str = "_auto",
|
75
113
|
) -> None:
|
@@ -134,7 +172,7 @@ class SFAuth:
|
|
134
172
|
self._debug_cleanup = DebugCleanup(sf_auth=self)
|
135
173
|
|
136
174
|
# Store version information
|
137
|
-
self.__version__ = "0.0.
|
175
|
+
self.__version__ = "0.0.41"
|
138
176
|
"""
|
139
177
|
### `__version__`
|
140
178
|
|
sfq/auth.py
CHANGED
@@ -245,6 +245,8 @@ class AuthManager:
|
|
245
245
|
|
246
246
|
:return: True if token is expired or missing, False otherwise
|
247
247
|
"""
|
248
|
+
if self.token_expiration_time == -1.0:
|
249
|
+
return False # Token never expires
|
248
250
|
try:
|
249
251
|
return time.time() >= float(self.token_expiration_time)
|
250
252
|
except (TypeError, ValueError):
|
sfq/http_client.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
sfq/__init__.py,sha256=
|
1
|
+
sfq/__init__.py,sha256=QpCz5EKWG9bp2BQOgHgIYnLKz1lh6AgqUupji4lv0s4,21781
|
2
2
|
sfq/_cometd.py,sha256=QqdSGsms9uFm7vgmxgau7m2UuLHztK1yjN-BNjeo8xM,10381
|
3
|
-
sfq/auth.py,sha256=
|
3
|
+
sfq/auth.py,sha256=MPlaH4lHz9uJDdPGcJ_t4Gsp8pWx9crCfMr7FwPD7U4,14079
|
4
4
|
sfq/crud.py,sha256=fj4wPMt0DcrMKbMWQ9AUMsUNUWicsY93LP_3Q7lhmDU,20300
|
5
5
|
sfq/debug_cleanup.py,sha256=e2_Hpigy3F7XsATOUXo8DZNmuEIL9SDD0tBlZIZeQLc,2638
|
6
6
|
sfq/exceptions.py,sha256=Ys41dV8nAeP8Cl9xr4QuL7itQxjxh5KDCse6hJNl6AY,1028
|
7
|
-
sfq/http_client.py,sha256=
|
7
|
+
sfq/http_client.py,sha256=1n6OrH3JJnbbocBKsRLtNKfy9ho8S81V_686c197idk,18642
|
8
8
|
sfq/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
sfq/query.py,sha256=AoagL8PMKUcpbPPTcHJPKhmUdDDPa0La4JLC0TUN_Yc,14586
|
10
10
|
sfq/soap.py,sha256=FM4msP9ErrgLFaNOQy_kYVde8QFkT4yQu9TfMiZG0VA,7006
|
11
11
|
sfq/timeout_detector.py,sha256=Y8zO0h2dxMchNxhh5ns3GBfRv07EzKzUcr-hqZc_2-s,5503
|
12
12
|
sfq/utils.py,sha256=d1vhpTa5innn5w23dnb_9el_giOXRCuRIaP6XUnaLfc,12387
|
13
|
-
sfq-0.0.
|
14
|
-
sfq-0.0.
|
15
|
-
sfq-0.0.
|
13
|
+
sfq-0.0.41.dist-info/METADATA,sha256=POv4SXU_mLUpqxKuzJPM4TNHAWqKYcpxw6ZiwJZ3XpE,6899
|
14
|
+
sfq-0.0.41.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
sfq-0.0.41.dist-info/RECORD,,
|
File without changes
|