parad 2.2.0__tar.gz → 2.2.2__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.
Files changed (40) hide show
  1. {parad-2.2.0 → parad-2.2.2}/PKG-INFO +1 -1
  2. {parad-2.2.0 → parad-2.2.2}/parad/__init__.py +3 -3
  3. {parad-2.2.0 → parad-2.2.2}/parad/connection.py +14 -2
  4. {parad-2.2.0 → parad-2.2.2}/parad.egg-info/PKG-INFO +1 -1
  5. {parad-2.2.0 → parad-2.2.2}/pyproject.toml +1 -1
  6. {parad-2.2.0 → parad-2.2.2}/README.md +0 -0
  7. {parad-2.2.0 → parad-2.2.2}/parad/__main__.py +0 -0
  8. {parad-2.2.0 → parad-2.2.2}/parad/cli.py +0 -0
  9. {parad-2.2.0 → parad-2.2.2}/parad/commands/__init__.py +0 -0
  10. {parad-2.2.0 → parad-2.2.2}/parad/commands/auth.py +0 -0
  11. {parad-2.2.0 → parad-2.2.2}/parad/commands/backups.py +0 -0
  12. {parad-2.2.0 → parad-2.2.2}/parad/commands/config_cmd.py +0 -0
  13. {parad-2.2.0 → parad-2.2.2}/parad/commands/connect.py +0 -0
  14. {parad-2.2.0 → parad-2.2.2}/parad/commands/databases.py +0 -0
  15. {parad-2.2.0 → parad-2.2.2}/parad/commands/init.py +0 -0
  16. {parad-2.2.0 → parad-2.2.2}/parad/commands/projects.py +0 -0
  17. {parad-2.2.0 → parad-2.2.2}/parad/commands/query.py +0 -0
  18. {parad-2.2.0 → parad-2.2.2}/parad/commands/shell.py +0 -0
  19. {parad-2.2.0 → parad-2.2.2}/parad/commands/status.py +0 -0
  20. {parad-2.2.0 → parad-2.2.2}/parad/commands/sync.py +0 -0
  21. {parad-2.2.0 → parad-2.2.2}/parad/commands/versions.py +0 -0
  22. {parad-2.2.0 → parad-2.2.2}/parad/commands/watch.py +0 -0
  23. {parad-2.2.0 → parad-2.2.2}/parad/config.py +0 -0
  24. {parad-2.2.0 → parad-2.2.2}/parad/crypto.py +0 -0
  25. {parad-2.2.0 → parad-2.2.2}/parad/engine.py +0 -0
  26. {parad-2.2.0 → parad-2.2.2}/parad/gateway.py +0 -0
  27. {parad-2.2.0 → parad-2.2.2}/parad/state.py +0 -0
  28. {parad-2.2.0 → parad-2.2.2}/parad/types.py +0 -0
  29. {parad-2.2.0 → parad-2.2.2}/parad/watcher.py +0 -0
  30. {parad-2.2.0 → parad-2.2.2}/parad.egg-info/SOURCES.txt +0 -0
  31. {parad-2.2.0 → parad-2.2.2}/parad.egg-info/dependency_links.txt +0 -0
  32. {parad-2.2.0 → parad-2.2.2}/parad.egg-info/entry_points.txt +0 -0
  33. {parad-2.2.0 → parad-2.2.2}/parad.egg-info/requires.txt +0 -0
  34. {parad-2.2.0 → parad-2.2.2}/parad.egg-info/top_level.txt +0 -0
  35. {parad-2.2.0 → parad-2.2.2}/setup.cfg +0 -0
  36. {parad-2.2.0 → parad-2.2.2}/tests/test_connection.py +0 -0
  37. {parad-2.2.0 → parad-2.2.2}/tests/test_crypto.py +0 -0
  38. {parad-2.2.0 → parad-2.2.2}/tests/test_engine.py +0 -0
  39. {parad-2.2.0 → parad-2.2.2}/tests/test_state.py +0 -0
  40. {parad-2.2.0 → parad-2.2.2}/tests/test_workflow.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: parad
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Drop-in encrypted database with cloud sync — connect() and go
5
5
  Author-email: nexuss0781 <nexuss0781@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/nexuss0781/Paradox-DB
@@ -1,8 +1,8 @@
1
1
  """parad — Encrypted local-first SQLite with cloud sync."""
2
2
 
3
- from parad.connection import connect, ParadConnection, parse_url, generate_url, db_state_key
3
+ from parad.connection import connect, ParadConnection, parse_url, generate_url, db_state_key, generate_passphrase
4
4
  from parad.engine import Engine
5
5
  from parad.config import load_config, get_passphrase, get_connection_url
6
6
 
7
- __version__ = "2.2.0"
8
- __all__ = ["connect", "ParadConnection", "parse_url", "generate_url", "db_state_key", "Engine", "load_config"]
7
+ __version__ = "2.2.2"
8
+ __all__ = ["connect", "ParadConnection", "parse_url", "generate_url", "db_state_key", "generate_passphrase", "Engine", "load_config"]
@@ -665,6 +665,11 @@ class ParadConnection:
665
665
  # ── Convenience factory ─────────────────────────────────────────
666
666
 
667
667
 
668
+ def generate_passphrase() -> str:
669
+ """Generate a cryptographically random 256-bit database passphrase."""
670
+ return secrets.token_urlsafe(32)
671
+
672
+
668
673
  def _announce_passphrase(passphrase: str, db_path: str) -> None:
669
674
  """Print a newly generated passphrase once and persist it in ~/.paradox/.env."""
670
675
  msg = (
@@ -703,6 +708,7 @@ def connect(
703
708
  pull_on_startup: bool = False,
704
709
  storage_channel: str | None = None,
705
710
  log_channel: str | None = None,
711
+ allow_legacy_default: bool = False,
706
712
  ) -> ParadConnection:
707
713
  """Connect to a Parad database.
708
714
 
@@ -776,15 +782,21 @@ def connect(
776
782
  # on other machines. Never auto-generate for an existing DB file —
777
783
  # that keeps legacy 'default'-encrypted databases readable.
778
784
  if not os.path.exists(resolved_path):
779
- resolved_passphrase = secrets.token_urlsafe(32)
785
+ resolved_passphrase = generate_passphrase()
780
786
  try:
781
787
  set_config_value("encryption.passphrase", resolved_passphrase)
782
788
  except Exception:
783
789
  pass
784
790
  _announce_passphrase(resolved_passphrase, resolved_path)
785
791
  cfg = load_config()
786
- else:
792
+ elif allow_legacy_default:
787
793
  resolved_passphrase = "default"
794
+ else:
795
+ raise ValueError(
796
+ f"No passphrase configured for existing database '{resolved_path}'. "
797
+ "Set PARADOX_PASSPHRASE or passphrase explicitly. "
798
+ "Use allow_legacy_default=True only for legacy databases encrypted with 'default'."
799
+ )
788
800
 
789
801
  # ── resolve gateway_url ─────────────────────────────────────
790
802
  resolved_gateway = gateway_url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: parad
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Drop-in encrypted database with cloud sync — connect() and go
5
5
  Author-email: nexuss0781 <nexuss0781@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/nexuss0781/Paradox-DB
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "parad"
7
- version = "2.2.0"
7
+ version = "2.2.2"
8
8
  description = "Drop-in encrypted database with cloud sync — connect() and go"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
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