Store the certificate chain in archives without private keys
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
調査の方向性
Read morango/sync/archive.py and the related Certificate code in morango/models/certificates.py, especially save_certificate_chain. Then inspect tests/testapp/tests/sync/test_archive.py and the tree-field formula in spec §3.5. Done means Archive.write_certificates writes the chain to the archive alias with explicit tree fields, no private keys or default-DB queries, while preserving source objects and values; this is blocked by #378.
索引モデルが issue の本文から書いたものです。
説明
Overview
An archive stores the exporter certificate chain and the archive certificate, with no private keys. This issue is part of milestone M5 (archive).
Background & Motivation
A network server that receives a push holds the certificate chain of the client. The parity rule in the design requires the archive to hold the same state. A future import (Phase 2) also uses the chain to validate the scope of the archive data.
A normal save of a certificate into the archive alias sends queries to the default database, for two reasons (#362). Morango's Certificate.save takes its MPTT lock on the default database. The Certificate model also uses django-mptt, which selects its database through the router and its default manager, and ignores save(using=...).
Certificate.scope_definition is a foreign key. The archive must hold the ScopeDefinition rows of the chain before the certificates are inserted, or the insert fails with IntegrityError.
Design: spec. Plan: implementation plan, Task 20.
Description & Expected Outcomes
The archive writes a certificate chain, ordered from root to leaf, into its own database. Every stored certificate has no private key, even when the source certificate has one. The stored rows keep the same serialized and signature values as the source.
The chain is a single path of certificates. The tree fields for each row follow the formula in spec §3.5. A walk of parent_id from the leaf in the archive reaches the root. The certificate objects of the caller do not change.
Deliverables & Contracts
The feature delivers these capabilities:
Archive.write_certificates(chain)writes the chain into the archive alias.- Every stored row has
private_keyset to NULL. - The archive holds the
ScopeDefinitionof every certificate in the chain. - The write path does not use MPTT save or tree-mutation methods.
Acceptance Criteria
- A chain of three certificates with private keys is stored with
private_keyNULL on every row. - The tree fields of each row equal the formula in spec §3.5.
- A walk of
parent_idfrom the leaf in the archive alias reaches the root. - The stored
serializedandsignaturevalues equal the source values. - The source certificate objects are unchanged after the call.
- A chain whose
ScopeDefinitionis not in the archive is written without anIntegrityError. - The test passes inside
assert_no_default_db_queries().
Technical Pointers & Architecture
- Target Components / Context:
morango/sync/archive.py(Archive). - Related Patterns:
Certificate(morango/models/certificates.py:36) andCertificate.save_certificate_chain(morango/models/certificates.py:192). - Data Model & Schema Considerations: No schema change.
- Resilience & Failure Modes: If the write fails, the error propagates, and the caller discards the archive.
Notes & Tradeoffs
- Dependencies: Blocked by: #378 (
Archive.create,discard, andArchiveDatabase). Blocks: #383. - Testing Requirements: Unit tests in
tests/testapp/tests/sync/test_archive.pyunder the Default-DB guard. - Tradeoffs & Alternatives Considered: #362 (spike) tests the MPTT routing behavior. A direct bulk insert with explicit tree fields is simple because the chain has no branches.
- Security: An archive never contains private keys. This rule is a hard requirement of the design.
Metadata
- Complexity: Low
- Target Branch: release-v0.9.x
AI Usage
Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.
- 主要言語
- Python
- スター
- 15
- フォーク
- 27
- 平均マージ
- 6日 44分
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
learningequality/morango のほかの issue
-
Document disk export and deprecations in the changelog再び着手できるかも @ArpitaSamanta10 が 14 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンDEV: dev-ops DEV: distributions DOCS: developer
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
learningequality/morango#387 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
DEV: backend DEV: dev-ops TAG: unit tests
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
learningequality/morango#385 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 54/100
learningequality/morango#425 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 1/100
learningequality/morango#424 ·
メンテナーはふだん 1 日以内に返信
-
DEV: backend P2 - normal
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
learningequality/morango#416 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
learningequality/morango の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"対応中かも @cestercian が今日担当しました。 オープンcomp/cli P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#162259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
upstream update
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
conan-io/conan-center-index#31597 ·
メンテナーはふだん 1 日以内に返信
-
bug enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AOSSIE-Org/PictoPy#1802 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
community-request
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA-NeMo/Run#727 ·
メンテナーはふだん 1 日以内に返信