Skip to content

refactor(did): sdata.did als dokumentiertes Subpackage + Tests#10

Merged
lepy merged 1 commit into
masterfrom
refactor/did-subpackage
Jun 24, 2026
Merged

refactor(did): sdata.did als dokumentiertes Subpackage + Tests#10
lepy merged 1 commit into
masterfrom
refactor/did-subpackage

Conversation

@lepy

@lepy lepy commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Überblick

Refactor des sdata/did/-Bereichs zu einem sauberen, dokumentierten Subpackage sdata.did (pure-Python-Designziel beibehalten).

Änderungen

  • Echtes Subpackage: relative Importe, kuratiertes __init__ mit Lazy-Loading (PEP 562) und __all__; CLIs via python -m sdata.did.<modul>.
  • Neue Module: errors.py (Ausnahmehierarchie DidError/EncodingError/ResolutionError/VerificationError) und jose.py (gemeinsame Compact-JWS/EdDSA-Schicht — entfernt die Duplizierung zwischen issue_vc und verify_vp).
  • Robustheit: Bibliothekscode wirft VerificationError/ResolutionError statt SystemExit; neue verify_presentation() mit aud/nonce/Gültigkeitsprüfung (nbf/exp, testbare now=).
  • Krypto: pure-Python beibehalten (python-ecdsa + base58); ed25519.py als nicht constant-time Lern-Referenz markiert (nicht im Funktionspfad).
  • Logging statt print; vollständige Type-Hints und Docstrings; sdata/did/README.md.
  • Packaging: setup.py mit extras_require={'did': ['ecdsa','base58']} (behebt zuvor undeklarierte Abhängigkeiten), python_requires>=3.7, aktualisierte Klassifizierer.

Tests

tests/test_did.py: 44 Tests über die Paket-API, ohne Netzwerk (HTTP gemockt). Lokal grün (44 passed).

Sicherheitshinweis

Der produktive Krypto-Pfad (python-ecdsa) ist bewusst dependency-arm, aber nicht garantiert constant-time. Für hochsensible Umgebungen ist ein libsodium-/cryptography-Backend empfehlenswert (im Code/README dokumentiert).

- echtes Subpackage: relative Importe, kuratiertes __init__ mit Lazy-Loading
  (PEP 562) und __all__; CLIs via `python -m sdata.did.<modul>`
- neue Module errors.py (Ausnahmehierarchie) und jose.py (gemeinsame
  Compact-JWS/EdDSA-Schicht; entfernt Duplizierung in issue_vc/verify_vp)
- Bibliothekscode wirft VerificationError/ResolutionError statt SystemExit;
  neue verify_presentation() mit aud/nonce/Gueltigkeitspruefung
- Logging statt print; vollstaendige Type-Hints und Docstrings; README.md
- pure-Python-Krypto beibehalten (python-ecdsa); ed25519.py als nicht
  constant-time Lern-Referenz markiert (nicht im Funktionspfad)
- setup.py: extras_require {did: ecdsa, base58}, python_requires>=3.7,
  Klassifizierer aktualisiert
- tests/test_did.py: 44 Tests ueber die Paket-API, ohne Netzwerk (gemockt)
@lepy lepy merged commit a8b388b into master Jun 24, 2026
1 of 2 checks passed
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 50 high · 2 medium · 48 minor

Alerts:
⚠ 100 issues (≤ 0 issues of at least minor severity)

Results:
100 new issues

Category Results
Documentation 48 minor
Security 50 high
Complexity 2 medium

View in Codacy

🟢 Metrics 165 complexity · 0 duplication

Metric Results
Complexity 165
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant