ratio1 3.4.82__py3-none-any.whl → 3.4.83__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.
ratio1/_ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "3.4.82"
1
+ __VER__ = "3.4.83"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
ratio1/ipfs/r1fs.py CHANGED
@@ -67,6 +67,7 @@ from io import BytesIO
67
67
  import ssl
68
68
  from requests.auth import HTTPBasicAuth
69
69
  import tempfile
70
+ import random
70
71
 
71
72
  from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
72
73
 
@@ -739,9 +740,10 @@ class R1FSEngine:
739
740
  def add_file(
740
741
  self,
741
742
  file_path: str,
743
+ nonce: int = None,
742
744
  secret: str = None,
743
745
  raise_on_error: bool = False,
744
- show_logs: bool = True
746
+ show_logs: bool = True,
745
747
  ) -> str:
746
748
  """
747
749
  Add a file to R1FS with default encryption. The secret parameter is mandatory,
@@ -797,7 +799,12 @@ class R1FSEngine:
797
799
  raise ValueError(f"File {file_path} is too large ({file_size} bytes). Maximum allowed size is 2 GB.")
798
800
 
799
801
  key = self._hash_secret(secret) # mandatory passphrase
800
- nonce = os.urandom(12) # recommended for GCM
802
+
803
+ if nonce is None:
804
+ nonce = os.urandom(12) # recommended for GCM
805
+ else:
806
+ nonce = random.Random(nonce).randbytes(12)
807
+
801
808
  original_basename = os.path.basename(file_path)
802
809
 
803
810
  # JSON metadata storing the original filename
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ratio1
3
- Version: 3.4.82
3
+ Version: 3.4.83
4
4
  Summary: `ratio1` or Ration1 SDK is the Python SDK required for client app development for the Ratio1 ecosystem
5
5
  Project-URL: Homepage, https://github.com/Ratio1/ratio1_sdk
6
6
  Project-URL: Bug Tracker, https://github.com/Ratio1/ratio1_sdk/issues
@@ -1,5 +1,5 @@
1
1
  ratio1/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
2
- ratio1/_ver.py,sha256=PohojJjl3IBbYbTACoP-pqohIaJFzWjWhiQUXacX6fo,331
2
+ ratio1/_ver.py,sha256=mac3IZOHBuyzh21Zy6zfHy5QePvpY5IixaEnXA0UTHA,331
3
3
  ratio1/base_decentra_object.py,sha256=iXvAAf6wPnGWzeeiRfwLojVoan-m1e_VsyPzjUQuENo,4492
4
4
  ratio1/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
5
5
  ratio1/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
@@ -68,7 +68,7 @@ ratio1/io_formatter/default/aixp1.py,sha256=MX0TeUR4APA-qN3vUC6uzcz8Pssz5lgrQWo7
68
68
  ratio1/io_formatter/default/default.py,sha256=gEy78cP2D5s0y8vQh4aHuxqz7D10gGfuiKF311QhrpE,494
69
69
  ratio1/ipfs/__init__.py,sha256=vXEDLUNUO6lOTMGa8iQ9Zf7ajIQq9GZuvYraAHt3meE,38
70
70
  ratio1/ipfs/ifps_keygen,sha256=PcoYuo4c89_C9FWrKq9K_28ruhKqnxNn1s3nLHiF1tc,879
71
- ratio1/ipfs/r1fs.py,sha256=vpX2b_FdgWgC_ArY8JgW-D_9TbhIPIsNN2YFLB39mJs,49327
71
+ ratio1/ipfs/r1fs.py,sha256=bslLpr0FTiqBsXPCoAqmH62MDki1lkvgW-oT7TvgFcQ,49458
72
72
  ratio1/ipfs/ipfs_setup/ipfs.service,sha256=isTJQsktPy4i1yaDA9AC1OKdlTYvsCCRRAVX-EmGqAs,248
73
73
  ratio1/ipfs/ipfs_setup/launch_service.sh,sha256=GWhZyNqtohLxJg8Q_c8YnNZduu1ddXDU-IFRRMaEyiY,141
74
74
  ratio1/ipfs/ipfs_setup/restart.sh,sha256=9xHMgkUoAMI25jeaoDVFbCa_LjojYm3ubljW58RatKE,22
@@ -103,8 +103,8 @@ ratio1/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,10
103
103
  ratio1/utils/config.py,sha256=Elfkl7W4aDMvB5WZLiYlPXrecBncgTxb4hcKhQedMzI,10111
104
104
  ratio1/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
105
105
  ratio1/utils/oracle_sync/oracle_tester.py,sha256=aJOPcZhtbw1XPqsFG4qYpfv2Taj5-qRXbwJzrPyeXDE,27465
106
- ratio1-3.4.82.dist-info/METADATA,sha256=Yez_0wqWcW8oBNZMwfAYOdJHQvCR4EBE1K8VBmdB2K8,12255
107
- ratio1-3.4.82.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
- ratio1-3.4.82.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
109
- ratio1-3.4.82.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
110
- ratio1-3.4.82.dist-info/RECORD,,
106
+ ratio1-3.4.83.dist-info/METADATA,sha256=T_tBgCVBwuaf2wcqDD2yVecRk-839qSrCwLC04R1T9s,12255
107
+ ratio1-3.4.83.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
+ ratio1-3.4.83.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
109
+ ratio1-3.4.83.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
110
+ ratio1-3.4.83.dist-info/RECORD,,