Skip to content

refactor(oid4vc): convert public_routes.py and routes.py to packages#2934

Closed
burdettadam wants to merge 1 commit intoopenwallet-foundation:mainfrom
Indicio-tech:refactor/oid4vc-route-packages
Closed

refactor(oid4vc): convert public_routes.py and routes.py to packages#2934
burdettadam wants to merge 1 commit intoopenwallet-foundation:mainfrom
Indicio-tech:refactor/oid4vc-route-packages

Conversation

@burdettadam
Copy link
Copy Markdown
Contributor

Summary

Convert the monolithic public_routes.py and routes.py modules into Python packages (public_routes/ and routes/ directories with __init__.py files). This prepares for follow-up PRs that decompose these into focused submodules.

Changes

  • public_routes.pypublic_routes/__init__.py
  • routes.pyroutes/__init__.py
  • Fix relative imports (.xxx..xxx) to account for the new nesting depth

What this does NOT change

  • Zero logic changes — all route handlers, schemas, and registration functions are identical
  • All existing imports (from oid4vc.routes import ..., from oid4vc.public_routes import ...) continue to work unchanged
  • No new dependencies, no behavior changes

Verification

git diff --stat -M   # shows only renames (98-99% similarity)

This is the first in a series of PRs decomposing #2871 into smaller, independently reviewable changes.

@burdettadam burdettadam marked this pull request as draft April 3, 2026 19:45
…ubmodules

Split two large monolithic files into organized package directories:

public_routes.py (953 lines) -> public_routes/ package:
  - credential_offer.py: credential offer dereference endpoint
  - metadata.py: credential issuer metadata endpoint
  - nonce.py: nonce creation and request
  - notification.py: notification endpoint
  - token.py: token endpoint, check_token, proof of possession
  - credential.py: credential issuance endpoint
  - verification.py: OID4VP verification (get_request, post_response)
  - status_list.py: status list endpoint

routes.py (1854 lines) -> routes/ package:
  - exchange.py: exchange record CRUD
  - credential_offer.py: credential offer helpers and endpoints
  - supported_credential.py: supported credential CRUD
  - vp_request.py: VP request creation and listing
  - vp_dcql.py: DCQL query CRUD
  - vp_pres_def.py: presentation definition CRUD
  - vp_presentation.py: VP presentation listing and retrieval
  - did_jwk.py: DID JWK creation
  - helpers.py: issuer config endpoints

Both __init__.py files re-export all public symbols so existing
imports (from oid4vc.routes import X, from oid4vc.public_routes import Y)
continue to work without changes.

Signed-off-by: Adam Burdett <burdettadam@gmail.com>
@burdettadam burdettadam force-pushed the refactor/oid4vc-route-packages branch from b8aa18c to ccb749c Compare April 3, 2026 20:16
@burdettadam burdettadam closed this Apr 3, 2026
@burdettadam burdettadam deleted the refactor/oid4vc-route-packages branch April 3, 2026 20:59
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