Skip to content

Add portable snapshot endpoint - #640

Draft
terjekv wants to merge 7 commits into
masterfrom
feature/portable-snapshot
Draft

terjekv wants to merge 7 commits into
masterfrom
feature/portable-snapshot

Conversation

@terjekv

@terjekv terjekv commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a synchronous, versioned portable snapshot endpoint with archive and single-file JSON representations
  • export domain data from a consistent PostgreSQL transaction, with optional legacy permissions and deterministic checksums
  • preserve wildcard HINFO, LOC, and SSHFP records that cannot be imported automatically as explicit deferred records
  • split oversized TXT values into valid DNS character strings and tighten HTTP content negotiation and digest headers
  • centralize snapshot authorization and refactor DNS translation, manifest construction, archive writing, hashing, and temporary-file cleanup into focused components

Impact

Operators can create implementation-independent backups for transfer and recovery workflows without holding a database transaction open during download. Existing users, tokens, audit history, and authorization memberships remain excluded. Snapshot access is available to members of the dedicated configured group, MREG administrators, and MREG superusers.

The JSON representation delivers a pure, single-file, dependency-ordered JSON import document, while records that cannot be imported automatically are surfaced separately for manual handling.

Validation

  • complete Django suite with PostgreSQL connection pooling enabled: 999 tests, 997 passed, 2 skipped
  • local fresh line coverage: 97.885%
  • Coveralls coverage: 97.859%, up 0.09 percentage points from master at 97.767%
  • snapshot module line coverage: 98.390%
  • uv run ruff check mreg/api/v1/tests/test_snapshot.py
  • uv run ruff format --check mreg/api/v1/tests/test_snapshot.py
  • git diff --check

@coveralls

coveralls commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 97.818% (+0.05%) from 97.765% — feature/portable-snapshot into master

@terjekv
terjekv force-pushed the feature/portable-snapshot branch from a2eea3a to 0526154 Compare July 28, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants