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.
- {parad-2.2.0 → parad-2.2.2}/PKG-INFO +1 -1
- {parad-2.2.0 → parad-2.2.2}/parad/__init__.py +3 -3
- {parad-2.2.0 → parad-2.2.2}/parad/connection.py +14 -2
- {parad-2.2.0 → parad-2.2.2}/parad.egg-info/PKG-INFO +1 -1
- {parad-2.2.0 → parad-2.2.2}/pyproject.toml +1 -1
- {parad-2.2.0 → parad-2.2.2}/README.md +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/__main__.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/cli.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/__init__.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/auth.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/backups.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/config_cmd.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/connect.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/databases.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/init.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/projects.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/query.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/shell.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/status.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/sync.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/versions.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/commands/watch.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/config.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/crypto.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/engine.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/gateway.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/state.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/types.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad/watcher.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad.egg-info/SOURCES.txt +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad.egg-info/dependency_links.txt +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad.egg-info/entry_points.txt +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad.egg-info/requires.txt +0 -0
- {parad-2.2.0 → parad-2.2.2}/parad.egg-info/top_level.txt +0 -0
- {parad-2.2.0 → parad-2.2.2}/setup.cfg +0 -0
- {parad-2.2.0 → parad-2.2.2}/tests/test_connection.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/tests/test_crypto.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/tests/test_engine.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/tests/test_state.py +0 -0
- {parad-2.2.0 → parad-2.2.2}/tests/test_workflow.py +0 -0
|
@@ -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.
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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
|