Add regression coverage for legacy CA identifier parsing
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
Inizia dalla CaIdentifierServiceTest esistente in tests/php/Unit/Service/CaIdentifierServiceTest.php, poi leggi lib/Service/CaIdentifierService.php per vedere cosa restituiscono getCaIdParsed() e generatePkiDirectoryName() per gli ID _e:o e _e:c. Aggiungi casi con nome nel data provider che verifichino ogni campo analizzato e i nomi esatti delle directory, oltre al rifiuto di ID malformati. È completato quando composer test:unit -- --filter CaIdentifierServiceTest passa e le nuove asserzioni fallirebbero se il contratto di parsing cambiasse.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Goal
Add deterministic regression tests for legacy LibreSign CA identifiers, protecting current OpenSSL and CFSSL behavior before the multi-CA registry is introduced.
Current implementation
Start with:
lib/Service/CaIdentifierService.phptests/php/Unit/Service/CaIdentifierServiceTest.php
Existing tests already cover CA ID generation, some validation cases and one OpenSSL PKI-directory name. They do not thoroughly assert the parsed fields returned by getCaIdParsed() or cover both engine types in directory-name generation.
Scope
Extend the existing unit test class with named data providers where helpful. Verify:
- Correct parsing through public
getCaIdParsed()for legacy OpenSSL (_e:o) and CFSSL (_e:c) IDs, includinginstanceId,generation,engineTypeandengineName. - Expected directory paths from
generatePkiDirectoryName()for both engine types and representative generations. - Rejection of malformed or unsupported IDs by the public parsing path.
- Preservation of the existing ID shape and output without modifying production code.
Use synthetic identifiers and mocked IAppConfig. Do not invoke private methods directly or generate real CA keys.
Acceptance criteria
- Tests cover both engines and at least one positive and negative parsing scenario.
- Assertions compare all important parsed fields and exact directory-name outputs, not just non-null values.
- Tests fail when the legacy parsing or directory-path contract is unintentionally changed.
- Existing
CaIdentifierServiceTestremains deterministic and passes. - No production CA logic, public identifier format, storage layout or CRL URL is modified.
Tests
Run composer test:unit -- --filter CaIdentifierServiceTest and applicable PHP syntax/static checks. Include the command results in the PR.
Next steps in the parent epic (not this task)
The multi-CA epic will later create a persistent issuer registry, retain compatibility with these legacy identifiers, and introduce context-aware CA operations and CRL routing. These tests are a baseline for compatibility, not the new registry implementation.
Good first issue
All work stays inside an established PHPUnit test class with a small public service contract. Follow its existing DataProvider examples. No database, encryption, authorization or CA lifecycle changes are required. Check for an active PR; questions and coordination are optional.
Additional context
- Questions can be asked directly in this issue.
- LibreSign community: https://t.me/LibreSign
- Lingua principale
- PHP
- Stelle
- 844
- Fork
- 176
- Merge medio
- 13h 46m
- PR unite (30g)
- 299
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LibreSign/libresign
-
OpenSSL engine: leaf certificates get O=Internet Widgits Pty Ltd, ST=Some-State from system openssl.cnfForse già presa @vitormattos l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
LibreSign/libresign#9366 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
LibreSign/libresign#9007 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
LibreSign/libresign#8284 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
backend enhancement php
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
I maintainer di solito rispondono entro 1 giorno
-
backend enhancement php
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di LibreSign/libresign
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
backdrop-contrib/commerce#65 ·
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Evalogical-Inc/devReady#66 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mollie/PrestaShop#1627 ·
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
FriendsOfFlarum/follow-tags#118 ·
-
WebP — PHP 8.5 deprecation "Using null as an array offset" in url_to_path() for relative image URLsAperta✨️ai-candidate effort: [XS] module: webp cache priority: low type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno