How eu-digital-identity-wallet/eudi-srv-wallet-provider works
1. Purpose and scope
- This repository implements a Wallet Provider service for EUDI/OpenID4VCI issuance flows.
- It exposes HTTP endpoints for challenge generation, Wallet Instance Attestation (WIA) issuance, Wallet Unit Attestation (WUA) issuance, and discovery metadata.
- The service is intentionally positioned as a testing/development implementation, with optional attestation validation.
2. Top-level architecture
- The code is organized as a hexagonal / ports-and-adapters service inside wallet-provider-service.
- The main layers are:
- domain: immutable business model and specifications
- port/input: application use cases
- port/output: outbound contracts to crypto, attestation validation, and status-list services
- adapter: concrete implementations of those contracts
- config: HTTP routes and runtime wiring
3. Process entrypoint and runtime
- Main.kt is the service entrypoint.
- The application appears to run as a single JVM server process with configuration-driven startup/shutdown behavior.
- The service is designed to be containerized; the root repo includes Docker/OCI publishing workflow definitions and runtime configuration via environment variables.
4. HTTP API surface
- The config/*Routes.kt files define the public API:
- ChallengeRoutes.kt for issuing single-use challenges
- WalletInstanceAttestationRoutes.kt for WIA issuance
- WalletUnitAttestationRoutes.kt for WUA issuance
- MetadataRoutes.kt for well-known discovery endpoints
- OpenAPI is checked in under openapi/openapi.json, and Swagger UI can serve it from a configurable path.
5. Core business domain
- The domain model is split by capability:
- walletinstanceattestation
- walletunitattestation
- keyattestation
- tokenstatuslist
- walletinformation
- time
- This tells you the service is centered on attestation issuance and the associated claims, validity windows, and signing-time semantics rather than generic wallet management.
6. Use-case orchestration
- Input ports in port/input define the application workflows:
- GenerateChallenge
- IssueWalletInstanceAttestation
- IssueWalletUnitAttestation
- These are the primary orchestration boundaries: routes call use cases; use cases compose domain rules and outbound services; adapters provide concrete crypto/validation behavior.
7. Outbound integrations and cryptography
- The port/output interfaces abstract:
- challenge validation
- JWT signing and signature validation
- platform key attestation validation
- status list token generation
- Concrete adapters in adapter/jose, adapter/keyattestation, and adapter/tokenstatuslist implement those capabilities.
- This keeps signing/validation concerns isolated from the attestation issuance logic.
8. Attestation issuance data flow
- The issuance flow is:
1. client requests a challenge
2. client includes that challenge in platform key attestation data
3. client submits a WIA or WUA issuance request
4. server validates the challenge and, optionally, validates the platform key attestation
5. server signs and returns the attestation
- The README makes a key distinction between:
- mock mode: no attestation validation, issue directly
- validated mode: verify Android/iOS platform key attestations using Warden Supreme-based validation
9. External systems and optional dependencies
- The service can optionally validate platform attestations using the Warden Supreme Attestation Library.
- It can also optionally call an external status list service (eudi-srv-statuslist-py) to embed Token Status List tokens in issued Wallet Instance Attestations.
- These integrations are feature flags / configuration-driven, so the service can run without them.
10. Configuration and trust boundaries
- Most operational behavior is controlled via environment variables in WalletProviderConfiguration.kt and WalletProviderApplicationConfiguration.kt.
- Important configuration domains are:
- server lifecycle and bind port
- issuer identity and public URL
- signing key material / keystore
- challenge length and validity
- attestation validity windows
- wallet metadata fields
- optional platform-attestation validation rules
- optional token-status-list integration
- This makes configuration the main boundary between deployment environment and application logic.
11. Discovery and metadata
- The service publishes Protected Resource Metadata at /.well-known/oauth-protected-resource.
- It also ships an OpenAPI document and Swagger UI support, so discovery is part of the public contract, not just documentation.
- This is important for diagramming because metadata endpoints are a separate concern from attestation issuance.
12. Testing and quality surface
- Tests are present under src/test/kotlin, including coverage for the main app and WIA issuance behavior.
- Repo-level CI includes dependency checks, secret scanning, Sonar, and container publishing workflows, which supports a release-oriented but still development-focused service.
Main entry points: IssueWalletInstanceAttestation.kt Issue WIA · IssueWalletUnitAttestation.kt Issue WUA · WalletProviderApplicationConfiguration.kt App Config · WalletProviderConfiguration.kt Service Config
Components 23
Core Logic
Domain model and use-case orchestration
- Generate Challenge · Creates single-use challenges
wallet-provider-service/src/main/kotlin/port/input/challenge/GenerateChallenge.kt - Issue WIA · Orchestrates wallet instance attestation issuance
wallet-provider-service/src/main/kotlin/port/input/walletinstanceattestation/IssueWalletInstanceAttestation.kt - Issue WUA · Orchestrates wallet unit attestation issuance
wallet-provider-service/src/main/kotlin/port/input/walletunitattestation/IssueWalletUnitAttestation.kt - WIA Model · Claims and validity rules for wallet instance attestations
wallet-provider-service/src/main/kotlin/domain/walletinstanceattestation/WalletInstanceAttestationClaims.kt - WUA Model · Claims and validity rules for wallet unit attestations
wallet-provider-service/src/main/kotlin/domain/walletunitattestation/WalletUnitAttestationClaims.kt - Wallet Info · Wallet metadata used in issued attestations
wallet-provider-service/src/main/kotlin/domain/walletinformation/WalletInformation.kt - Clock · Time abstraction for validity windows
wallet-provider-service/src/main/kotlin/domain/time/Clock.kt - Specs · Shared specifications and type aliases
wallet-provider-service/src/main/kotlin/domain/Specs.kt - Challenge Port · Challenge validation contract
wallet-provider-service/src/main/kotlin/port/output/challenge/ValidateChallenge.kt - JOSE Port · JWT signing and verification contracts
wallet-provider-service/src/main/kotlin/port/output/jose/SignJwt.kt - KeyAtt Port · Platform attestation validation contract
wallet-provider-service/src/main/kotlin/port/output/keyattestation/ValidateKeyAttestation.kt - Status Port · Status list token generation contract
wallet-provider-service/src/main/kotlin/port/output/tokenstatuslist/GenerateStatusListToken.kt
Runtime & API
Entry point, HTTP routes, and application wiring
- Main · Service startup and shutdown
wallet-provider-service/src/main/kotlin/Main.kt - App Config · Environment-driven wiring and server settings
wallet-provider-service/src/main/kotlin/config/WalletProviderApplicationConfiguration.kt - Service Config · Issuer, keys, validity, and feature flags
wallet-provider-service/src/main/kotlin/config/WalletProviderConfiguration.kt - Challenge API · Challenge generation endpoint
wallet-provider-service/src/main/kotlin/config/ChallengeRoutes.kt - WIA API · Wallet Instance Attestation issuance endpoint
wallet-provider-service/src/main/kotlin/config/WalletInstanceAttestationRoutes.kt - WUA API · Wallet Unit Attestation issuance endpoint
wallet-provider-service/src/main/kotlin/config/WalletUnitAttestationRoutes.kt - Metadata API · Protected resource and discovery metadata
wallet-provider-service/src/main/kotlin/config/MetadataRoutes.kt
Adapters
Concrete crypto and external-service implementations
- JOSE · JWT signing and signature validation
wallet-provider-service/src/main/kotlin/adapter/jose/SignumSignJwt.kt - Key Attestation · Platform key attestation validation
wallet-provider-service/src/main/kotlin/adapter/keyattestation/MakotoValidateKeyAttestation.kt - Status List · Generates token status list tokens
wallet-provider-service/src/main/kotlin/adapter/tokenstatuslist/TokenStatusListServiceGenerateStatusListToken.kt
Contracts
Published discovery and API descriptions
- OpenAPI · Published API specification
openapi/openapi.json
Connections 31
- Main → App Config: boots · Initializes the service runtime
- App Config → Service Config: reads · Loads environment-driven settings
- App Config → Challenge API: wires · Exposes challenge endpoint
- App Config → WIA API: wires · Exposes WIA endpoint
- App Config → WUA API: wires · Exposes WUA endpoint
- App Config → Metadata API: wires · Exposes discovery endpoints
- Challenge API → Generate Challenge: calls · Delegates challenge creation
- WIA API → Issue WIA: calls · Delegates WIA issuance
- WUA API → Issue WUA: calls · Delegates WUA issuance
- Metadata API → OpenAPI: serves · Publishes API contract
- Generate Challenge → Challenge Port: validates · Checks challenge use and freshness
- Issue WIA → WIA Model: applies · Builds WIA claims
- Issue WIA → Wallet Info: uses · Includes wallet metadata
- Issue WIA → Clock: bounds · Applies issuance validity windows
- Issue WIA → Challenge Port: checks · Validates challenge before issuance
- Issue WIA → KeyAtt Port: optional · Validates platform key attestation in validated mode
- Issue WIA → Status Port: optional · Requests token status list token
- Issue WIA → JOSE Port: signs · Produces signed attestation JWT
- Issue WUA → WUA Model: applies · Builds WUA claims
- Issue WUA → Clock: bounds · Applies issuance validity windows
- Issue WUA → Challenge Port: checks · Validates challenge before issuance
- Issue WUA → KeyAtt Port: optional · Validates platform key attestation in validated mode
- Issue WUA → JOSE Port: signs · Produces signed attestation JWT
- JOSE → JOSE Port: implements · Concrete signing and verification
- Key Attestation → KeyAtt Port: implements · Concrete key attestation validation
- Status List → Status Port: implements · Concrete status list token generation
- Service Config → JOSE: configures · Provides signing material and issuer identity
- Service Config → Key Attestation: toggles · Enables optional attestation validation
- Service Config → Status List: toggles · Enables optional status list integration
- Specs → WIA Model: shared by · Common spec support
- Specs → WUA Model: shared by · Common spec support