0fc6c68a99
Issue persistent signed anonymous IDs and accept cookie/token-bound events. Resolve verified email, phone, OAuth, and namespaced third-party IDs into transactionally merged master identities with historical event aliases. Protect shared-device account switching, tenant isolation, and event retries. Store sparse canonical profiles as PostgreSQL JSONB or local SQLite JSON. Support an optional versioned Cassandra wide-column projection through a transactional outbox, retry worker, and immediate canonical read fallback. Document deployment settings and provide opt-in database integration tests. Validation: 43 local tests passed; 6 external database tests skipped. Ruff checks, formatting, and offline uv lock verification passed.
22 lines
744 B
Python
22 lines
744 B
Python
"""Create ignored local-development secrets without printing their values."""
|
|
|
|
import os
|
|
import secrets
|
|
from pathlib import Path
|
|
|
|
root = Path(__file__).resolve().parents[1]
|
|
text = (root / ".env.example").read_text()
|
|
text = text.replace(
|
|
"IDENTITY_SECRET=\n", "IDENTITY_SECRET=" + secrets.token_urlsafe(48) + "\n"
|
|
)
|
|
text = text.replace(
|
|
"SERVICE_TOKEN=\n", "SERVICE_TOKEN=" + secrets.token_urlsafe(48) + "\n"
|
|
)
|
|
try:
|
|
descriptor = os.open(root / ".env", os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
except FileExistsError:
|
|
raise SystemExit(".env already exists; left unchanged") from None
|
|
with os.fdopen(descriptor, "w") as output:
|
|
output.write(text)
|
|
print("Created local .env with generated secrets. Values are not printed.")
|