feat: implementation for OID4VC and OID4VP
What
- Implemented APIs for OID4VC and OID4VP
- Used version
0.6.1-pr-2091-20241119140918
Summary by CodeRabbit
-
New Features
- Introduced comprehensive OpenID4VC support, including endpoints for issuance sessions, issuers, verifiers, and holders.
- Added new controllers and services for managing OpenID4VC entities and sessions.
- Expanded API models and types for OpenID4VC operations and metadata.
-
Bug Fixes
- Corrected minor syntax issues and improved import handling for dynamic modules.
-
Chores
- Updated and added dependencies, improved ESLint configuration, and upgraded CI workflows.
- Improved code formatting and consistency across controllers and services.
Walkthrough
This update introduces comprehensive OpenID4VC support by adding new controllers, services, types, and route registrations for issuance sessions, issuers, verifiers, and holders. It also updates dependencies, refactors ESLint configuration, and improves code consistency. Several patches are applied to external dependencies, and minor formatting and import adjustments are made throughout the codebase.
Changes
| Files/Areas | Change Summary |
|---|---|
.eslintrc.js, eslint.config.mjs |
Replaces old ESLint config with a new modular config using ES module syntax, tailored for TypeScript, config, and test files. |
.github/workflows/continuous-*.yml |
Updates CI to run on more branches, upgrades Node and Ubuntu versions, and minor workflow tweaks. |
package.json |
Updates and adds dependencies, removes some, reformats scripts, adds resolutions, and removes Node engine requirement. |
patches/@credo-ts+core+* |
Applies and removes patches affecting message forwarding, credential/proof protocol logic, and message type handling in @credo-ts/core. |
README.md, src/authentication.ts, src/index.ts, src/securityMiddleware.ts, tsconfig.* |
Minor formatting, comment, or whitespace changes. |
bin/afj-rest.js, src/events/WebhookEvent.ts |
Switches from static to dynamic imports for modules, adds error handling to CLI bootstrap. |
src/utils/logger.ts, src/utils/TsyringeAdapter.ts, src/utils/tsyringeTsoaIocContainer.ts |
Refactors logger construction, adjusts IoC container method typings for simplicity. |
src/cli.ts |
Refactors yargs CLI setup for clarity and conciseness, updates import paths. |
src/cliAgent.ts |
Integrates OpenID4VC modules and routers into agent setup and inbound transport registration. |
src/controllers/*Controller.ts, src/events/*Events.ts |
Reorders and deduplicates imports, adds trailing commas, and improves formatting in controllers and event handlers. |
src/controllers/openid4vc/holder/holder.Controller.ts, holder.service.ts |
Adds new Holder controller and service for OpenID4VC holder operations (SD-JWT, mdoc, credential offers, proofs). |
src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts, .service.ts |
Adds new IssuanceSessions controller/service for managing OpenID4VC issuance sessions and credential offers. |
src/controllers/openid4vc/issuers/issuer.Controller.ts, issuer.service.ts |
Adds new Issuer controller/service for OpenID4VC issuer management. |
src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts, .service.ts |
Adds new VerificationSessions controller/service for OpenID4VC verifier session and authorization response management. |
src/controllers/openid4vc/verifiers/verifier.Controller.ts, verifier.service.ts |
Adds new Verifier controller/service for OpenID4VC verifier management. |
src/controllers/openid4vc/types/*.ts |
Introduces new type definitions for OpenID4VC holder, issuer, and verifier operations. |
src/controllers/types.ts, src/enums/enum.ts, src/utils/constant.ts, src/utils/oid4vc-agent.ts |
Adds foundational types, enums, and utility functions/constants for OpenID4VC and general data modeling. |
src/dto/vCredentialIssuerMetadataDraft14.ts |
Adds a draft DTO class for credential issuer metadata. |
src/routes/routes.ts |
Registers new OpenID4VC-related routes/controllers, adds corresponding models/types, and updates some existing models. |
Sequence Diagram(s)
sequenceDiagram
participant Client
participant ExpressServer
participant OpenID4VC_Controller
participant OpenID4VC_Service
participant Agent
%% Example: Creating a Credential Offer (Issuance Session)
Client->>ExpressServer: POST /openid4vc/issuance-sessions/create-credential-offer
ExpressServer->>OpenID4VC_Controller: createCredentialOffer(request)
OpenID4VC_Controller->>OpenID4VC_Service: createCredentialOffer(options, agent)
OpenID4VC_Service->>Agent: createCredentialOffer(options)
Agent-->>OpenID4VC_Service: offer/session record
OpenID4VC_Service-->>OpenID4VC_Controller: offer/session record
OpenID4VC_Controller-->>ExpressServer: offer/session record
ExpressServer-->>Client: offer/session record
%% Example: Holder requests credential
Client->>ExpressServer: POST /openid4vc/holder/request-credential
ExpressServer->>OpenID4VC_Controller: requestCredential(body)
OpenID4VC_Controller->>OpenID4VC_Service: requestCredential(agent, body)
OpenID4VC_Service->>Agent: requestAndStoreCredentials(...)
Agent-->>OpenID4VC_Service: credential(s)
OpenID4VC_Service-->>OpenID4VC_Controller: result
OpenID4VC_Controller-->>ExpressServer: result
ExpressServer-->>Client: result
Possibly related issues
- credebl/platform#1308: This update introduces OpenID4VC verification APIs and related controllers/services, directly addressing the objectives described in this issue.
Suggested labels
enhancement
Poem
A bunny hops with code anew,
OpenID4VC dreams come true!
Issuers, holders, verifiers—oh my!
Fresh routes and types now multiply.
With sessions issued, proofs in hand,
This rabbit’s code will surely stand.
🥕✨
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Explain this complex logic. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai explain this code block. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and explain its main purpose. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Quality Gate passed
Issues
35 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.3% Duplication on New Code
@coderabbitai review
✅ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.