SCITT/SCRAPI: refactor to SCRAPI lifecycle, per-participant registration, storage backend#136
Open
howethomas wants to merge 4 commits intomainfrom
Open
SCITT/SCRAPI: refactor to SCRAPI lifecycle, per-participant registration, storage backend#136howethomas wants to merge 4 commits intomainfrom
howethomas wants to merge 4 commits intomainfrom
Conversation
Replace the DataTrails-specific OIDC authentication and registration with generic SCRAPI calls to SCITTLEs (self-hosted transparency service). Register vcon_created and vcon_enhanced lifecycle events per draft-howe-vcon-lifecycle, storing COSE receipts as scitt_receipt analysis entries on each vCon. - Remove OIDC_Auth class and DataTrails-specific endpoints - Add register_statement() with sync (201) and async (303) SCRAPI handling - Add wait_for_entry_id() polling and get_receipt() for async flow - Store receipt metadata (entry_id, vcon_operation, vcon_hash) on vCon - Add 12 unit tests covering registration, polling, and link runner - Document SCITT Lifecycle Registration in README Co-Authored-By: Claude Opus 4.6 <[email protected]>
The conserver's __init__.py uses ``from links.scitt import ...`` which registers submodules under ``links.scitt.*`` in sys.modules, while pytest imports create a parallel ``server.links.scitt.*`` entry. Patching the wrong module object meant time_sleep, requests.get, and VconRedis mocks had no effect — tests hit real services and took 80s. Fixes: - Use ``links.scitt.register_signed_statement`` path for submodule attribute mocks (time_sleep, requests.get/post) - Use ``links.scitt.create_hashed_signed_statement`` for COSE mocks - Use ``server.links.scitt`` for __init__.py namespace names (VconRedis) - Replace http://scittles:8000 with non-routable RFC 6761 URL (http://scrapi.test.invalid:9999) as safety net - Test suite now runs in 0.5s instead of 80s Co-Authored-By: Claude Opus 4.6 <[email protected]>
Each vCon party with a tel field now gets a separate SCITT entry with
subject=tel:{number}, enabling customer data portal queries like
WHERE subject = 'tel:+12026661834'. Falls back to vcon:// subject
when no parties have tel. Link version bumped to 0.3.0.
Changes:
- links/scitt: Loop over parties, register per-participant, store
receipt array instead of single receipt
- storage/scitt: New per-participant storage backend with same
party iteration pattern
- Handle both dict and Party object access for tel field
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- mock_vcon fixture: set parties = [{"tel": "+15551234567"}] so
(vcon.parties or []) is iterable and produces one subject
- test_run_uses_fallback_subject: set mock_vcon.parties = [] so
fallback subject vcon:// is used
- Add subject to expected receipt body in test_run_registers_and_stores_receipt
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the SCITT link from DataTrails to SCRAPI lifecycle registration, adds per-participant SCITT for portal queryability, fixes test mocks, and adds a SCITT storage backend. SCITT-only changes (no other consolidation stack).
Changes
1. Refactor SCITT link from DataTrails to SCRAPI lifecycle (7cf1acf)
client_id,client_secret,auth_url) andOIDC_Authclass.register_statement(scrapi_url, signed_statement)with sync (201) and async (303) handling,wait_for_entry_id()polling,get_receipt().scrapi_url,signing_key_path,issuer,key_id,vcon_operation,store_receipt.scitt_receiptanalysis entries on the vCon.server/links/scitt/tests/test_scitt.py.2. Fix SCITT test mocks leaking to live SCITTLEs (d6f2daa)
server.links.scitt.*while the conserver loadslinks.scitt.*.links.scitt.register_signed_statementandlinks.scitt.create_hashed_signed_statement; patchVconRedisonserver.links.scitt.http://scrapi.test.invalid:9999as safety net.3. Per-participant SCITT and SCITT storage (06c797d)
telgets a separate SCITT entry withsubject=tel:+number, enabling portal queries (e.g.WHERE subject = 'tel:+12026661834'). Falls back tovcon://{vcon_uuid}when no parties have tel. Receipts stored as array on vCon.server/storage/scitt/: Post-chain storage backend that registers per-participant SCITT entries. Options:scrapi_url,signing_key_path,issuer,key_id,operations(e.g.["vcon_enhanced"]). Does not write receipts back to the vCon (avoids races with parallel storage). Transparency service is authoritative for receipts.Made with Cursor