sciveo 0.1.65__tar.gz → 0.1.67__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.
- {sciveo-0.1.65 → sciveo-0.1.67}/PKG-INFO +1 -1
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/api/server.py +2 -2
- sciveo-0.1.67/sciveo/tools/totp.py +80 -0
- sciveo-0.1.67/sciveo/version.py +2 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo.egg-info/PKG-INFO +1 -1
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo.egg-info/SOURCES.txt +3 -1
- sciveo-0.1.67/test/test_totp.py +41 -0
- sciveo-0.1.65/sciveo/version.py +0 -2
- {sciveo-0.1.65 → sciveo-0.1.67}/README.md +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/api/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/api/predictors.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/cli.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/common/model.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/content/project.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/capture/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/capture/cam.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/capture/nvr.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/encoders/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/encoders/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/encoders/normalizer.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/nlp/search.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/time_series/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/time_series/dataset.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/time_series/predictor.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/time_series/trainer.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/ml/time_series/window_generator.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/job_daemon.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/layouts/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/layouts/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/pipeline.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/postprocessors/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/postprocessors/default.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/audio/audio.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/aws.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/file/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/file/archive.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/album.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/album_in_image.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/depth_esimation.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/embeddings.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/filters.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/generators.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/histogram.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/mask.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/object_detection.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/resize.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/segmentation.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/image/watermark.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/media_info.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/nlp/address.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/qr.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/dataset.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/time_series/predictor.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/time_series/trainer.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/tpu_base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/video/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/video/generators.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/video/motion_detection.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/video/resize.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/video/video_album.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/video/video_frames.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/video/video_resample.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/queues.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/server.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/web/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/web/server.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/tools/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/tools/video_interactive.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/dataset/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/dataset/object_detection.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/evaluation/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/evaluation/markdown.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/evaluation/object_detection.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/images/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/images/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/images/description.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/images/embeddings.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/images/object_detection.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/images/tools.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/images/transformers.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/nlp/embeddings.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/nlp/tokenizers/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/nlp/tokenizers/bpe.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/video/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/ml/video/description.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/monitoring/monitor.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/monitoring/watchdog/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/monitoring/watchdog/base.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/monitoring/watchdog/process.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/network/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/network/camera.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/network/sniffer.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/network/tools.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/array.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/aws/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/aws/priority_queue.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/aws/s3.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/common.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/complexity.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/compress.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/configuration.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/crypto.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/daemon.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/draw/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/draw/contours.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/formating.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/hardware.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/http.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/logger.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/os.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/queue.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/random.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/remote.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/simple_counter.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/synchronized.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/tools/timers.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/web/__init__.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo/web/common.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo.egg-info/entry_points.txt +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/setup.cfg +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/setup.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_complexity.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_compress.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_configuration.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_crypto.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_eval_markdown.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_ml_datasets.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_monitoring.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_runner.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_sampling.py +0 -0
- {sciveo-0.1.65 → sciveo-0.1.67}/test/test_tokenizers.py +0 -0
|
@@ -65,7 +65,7 @@ def predict_endpoint():
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
class WebServerDaemon(DaemonBase):
|
|
68
|
-
def __init__(self, host="
|
|
68
|
+
def __init__(self, host="127.0.0.1", port=8901, predictors=None):
|
|
69
69
|
super().__init__()
|
|
70
70
|
self.host = host
|
|
71
71
|
self.port = port
|
|
@@ -77,4 +77,4 @@ class WebServerDaemon(DaemonBase):
|
|
|
77
77
|
info("run", [self.host, self.port])
|
|
78
78
|
Predictors.get().print()
|
|
79
79
|
|
|
80
|
-
serve(app, host=self.host, port=self.port)
|
|
80
|
+
serve(app, host=self.host, port=self.port, threads=1, connection_limit=10)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Pavlin Georgiev, Softel Labs
|
|
3
|
+
#
|
|
4
|
+
# This is a proprietary file and may not be copied,
|
|
5
|
+
# distributed, or modified without express permission
|
|
6
|
+
# from the owner. For licensing inquiries, please
|
|
7
|
+
# contact pavlin@softel.bg.
|
|
8
|
+
#
|
|
9
|
+
# 2025
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
import os
|
|
14
|
+
import hmac
|
|
15
|
+
import base64
|
|
16
|
+
import struct
|
|
17
|
+
import hashlib
|
|
18
|
+
import time
|
|
19
|
+
|
|
20
|
+
from sciveo.tools.logger import *
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class AuthTOTP:
|
|
24
|
+
def __init__(self, secret: str, interval: int = 30, digits: int = 6, algo=hashlib.sha1):
|
|
25
|
+
"""
|
|
26
|
+
secret: the private key
|
|
27
|
+
interval: time step in seconds (default 30)
|
|
28
|
+
digits: number of digits in code (default 6)
|
|
29
|
+
algo: hash function (default SHA1, per RFC 6238)
|
|
30
|
+
"""
|
|
31
|
+
self.secret = secret
|
|
32
|
+
self.interval = interval
|
|
33
|
+
self.digits = digits
|
|
34
|
+
self.algo = algo
|
|
35
|
+
|
|
36
|
+
@staticmethod
|
|
37
|
+
def new_private_key(length: int = 20) -> str:
|
|
38
|
+
"""
|
|
39
|
+
Generate a new Base32 secret key.
|
|
40
|
+
"""
|
|
41
|
+
raw = os.urandom(length)
|
|
42
|
+
return base64.b32encode(raw).decode("utf-8").replace("=", "")
|
|
43
|
+
|
|
44
|
+
def _generate_otp(self, for_time: int) -> int:
|
|
45
|
+
"""
|
|
46
|
+
Internal: generate OTP for given time counter.
|
|
47
|
+
"""
|
|
48
|
+
pad_len = (8 - len(self.secret) % 8) % 8
|
|
49
|
+
secret_padded = self.secret + ("=" * pad_len)
|
|
50
|
+
key = base64.b32decode(secret_padded, casefold=True)
|
|
51
|
+
|
|
52
|
+
counter = struct.pack(">Q", for_time)
|
|
53
|
+
hmac_digest = hmac.new(key, counter, self.algo).digest()
|
|
54
|
+
|
|
55
|
+
offset = hmac_digest[-1] & 0x0F
|
|
56
|
+
code = struct.unpack(">I", hmac_digest[offset:offset+4])[0] & 0x7FFFFFFF
|
|
57
|
+
return code % (10 ** self.digits)
|
|
58
|
+
|
|
59
|
+
def next_token(self, for_time: int = None) -> str:
|
|
60
|
+
"""
|
|
61
|
+
Return the TOTP token for current (or given) time.
|
|
62
|
+
"""
|
|
63
|
+
if for_time is None:
|
|
64
|
+
for_time = int(time.time())
|
|
65
|
+
counter = for_time // self.interval
|
|
66
|
+
return str(self._generate_otp(counter)).zfill(self.digits)
|
|
67
|
+
|
|
68
|
+
def verify_token(self, token: str, for_time: int = None, window: int = 1) -> bool:
|
|
69
|
+
"""
|
|
70
|
+
Verify a token, allowing ±window intervals (to handle clock skew).
|
|
71
|
+
"""
|
|
72
|
+
if for_time is None:
|
|
73
|
+
for_time = int(time.time())
|
|
74
|
+
counter = for_time // self.interval
|
|
75
|
+
for delta in range(-window, window + 1):
|
|
76
|
+
candidate = str(self._generate_otp(counter + delta)).zfill(self.digits)
|
|
77
|
+
# debug("verify", token, "delta", delta, "candidate", candidate)
|
|
78
|
+
if hmac.compare_digest(candidate, token):
|
|
79
|
+
return True
|
|
80
|
+
return False
|
|
@@ -143,6 +143,7 @@ sciveo/tools/remote.py
|
|
|
143
143
|
sciveo/tools/simple_counter.py
|
|
144
144
|
sciveo/tools/synchronized.py
|
|
145
145
|
sciveo/tools/timers.py
|
|
146
|
+
sciveo/tools/totp.py
|
|
146
147
|
sciveo/tools/aws/__init__.py
|
|
147
148
|
sciveo/tools/aws/priority_queue.py
|
|
148
149
|
sciveo/tools/aws/s3.py
|
|
@@ -159,4 +160,5 @@ test/test_ml_datasets.py
|
|
|
159
160
|
test/test_monitoring.py
|
|
160
161
|
test/test_runner.py
|
|
161
162
|
test/test_sampling.py
|
|
162
|
-
test/test_tokenizers.py
|
|
163
|
+
test/test_tokenizers.py
|
|
164
|
+
test/test_totp.py
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Pavlin Georgiev, Softel Labs
|
|
3
|
+
#
|
|
4
|
+
# This is a proprietary file and may not be copied,
|
|
5
|
+
# distributed, or modified without express permission
|
|
6
|
+
# from the owner. For licensing inquiries, please
|
|
7
|
+
# contact pavlin@softel.bg.
|
|
8
|
+
#
|
|
9
|
+
# 2025
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
import time
|
|
13
|
+
import unittest
|
|
14
|
+
|
|
15
|
+
from sciveo.tools.totp import *
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class TestTOTP(unittest.TestCase):
|
|
19
|
+
@classmethod
|
|
20
|
+
def setUpClass(cls):
|
|
21
|
+
cls.secret = AuthTOTP.new_private_key(length=32)
|
|
22
|
+
cls.auth = AuthTOTP(cls.secret, digits=8)
|
|
23
|
+
|
|
24
|
+
def test_pass(self):
|
|
25
|
+
token = self.auth.next_token()
|
|
26
|
+
self.assertTrue(self.auth.verify_token(token=token))
|
|
27
|
+
|
|
28
|
+
def test_expiry_time_fail(self):
|
|
29
|
+
auth = AuthTOTP(self.secret, interval=3, digits=8)
|
|
30
|
+
token = auth.next_token()
|
|
31
|
+
self.assertTrue(auth.verify_token(token=token))
|
|
32
|
+
time.sleep(2)
|
|
33
|
+
self.assertTrue(auth.verify_token(token=token))
|
|
34
|
+
time.sleep(2)
|
|
35
|
+
self.assertTrue(auth.verify_token(token=token))
|
|
36
|
+
time.sleep(2)
|
|
37
|
+
self.assertFalse(auth.verify_token(token=token))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
if __name__ == '__main__':
|
|
41
|
+
unittest.main()
|
sciveo-0.1.65/sciveo/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/time_series/__init__.py
RENAMED
|
File without changes
|
{sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/time_series/predictor.py
RENAMED
|
File without changes
|
{sciveo-0.1.65 → sciveo-0.1.67}/sciveo/media/pipelines/processors/sci/time_series/trainer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|