kinto 20.3.0__py3-none-any.whl → 20.5.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.
Potentially problematic release.
This version of kinto might be problematic. Click here for more details.
- kinto/plugins/admin/VERSION +1 -1
- kinto/plugins/admin/build/VERSION +1 -1
- kinto/plugins/admin/build/assets/{index-DwFOt8-z.js → index-CylsivYB.js} +14 -14
- kinto/plugins/admin/build/index.html +1 -1
- kinto/plugins/history/__init__.py +10 -0
- kinto/plugins/history/listener.py +9 -1
- kinto/plugins/prometheus.py +25 -1
- {kinto-20.3.0.dist-info → kinto-20.5.0.dist-info}/METADATA +1 -1
- {kinto-20.3.0.dist-info → kinto-20.5.0.dist-info}/RECORD +13 -13
- {kinto-20.3.0.dist-info → kinto-20.5.0.dist-info}/WHEEL +0 -0
- {kinto-20.3.0.dist-info → kinto-20.5.0.dist-info}/entry_points.txt +0 -0
- {kinto-20.3.0.dist-info → kinto-20.5.0.dist-info}/licenses/LICENSE +0 -0
- {kinto-20.3.0.dist-info → kinto-20.5.0.dist-info}/top_level.txt +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Kinto Administration</title>
|
|
7
7
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
8
8
|
<link rel="icon" type="image/x-icon" href="../images/favicon.png">
|
|
9
|
-
<script type="module" crossorigin src="/v1/admin/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/v1/admin/assets/index-CylsivYB.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/v1/admin/assets/index-Cs7JVwIg.css">
|
|
11
11
|
</head>
|
|
12
12
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from pyramid.settings import aslist
|
|
2
|
+
|
|
1
3
|
from kinto.authorization import PERMISSIONS_INHERITANCE_TREE
|
|
2
4
|
from kinto.core import metrics
|
|
3
5
|
from kinto.core.events import ResourceChanged
|
|
@@ -6,10 +8,18 @@ from .listener import on_resource_changed
|
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
def includeme(config):
|
|
11
|
+
settings = config.get_settings()
|
|
12
|
+
exposed_settings = {}
|
|
13
|
+
if (trim_history_max := int(settings.get("history.auto_trim_max_count", "-1"))) > 0:
|
|
14
|
+
exposed_settings["auto_trim_max_count"] = trim_history_max
|
|
15
|
+
if trim_user_ids := aslist(settings.get("history.auto_trim_user_ids", "")):
|
|
16
|
+
exposed_settings["auto_trim_user_ids"] = trim_user_ids
|
|
17
|
+
|
|
9
18
|
config.add_api_capability(
|
|
10
19
|
"history",
|
|
11
20
|
description="Track changes on data.",
|
|
12
21
|
url="http://kinto.readthedocs.io/en/latest/api/1.x/history.html",
|
|
22
|
+
**exposed_settings,
|
|
13
23
|
)
|
|
14
24
|
|
|
15
25
|
# Activate end-points.
|
|
@@ -162,7 +162,15 @@ def on_resource_changed(event):
|
|
|
162
162
|
filters=filters
|
|
163
163
|
+ [Filter("last_modified", trim_before_timestamp, COMPARISON.MAX)],
|
|
164
164
|
)
|
|
165
|
-
logger.
|
|
165
|
+
logger.info(f"Trimmed {len(deleted)} old history entries.")
|
|
166
|
+
else:
|
|
167
|
+
logger.info(
|
|
168
|
+
"No old history to trim for {user_id!r} on {resource_name!r} in {bucket_uri!r}."
|
|
169
|
+
)
|
|
170
|
+
else:
|
|
171
|
+
logger.info(
|
|
172
|
+
f"Trimming of old history entries is not enabled{f' for {user_id!r}.' if is_trim_enabled else '.'}"
|
|
173
|
+
)
|
|
166
174
|
|
|
167
175
|
# Without explicit permissions, the ACLs on the history entries will
|
|
168
176
|
# fully depend on the inherited permission tree (eg. bucket:read, bucket:write).
|
kinto/plugins/prometheus.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
1
4
|
import warnings
|
|
2
5
|
from time import perf_counter as time_now
|
|
3
6
|
|
|
@@ -15,15 +18,29 @@ except ImportError: # pragma: no cover
|
|
|
15
18
|
prometheus_module = None
|
|
16
19
|
|
|
17
20
|
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
|
|
18
23
|
_METRICS = {}
|
|
19
24
|
_REGISTRY = None
|
|
20
25
|
|
|
21
26
|
|
|
27
|
+
PROMETHEUS_MULTIPROC_DIR = os.getenv("PROMETHEUS_MULTIPROC_DIR")
|
|
28
|
+
|
|
29
|
+
|
|
22
30
|
def get_registry():
|
|
23
31
|
global _REGISTRY
|
|
24
32
|
|
|
25
33
|
if _REGISTRY is None:
|
|
26
|
-
|
|
34
|
+
if PROMETHEUS_MULTIPROC_DIR: # pragma: no cover
|
|
35
|
+
from prometheus_client import multiprocess
|
|
36
|
+
|
|
37
|
+
_reset_multiproc_folder_content()
|
|
38
|
+
# Ref: https://prometheus.github.io/client_python/multiprocess/
|
|
39
|
+
_REGISTRY = prometheus_module.CollectorRegistry()
|
|
40
|
+
multiprocess.MultiProcessCollector(_REGISTRY)
|
|
41
|
+
else:
|
|
42
|
+
_REGISTRY = prometheus_module.REGISTRY
|
|
43
|
+
logger.warning("Prometheus metrics will run in single-process mode only.")
|
|
27
44
|
return _REGISTRY
|
|
28
45
|
|
|
29
46
|
|
|
@@ -170,6 +187,12 @@ def metrics_view(request):
|
|
|
170
187
|
return resp
|
|
171
188
|
|
|
172
189
|
|
|
190
|
+
def _reset_multiproc_folder_content(): # pragma: no cover
|
|
191
|
+
if os.path.exists(PROMETHEUS_MULTIPROC_DIR):
|
|
192
|
+
shutil.rmtree(PROMETHEUS_MULTIPROC_DIR)
|
|
193
|
+
os.mkdir(PROMETHEUS_MULTIPROC_DIR)
|
|
194
|
+
|
|
195
|
+
|
|
173
196
|
def includeme(config):
|
|
174
197
|
if prometheus_module is None:
|
|
175
198
|
error_msg = (
|
|
@@ -190,6 +213,7 @@ def includeme(config):
|
|
|
190
213
|
# This is mainly useful in tests, where the plugin is included
|
|
191
214
|
# several times with different settings.
|
|
192
215
|
registry = get_registry()
|
|
216
|
+
|
|
193
217
|
for collector in _METRICS.values():
|
|
194
218
|
try:
|
|
195
219
|
registry.unregister(collector)
|
|
@@ -100,7 +100,7 @@ kinto/core/views/openapi.py,sha256=PgxplQX1D0zqzlvRxBvd5SzrNMJmsaLfDta_fh-Pr-A,9
|
|
|
100
100
|
kinto/core/views/version.py,sha256=-m5G_o0oHTpCgrtfFrHFve6Zqw_gs_szT0Bd8jnNmD4,1419
|
|
101
101
|
kinto/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
102
|
kinto/plugins/flush.py,sha256=poiBOLGXjml0xXHjqDMRdbXJSd6N3SL0mfeGK2vxeHY,812
|
|
103
|
-
kinto/plugins/prometheus.py,sha256=
|
|
103
|
+
kinto/plugins/prometheus.py,sha256=qSXsNf9TqqMUIzseFtjAkvqjjYxoItoiVvtzwH2FMqc,7000
|
|
104
104
|
kinto/plugins/statsd.py,sha256=-VasJZM1xkhTfFa6_0GgWwfPqKnYS2722bSMDLzZ3pI,2469
|
|
105
105
|
kinto/plugins/accounts/__init__.py,sha256=2DeIaXJmMqRca3xVHeJ6xBWmeXAfrCdyg3EvK5jzIak,3670
|
|
106
106
|
kinto/plugins/accounts/authentication.py,sha256=pCb269FquKGFd6DH8AVTjFnBFlfxcDEYVyxhQp5Y08o,2117
|
|
@@ -108,16 +108,16 @@ kinto/plugins/accounts/scripts.py,sha256=_LNkSpFprOMGHFKkRmmOqK31uoQW28yttPQztmf
|
|
|
108
108
|
kinto/plugins/accounts/utils.py,sha256=xGtWwBPKVEwkbJbtJ_SUFgTJpwQzreoJG9XY86HPj7M,358
|
|
109
109
|
kinto/plugins/accounts/views.py,sha256=NO2nZCS1v0dN390Hxhe55Bsi4IM-NH9jEStkiKH2AEU,5221
|
|
110
110
|
kinto/plugins/admin/README.md,sha256=3a9inoO2IHH5aST3xZp_km3ddupHZqadWrQjOQifBRk,105
|
|
111
|
-
kinto/plugins/admin/VERSION,sha256=
|
|
111
|
+
kinto/plugins/admin/VERSION,sha256=Tpnn6sIcK3GpcTnKzKaV2YyT-9fdJlBfBPUnGAmsS5Q,6
|
|
112
112
|
kinto/plugins/admin/__init__.py,sha256=057R3q_S4CFiUuqwMIFkyu4prMBnUVc1eo8OUAPeJBs,1327
|
|
113
113
|
kinto/plugins/admin/views.py,sha256=NHQncNB-32ytP03o-ZqisbYEoK7L2QcaK7RBuh0akwg,1338
|
|
114
|
-
kinto/plugins/admin/build/VERSION,sha256=
|
|
115
|
-
kinto/plugins/admin/build/index.html,sha256=
|
|
114
|
+
kinto/plugins/admin/build/VERSION,sha256=Tpnn6sIcK3GpcTnKzKaV2YyT-9fdJlBfBPUnGAmsS5Q,6
|
|
115
|
+
kinto/plugins/admin/build/index.html,sha256=cfQ_QjlmMyviojnRWQFxC6J5nWbyo8WIFvWtmcyzbeo,467
|
|
116
116
|
kinto/plugins/admin/build/assets/asn1-EdZsLKOL.js,sha256=rgO6M_APbSRME0yY3rddue8niU7UJmG2uWz4l1YeG6s,3981
|
|
117
117
|
kinto/plugins/admin/build/assets/clojure-BMjYHr_A.js,sha256=SYpgEG0C5dkSQgMtAejALIQFzA3S0InWn1XquOeNGiA,10815
|
|
118
118
|
kinto/plugins/admin/build/assets/css-BnMrqG3P.js,sha256=qj5HvX1-byua7Xs0K31qoFn_bncMhtZMsOr5e0A-yYo,27132
|
|
119
119
|
kinto/plugins/admin/build/assets/index-Cs7JVwIg.css,sha256=dtEppIrcuaKwSBl-bfgIKrBnbrr7qFL7PST9yLyPfc0,171774
|
|
120
|
-
kinto/plugins/admin/build/assets/index-
|
|
120
|
+
kinto/plugins/admin/build/assets/index-CylsivYB.js,sha256=4GW6MPa0FgDsBjUF2bjYB-8jjU5hjUXykaQMxjChFsM,2754443
|
|
121
121
|
kinto/plugins/admin/build/assets/javascript-qCveANmP.js,sha256=ol336oG7yGQxC9YIvojoE-dqx7wd3lLp0Ikn2rV4F5g,17080
|
|
122
122
|
kinto/plugins/admin/build/assets/logo-VBRiKSPX.png,sha256=4LXIgVZbcdbMun8bTlCFgnBik7uIkIRILVPFYrTUGgg,5578
|
|
123
123
|
kinto/plugins/admin/build/assets/mllike-CXdrOF99.js,sha256=C_YMaIP-ED2BN1nxtpuqRq-LXcC1AqrkksJHg4pdh4Q,4788
|
|
@@ -127,8 +127,8 @@ kinto/plugins/admin/build/assets/sql-D0XecflT.js,sha256=3hecsZJ0WlDxeFA_1lrl_ySI
|
|
|
127
127
|
kinto/plugins/admin/build/assets/ttcn-cfg-B9xdYoR4.js,sha256=jTZ_XHKOChJZEt-FzJbGHhvSYW42F1NccHg0lOY2FlM,4050
|
|
128
128
|
kinto/plugins/admin/public/help.html,sha256=1hol7z5Sv0Xn3mYyEfPQWFOsrR24htlKhmnGA3rH8fs,958
|
|
129
129
|
kinto/plugins/default_bucket/__init__.py,sha256=7TmBzFgW0gmYsetXr6Kqt9317XZ3PiB9gyCr-IBfmGg,7276
|
|
130
|
-
kinto/plugins/history/__init__.py,sha256=
|
|
131
|
-
kinto/plugins/history/listener.py,sha256=
|
|
130
|
+
kinto/plugins/history/__init__.py,sha256=ZuGoj9giDEefv2BNuaakgGEV87e85wvrkNgsmVAotIU,1443
|
|
131
|
+
kinto/plugins/history/listener.py,sha256=ABPRduTnkwH6oMzRyrQlF3AZoVt7brqwKVpA8ynY0Sw,7962
|
|
132
132
|
kinto/plugins/history/views.py,sha256=NoBP-S7epeH5TLZZbIqfBmwMA2KaWmxP7lqPAS11BTU,2293
|
|
133
133
|
kinto/plugins/openid/__init__.py,sha256=1Iv5SCa6vwEvoJkmGd45-TYm_mxz2okFj6u2VTNuVrk,4863
|
|
134
134
|
kinto/plugins/openid/utils.py,sha256=n3KGS-ogXR2sg6j4QtdPe_DtEsqD7AGVT2K7vhl8yE8,273
|
|
@@ -141,9 +141,9 @@ kinto/views/contribute.py,sha256=PJoIMLj9_IszSjgZkaCd_TUjekDgNqjpmVTmRN9ztaA,983
|
|
|
141
141
|
kinto/views/groups.py,sha256=jOq5fX0-4lwZE8k1q5HME2tU7x9052rtBPF7YqcJ-Qg,3181
|
|
142
142
|
kinto/views/permissions.py,sha256=F0_eKx201WyLonXJ5vLdGKa9RcFKjvAihrEEhU1JuLw,9069
|
|
143
143
|
kinto/views/records.py,sha256=lYfACW2L8qcQoyYBD5IX-fTPjFWmGp7GjHq_U4InlyE,5037
|
|
144
|
-
kinto-20.
|
|
145
|
-
kinto-20.
|
|
146
|
-
kinto-20.
|
|
147
|
-
kinto-20.
|
|
148
|
-
kinto-20.
|
|
149
|
-
kinto-20.
|
|
144
|
+
kinto-20.5.0.dist-info/licenses/LICENSE,sha256=oNEIMTuTJzppR5ZEyi86yvvtSagveMYXTYFn56zF0Uk,561
|
|
145
|
+
kinto-20.5.0.dist-info/METADATA,sha256=8hgp9glzPTbNRIWX6r2RXIy5xX_-V72uFHyjo27XlxQ,8731
|
|
146
|
+
kinto-20.5.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
147
|
+
kinto-20.5.0.dist-info/entry_points.txt,sha256=3KlqBWPKY81mrCe_oX0I5s1cRO7Q53nCLbnVr5P9LH4,85
|
|
148
|
+
kinto-20.5.0.dist-info/top_level.txt,sha256=EG_YmbZL6FAug9VwopG7JtF9SvH_r0DEnFp-3twPPys,6
|
|
149
|
+
kinto-20.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|