How fiware/vcverifier works
Project Identification and Purpose
• This project is a server-side component written in Go that implements verifiable credentials verification following the SIOP-2/OIDC4VP standards. In other words, it supports authentication flows by exchanging verifiable credentials for a signed JWT.
• The solution is designed to be deployed as a container (with a Dockerfile and Kubernetes helm-chart support), integrates with a configuration service as well as external trusted registries (EBSI and Gaia-X) to validate issuers, and exposes a RESTful API (documented with an OpenAPI spec).
Analyzing the File Structure
• Top-level directories like “api”, “config”, “openapi”, “views”, “common”, “gaiax”, “jades”, “tir”, and “verifier” indicate a clear separation of concerns.
• The “api” folder holds the API definitions (e.g. api.yaml) describing the endpoints.
• The “openapi” directory, with files like “routers.go” and the various data model files, shows that the API contracts and request/response models are both specified and tested.
• The “config” directory contains configuration management logic (with sample YAML files) and the service provider interface.
• “common” contains shared utilities (for caching, HTTP utilities, time handling, token signing, etc.).
• The “verifier” and “tir” directories hold the core verification logic and the client implementation to contact external registry services.
• The “views” directory shows that the project also provides a simple UI (like a QR-based login page) to start the authentication flow.
• CI/CD workflows exist under “.github/workflows” for tests, pre-release, and releases.
• A Dockerfile is provided for containerization, emphasizing that deployment scenarios include container-based and Kubernetes use.
Key Components and Their Interactions
• Core Server & Endpoints:
• The “main.go” file bootstraps the application.
• Endpoints implemented in the “api” and “openapi” directories deal with SIOP-2/OIDC4VP flows (login, authentication response, token issuance, etc.).
• Presentation Layer:
• The “views” directory, including static assets (CSS, JS, images) and templates (e.g., “verifier_present_qr.html”), comprises the login page that renders the QR code.
• Configuration & Logging:
• Configuration logic (from “config” and YAML files like “server.yaml”) determines service parameters such as port, session expiry, and endpoints for external services.
• The “logging” directory holds logging configuration which is essential for observability.
• External Integration & Verification:
• The “verifier”, “gaiax”, “jades”, and “tir” packages implement the business logic including:
▪ Fetching trusted issuer/participant information from external registries (EBSI, Gaia-X)
▪ Validating incoming verifiable credentials against policies and registry data.
• “common” utilities (e.g. tokenSigner) ensure that JWTs are created and signed properly.
• API Contract & Testing:
• The OpenAPI specification in “api/api.yaml” alongside model definitions (in “openapi”) ensure the endpoints’ contracts are clear.
• Various test files (e.g., tests in “config” and “tir”) support the reliability of these integrations.